Re: Restarting gdbserver

Jan Kratochvil
2011-01-20T17:29:29Z

On Thu, 20 Jan 2011 16:00:07 +0100, Leon Pollak wrote:
> I read the docs about `set debug-file-directory' - it says that this is
> applicable in the case of the SEPARATE debug info, but I suppose that in my
> case it is inside the ELF module, no?

According to your environment description I agree you do not need
`set debug-file-directory'.

> I have the target's root FS on my PC in /opt/FS directory mounted via NFS.
> The development is done in another separate place - /Projects/CSU/...
> The compiled&linked executable module is hard-linked to the file in the
> /opt/FS/common/csu and I start the gdb saying:
> set sysroot /opt/FS/
> set remote exec-file /common/csu
>
> Is this insufficient?
> I can put break points and step through the code. The problem seems to be just
> with frame/backtrace only.

`set remote exec-file' only instructs remote gdbserver in --multi mode.
It does not provide symbols to local GDB in any way.

Tested two cases, run on machine A, with remote host host1s which is also
mounted at /host1:

./gdb -nx -ex 'set sysroot /host1' -ex 'set debug-file-directory /host1/usr/lib/debug' -ex 'file /host1/home/jkratoch/t/1' -ex 'target remote host1s:1234' -ex 'b main' -ex c
./gdbserver :1234 /home/jkratoch/t/1

or:

./gdb -nx -ex 'file /host1/home/jkratoch/t/1' -ex 'target extended-remote host1s:1234' -ex 'set sysroot /host1' -ex 'set remote exec-file /home/jkratoch/t/1' -ex start
./gdbserver --multi :1234

The `file' command provides the symbols for local GDB.

Regards,
Jan