[lldb-dev] gdb-remote incompatibility with gdbserver?

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Tue Dec 5 10:49:21 PST 2017


LLDB should be changed to error out if we don't get any register information from the remote GDB server and have the error message tell us that we need to add register definition file. Then this would be clear. Maybe a message like:

error: GDB server doesn't vend register information. You must specify a register definition file with "settings set plugin.process.gdb-remote.target-definition-file /path/to/def-file.py"

Though it does seem to be a bug that the "gdbserver" you were using doesn't support the Target XML packets that the GDB remote protocol defines? Is this some old version of GDB remote from many many years ago? Seems any recent gdbserver should have this feature?

Greg


> On Dec 4, 2017, at 6:30 PM, David Manouchehri via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Thanks, that did the trick! Should I add this information to
> https://llvm.org/viewvc/llvm-project/lldb/trunk/www/ and submit a
> review on Phabricator?
> 
> root at 13bfa9bdf1e7:/# lldb-5.0 /bin/date
> (lldb) target create "/bin/date"
> Current executable set to '/bin/date' (x86_64).
> (lldb) settings set plugin.process.gdb-remote.target-definition-file
> ./x86_64_linux_target_definition.py
> (lldb) gdb-remote localhost:4444
> (lldb) Process 5221 stopped
> * thread #1, stop reason = signal SIGTRAP
>    frame #0: 0x00002aaaaaaabc30
> ->  0x2aaaaaaabc30: movq   %rsp, %rdi
>    0x2aaaaaaabc33: callq  0x2aaaaaaac9b0
>    0x2aaaaaaabc38: movq   %rax, %r12
>    0x2aaaaaaabc3b: movl   0x225037(%rip), %eax
> 
> For those who run into this message in the future, here's the exact
> commands I ran to get gdbserver working:
> 
> wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
> sudo apt-add-repository "deb http://apt.llvm.org/xenial/
> llvm-toolchain-xenial-5.0 main"
> sudo apt-get update
> sudo apt-get -y install lldb-5.0 gdbserver
> wget https://llvm.org/svn/llvm-project/lldb/trunk/examples/python/x86_64_linux_target_definition.py
> # In another terminal run: gdbserver localhost:4444 /bin/date
> lldb-5.0 /bin/date
> settings set plugin.process.gdb-remote.target-definition-file
> ./x86_64_linux_target_definition.py
> gdb-remote localhost:4444
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list