Tell gdb where to find source files




















Stupid but it will work. Sometimes adding another source path is not enough if you have complex hierarchy. In this case you can add substitution rule for source path with set substitute-path GDB command. Here is how to do it within CPython project:. There are multiple ways to help GDB find sources, where the easiest ones are directory and set substitute-path commands, though -fdebug-prefix-map is really useful. Alex Dzyoba. Home Blog KB Feed.

Sam Brightman Sam Brightman 2, 4 4 gold badges 31 31 silver badges 30 30 bronze badges. Ref: titanwolf. List of commands: add-shared-symbol-files -- Load the symbols from shared objects in the dynamic linkers link map add-symbol-file -- Load symbols from FILE add-symbol-file-from-memory -- Load the symbols out of memory from a dynamically loaded object file cd -- Set working directory to DIR for debugger and program being debugged core-file -- Use FILE as core dump for examining memory and registers directory -- Add directory DIR to beginning of search path for source files edit -- Edit specified file or function exec-file -- Use FILE as program for getting contents of pure memory file -- Use FILE as program to be debugged forward-search -- Search for regular expression see regex 3 from last line listed generate-core-file -- Save a core file with the current state of the debugged process gdb help directory Add directory DIR to beginning of search path for source files.

Forget cached info on source file locations and line positions. Marc B k 39 39 gold badges silver badges bronze badges. For me directory command worked well. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

Previous: Error in Breakpoints , Up: Breakpoints. Previous: Signals , Up: Stopping. Next: Backtrace , Up: Stack. Previous: Frame Apply , Up: Stack. Next: Specify Location , Up: Source. Previous: Source Path , Up: Source. Next: Ambiguous Expressions , Up: Data. Previous: Searching Memory , Up: Data. Next: tdump , Up: Analyze Collected Data. Star New issue. Jump to bottom. Labels cp:devops.

Milestone backlog. Linked pull requests. Copy link.



0コメント

  • 1000 / 1000