Re: [PATCH] Remote debugging without a binary (regression)

Luis Machado
2016-02-11T17:42:59Z

On 02/11/2016 03:31 PM, Pedro Alves wrote:
> On 02/11/2016 05:06 PM, Luis Machado wrote:
>
>> Does that make it clear?
>
> Sounds like we're missing a test. Say, a test in gdb.server/
> that:
>
> #1 - does "set sysroot /dev/null"
> #2 - connects
> #3 - does "disassemble", "si", "info registers", or something.
>
> Sounds like we currently fail step #2. Steps #3 would be there just
> to make sure the session is not semi-borked even if we connected
> successfully.

Yeah. Unfortunately that does not work well because GDB is smart enough
to try and load the binary gdbserver loaded, which happens to be sitting
in the same filesystem, so it won't fail.

I also attempted to delete the binary right after firing gdbserver up,
but it also does not fail, though GDB acknowledges now that the file has
been deleted.

The problematic scenario appears when one has two distinct filesystems.
Say, one in each machine. Then GDB won't be able to load the symbol file
and will error out.

This is usually the case when one is doing Linux cross debugging.