[lldb-dev] Odd output issue with lldb -s

Ted Woodward via lldb-dev lldb-dev at lists.llvm.org
Thu Sep 24 10:30:53 PDT 2020


I have a very simple lldb script:

thread select 1
disassemble --start-address $pc-24 --end-address $pc+24


When I run lldb with -o "process launch -s" and -s "dis.lldb", I get odd output - the disassembly from "thread select 1" and from the disassemble command run together.

This is what I see with top-of-tree on Ubuntu 16:

bin/lldb /bin/ls -o "process launch -s" -s dis.lldb
(lldb) target create "/bin/ls"
Current executable set to '/bin/ls' (x86_64).
(lldb) process launch -s
Process 32258 launched: '/bin/ls' (x86_64)
(lldb) command source -s 0 'dis.lldb'
Executing commands in '/local/mnt/ted/tip/full/dis.lldb'.
(lldb) thread select 1
(lldb) disassemble --start-address $pc-24 --end-address $pc+24
* thread #1, name = 'ls', stop reason = signal SIGSTOP
    frame #0: 0x00007ffff7dd7c30 ld-2.23.so`_start
ld-2.23.so`_start:
->  0x7ffff7dd7c30 <+0>: movq   %rsp, %rdi
    0x7ffff7dd7c33 <+3>: callq  0x7ffff7dd89b0            ; _dl_start at rtld.c:353

ld-2.23.so`_dl_start_user:
    0x7ffff7dd7c38 <+0>: movq   %rax, %r12
    0x7ffff7dd7c3b <+3>: movl   0x225037(%rip), %eax      ; _dl_skip_args
ld-2.23.so`oom:
    0x7ffff7dd7c18 <+13>: xorl   %eax, %eax
    0x7ffff7dd7c1a <+15>: callq  0x7ffff7de88f0            ; _dl_dprintf at dl-misc.c:275
    0x7ffff7dd7c1f <+20>: movl   $0x7f, %edi
    0x7ffff7dd7c24 <+25>: callq  0x7ffff7df24f0            ; __GI__exit at _exit.c:27
    0x7ffff7dd7c29:       nopl   (%rax)
ld-2.23.so`_start:
->  0x7ffff7dd7c30 <+0>:  movq   %rsp, %rdi
    0x7ffff7dd7c33 <+3>:  callq  0x7ffff7dd89b0            ; _dl_start at rtld.c:353

ld-2.23.so`_dl_start_user:
    0x7ffff7dd7c38 <+0>:  movq   %rax, %r12
    0x7ffff7dd7c3b <+3>:  movl   0x225037(%rip), %eax      ; _dl_skip_args
    0x7ffff7dd7c41 <+9>:  popq   %rdx
    0x7ffff7dd7c42 <+10>: leaq   (%rsp,%rax,8), %rsp
    0x7ffff7dd7c46 <+14>: subl   %eax, %edx
(lldb)

Note that the address goes from c3b to c18 right after ld-2.23.so`oom.

How can I separate the outputs of thread select and disassemble? If I stick in something like "register read pc" in between the thread select and the dis, I get the output from it before the output from the thread select and dis.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20200924/2b894014/attachment.html>


More information about the lldb-dev mailing list