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

Jason Molenda via lldb-dev lldb-dev at lists.llvm.org
Mon Dec 4 18:08:21 PST 2017


lldb doesn't know what register set exists - if you do 'register read' you'll see that there are no registers.  Maybe gdbserver doesn't implement the target.xml request (it's their packet definition!  c'mon!)  

Download the x86_64 target def file from

http://llvm.org/svn/llvm-project/lldb/trunk/examples/python/

and load it in your .lldbinit file or on the cmd line

lldb -O 'settings set plugin.process.gdb-remote.target-definition-file /path/to/def-file.py' 



> On Dec 4, 2017, at 5:56 PM, David Manouchehri via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> My apologizes if this is mentioned somewhere already, couldn't find
> anything on the subject; it seems that gdb-remote doesn't work very
> well (or at all in my tests) with gdbserver.
> 
> Tim Hammerquist was also able to reproduce issues when attempting to
> use gdb-remote with gdbserver. (Test with freebsd/gdbserver,
> freebsd/lldb38, freebsd/gdbserver, and macos/lldb-900.0.57.)
> 
> Could we document this somewhere? It's not a large issue since there's
> alternatives like lldb-server and Facebook's ds2, but it's a bit
> confusing to new users who fairly expect a command called "gdb-remote"
> to work with gdbserver.
> 
> root at 17e840390f4d:~# lldb-3.8 date
> (lldb) target create "date"
> Current executable set to 'date' (x86_64).
> (lldb) # In another terminal: gdbserver localhost:4444 /tmp/date
> (lldb) gdb-remote localhost:4444
> Process 6593 stopped
> * thread #1: tid = 6593, stop reason = signal SIGTRAP
>    frame #0: 0xffffffffffffffff
> (lldb) c
> Process 6593 resuming
> Process 6593 stopped
> * thread #1: tid = 6593, stop reason = signal SIGTRAP
>    frame #0: 0xffffffffffffffff
> (lldb) c
> Process 6593 resuming
> Process 6593 stopped
> * thread #1: tid = 6593, stop reason = signal SIGSEGV
>    frame #0: 0xffffffffffffffff
> (lldb) c
> Process 6593 resuming
> Process 6593 exited with status = 11 (0x0000000b)
> 
> Thanks,
> 
> David Manouchehri
> _______________________________________________
> 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