> gdbserver 0:2345 hello_world
Process /home/troy/git/hello_world_exe/hello_world created; pid = 232163
Listening on port 2345
Remote debugging from host 127.0.0.1, port 52854
> gdb -q --interpreter=mi2
=thread-group-added,id="i1"
(gdb)
-gdb-set substitute-path /usr/src /home/troy/git/hello_world_c
^done
(gdb)
-target-select remote 0:2345
=tsv-created,name="trace_timestamp",initial="0"
=thread-group-started,id="i1",pid="232163"
~"Reading /home/troy/git/hello_world_exe/hello_world from remote target...\n"
&"warning: File transfers from remote targets can be slow. Use \"set sysroot\" to access files locally instead.\n"
~"Reading /home/troy/git/hello_world_exe/hello_world from remote target...\n"
~"Reading symbols from target:/home/troy/git/hello_world_exe/hello_world...\n"
=thread-created,id="1",group-id="i1"
~"Reading /lib64/ld-linux-x86-64.so.2 from remote target...\n"
~"Reading /lib64/ld-linux-x86-64.so.2 from remote target...\n"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="target:/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7fc5090",to="0x00007ffff7fee335"}]
~"Reading /usr/lib/debug/.build-id/21/a2739157f98ff49d8920f47723a6a3ddb1f4d1.debug from remote target...\n"
~"0x00007ffff7fe32b0 in _start () from target:/lib64/ld-linux-x86-64.so.2\n"
*stopped,frame={addr="0x00007ffff7fe32b0",func="_start",args=[],from="target:/lib64/ld-linux-x86-64.so.2",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="1"
^connected
(gdb)
-break-insert -t -f main
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x000055555555514f",func="main",file="hello_world.c",fullname="/home/troy/git/hello_world_c/hello_world.c",line="8",thread-groups=["i1"],times="0",original-location="main"}
(gdb)
-exec-continue
^running
*running,thread-id="all"
(gdb)
~"Reading /lib/x86_64-linux-gnu/libc.so.6 from remote target...\n"
=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="target:/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00007ffff7da1700",to="0x00007ffff7f33abd"}]
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x000055555555514f",func="main",file="hello_world.c",fullname="/home/troy/git/hello_world_c/hello_world.c",line="8",thread-groups=["i1"],times="1",original-location="main"}
~"\n"
~"Temporary breakpoint 1, main () at hello_world.c:8\n"
~"8\t int i = 77;\n"
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x000055555555514f",func="main",args=[],file="hello_world.c",fullname="/home/troy/git/hello_world_c/hello_world.c",line="8",arch="i386:x86-64"},thread-id="1",stopped-threads="all",core="2"
=breakpoint-deleted,id="1"
(gdb)
The "fullname" field in the
breakpoint-hitstopped event doesn't contain the mapped path. I've captured both thelldb-miandgdbcommands and traces for comparison. Based on the mapping the/usr/src/hello_world.csource path should be mapped to/home/troy/git/hello_world_c/hello_world.c, but is instead being reported without the mapping (i.e.,/usr/src/hello_world.c).Additionally,
bkptnodoesn't match the actual breakpoint number either.lldb-mi
commands
lldb-server gdbserver 0:2345 hello_world & lldb-mi settings append target.source-map /usr/src /home/troy/git/hello_world_c settings show target.source-map -target-select remote 0:2345 -break-insert -t -f main -exec-continuelldb-mi trace
gdb
commands
gdbserver 0:2345 hello_world & gdb -q --interpreter=mi2 -gdb-set substitute-path /usr/src /home/troy/git/hello_world_c -target-select remote 0:2345 -break-insert -t -f main -exec-continuegdb trace