Re: [PATCH 9/9] gdb/testsuite/dap: fix gdb.dap/basic-dap.exp disassembly test for PIE

Tom Tromey
2023-01-25T22:10:22Z

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

>>>> {... {"memoryReference": "0x115d"

Simon> The problem is that the PC to disassemble is taken from the breakpoint
Simon> insertion response, which happens before running. With a PIE
Simon> executable, that PC is unrelocated, but the disassembly request happens
Simon> after relocation.

This is an odd one. It isn't super clear when memory references are
invalidated. (The spec doesn't even define what a memory reference is.)

Simon> I chose to fix this by watching for a breakpoint changed event giving
Simon> the new breakpoint address, and recording the address from there. I
Simon> think this is an interesting way to fix it, because it adds a bit of
Simon> test coverage, I don't think these events are checked right now.

This seems pretty good to me.

Simon> - Do the disassembly by symbol instead of by address.

I don't think this is possible in DAP. One of the many holes.

Tom