codelldb
codelldb copied to clipboard
Breakpoint in dynamic link library cannot be hit
OS: ubuntu20.04 VSCode version: 1.81.1 x64 windows CodeLLDB version: v1.9.2 Compiler: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 Debuggee: Dynamic link library, selectively loaded through the address in the configuration file
The breakpoint in dynamic link library cannot be hit, but there is no such problem in the native lldb. When i debug dynamic link library, which is selectively loaded through the address in the configuration file. The config file is similar to the following:
"preRunCommands": [
"module_id": "Segment",
"class_name": "map_Segment",
"package": "./lib/lib_my.so",
"inputs": [
{
"port_id": "port_id_0",
"topic": "/topic/seg/map"
}
],
]
the "lib/lib_my.so" is my dynamic link library, The breakpoint in it cannot be hit
But when I add the following command in launch.json, the problem is solved:
"preRunCommands": [
"settings set target.exec-search-paths ./lib",
"target modules add ./lib/lib_my.so",
]
Verbose log
The config file is similar to the following:
Um, what config file? This certainly does not look like a valid Codelldb's "preRunCommands" section...
But when I add the following command in launch.json,
Well, sounds like you have a solution?
The difference in behavior with CLI lldb could be due to debugger's current working directory. Codelldb always launches adapter with cwd=${workspaceFolder}, whereas you probably launch CLI lldb from your app's directory?