[lldb-dev] gdb-remote protocol questions

Jason Molenda via lldb-dev lldb-dev at lists.llvm.org
Sun Jan 26 13:20:51 PST 2020


I suspect your problem may be related to lldb not knowing how to walk the stack on this target.  Is  mips-unknown-linux-gnu correct?  What do you see if you turn on unwind logging, 'log enable lldb unwind'.  You can also have lldb show you the unwind rules at the current pc value with 'image show-unwind -a $pc'.  I don't know what unwinders we have defined for this target in lldb right now -- if you have eh_frame information in your binary, lldb should read & use that.  Otherwise, if you have an assembly instruction profiler in lldb for mips, and start addresses for your functions, lldb should be able to inspect the instruction stream and figure out how to unwind out of the function correctly.  As a last resort, it will fall back to architecture rules for how to backtrace out of a function (defined in the ABI plugin) but those are often incorrect in prologue/epilogues (start & end of a function).



(btw if you support no-ack mode, there's a lot less packet traffic between your stub and lldb - recommended.)


J




> On Jan 25, 2020, at 3:08 PM, Alexander Zhang via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> Hi,
> 
> I've been implementing a basic RSP protocol server for remotely debugging a MIPS simulator, and have been having some trouble getting certain lldb features to work there, in particular backtraces (bt) and instruction step over (ni). Does someone know what packets these commands rely on to work? I've attached some communication logs, and if it helps my code is at https://github.com/CQCumbers/nmulator/blob/master/src/debugger.h
> 
> Please forgive me if this isn't the right place to ask - I know this isn't directly part of lldb development but I've tried several other places and haven't been able to find anyone familiar with the subject.
> 
> Also, just a user question, but is there a way to show register values in hex format without leading zeros?
> 
> Thanks,
> Alexander
> <packets.txt>_______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list