lldb-mi icon indicating copy to clipboard operation
lldb-mi copied to clipboard

`-break-insert` response doesn't respect `target.source-map`

Open brownts opened this issue 1 year ago • 0 comments

The "fullname" field in the response doesn't contain the mapped path. I've captured both the lldb-mi and gdb commands and traces for comparison. Based on the mapping the /usr/src/hello_world.c source 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).

lldb-mi

commands
lldb-mi
settings append target.source-map /usr/src /home/troy/git/hello_world_c
settings show target.source-map
-file-exec-and-symbols hello_world
-break-insert -t -f main
lldb-mi trace
> lldb-mi
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'lldb.embedded_interpreter'
(gdb)
settings append target.source-map /usr/src /home/troy/git/hello_world_c
^done
(gdb)
settings show target.source-map
~"target.source-map (path-map) =\n[0] \"/usr/src\" -> \"/home/troy/git/hello_world_c\"\n\n"
^done
(gdb)
-file-exec-and-symbols hello_world
^done
(gdb)
=library-loaded,id="/home/troy/git/hello_world_exe/hello_world",target-name="/home/troy/git/hello_world_exe/hello_world",host-name="/home/troy/git/hello_world_exe/hello_world",symbols-loaded="0",loaded_addr="-",size="1560"
-break-insert -t -f main
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",pending=["main"],times="0",addr="0x000000000000114f",func="main",file="hello_world.c",fullname="/usr/src/hello_world.c",line="8",original-location="main"}
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",pending=["main"],times="0",addr="0x000000000000114f",func="main",file="hello_world.c",fullname="/usr/src/hello_world.c",line="8",original-location="main"}
(gdb)

gdb

commands
gdb -q --interpreter=mi2
-gdb-set substitute-path /usr/src /home/troy/git/hello_world_c
-file-exec-and-symbols hello_world
-break-insert -t -f main
trace
gdb -q --interpreter=mi2
=thread-group-added,id="i1"
(gdb) 
-gdb-set substitute-path /usr/src /home/troy/git/hello_world_c
^done
(gdb) 
-file-exec-and-symbols hello_world
^done
(gdb) 
-break-insert -t -f main
^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x000000000000114f",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)

brownts avatar Jan 04 '23 05:01 brownts