DavidSpickett wrote:

The test case is failing on Windows, for reasons not related to it being 
Windows but due to data layout.

The const string is placed at the start of a region:
```
(lldb) p rawptr
(const char *) 0x00007ff77fcb5000 "dead"
(lldb) memory region --all
<...>
[0x00007ff77fc61000-0x00007ff77fcb5000) r-x .text
[0x00007ff77fcb5000-0x00007ff77fcc2000) r-- .rdata
```
This means that when you read with offset `-1` it starts 1 byte into the 
`.text` section, reads that single byte, then returns.

(same thing would happen if the memory was the last part of a region, a 
positive offset would make the read end early when it hit the end of the region)

Your code needs to be aware that this may happen, or just do the memory read 
without looking up the region and assume that the lower layers do the right 
thing (I don't know if they do).

https://github.com/llvm/llvm-project/pull/104317
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to