[lldb-dev] software breakpoints show up in a memory read when debugging via rsp

Ted Woodward ted.woodward at codeaurora.org
Wed Apr 22 15:54:10 PDT 2015


Expected behavior when doing a memory read or disassembly is that software
breakpoints don't show up - the original code does.

 

Using lldb on x86 Linux, I run a test program and set a breakpoint, then
disassemble. I get this:

 

Process 22519 stopped

* thread #1: tid = 22519, 0x00000000004004db test`main(argc=1,
argv=0x00007fffffffea58) + 11 at test.c:3, name = 'test', stop reason =
breakpoint 1.1

    frame #0: 0x00000000004004db test`main(argc=1, argv=0x00007fffffffea58)
+ 11 at test.c:3

   1    int main (int argc, void **argv)

   2    {

-> 3      int i = 1;

   4      int j = 2;

   5      int k = 3;

   6      return 0;

   7    }

(lldb) dis 

test`main:

    0x4004d0 <+0>:  pushq  %rbp

    0x4004d1 <+1>:  movq   %rsp, %rbp

    0x4004d4 <+4>:  movl   %edi, -0x14(%rbp)

    0x4004d7 <+7>:  movq   %rsi, -0x20(%rbp)

->  0x4004db <+11>: int3   

    0x4004dc <+12>: hlt    

    0x4004de <+14>: addl   %eax, (%rax)

    0x4004e0 <+16>: addb   %al, (%rax)

 

 

Shouldn't the remote gdbserver (lldb-server, in this case) replace the
software breakpoint instructions with the actual opcodes?

 

--

Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150422/6f49f7a5/attachment.html>


More information about the lldb-dev mailing list