поиск gdb исходных каталогов

Как насчет того, чтобы преобразовать в нижний регистр сначала? можно использовать string.lower().

21
задан Vijay 9 July 2009 в 12:02
поделиться

3 ответа

Or you can do something like this, for debugging program prog with source in directory srcdir:

gdb `find srcdir -type d -printf '-d %p '` prog

I think it's a more direct answer to your question. Also useful if your executable doesn't contain the compilation directories and/or you don't have version 6.6+ of gdb.

16
ответ дан 29 November 2019 в 20:06
поделиться
(gdb) help files
Specifying and examining files.

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.  
DIR can also be $cwd for the current working directory, or $cdir for the  
directory in which the source file was compiled into object code.  
With no argument, reset the search path to $cdir:$cwd, the default.  
5
ответ дан 29 November 2019 в 20:06
поделиться

Для этого вам понадобится команда set substitute-path .

    (gdb) set substitute-path /usr/src/include /mnt/include

Однако доступна только в последних версиях (6.6+) gdb.

28
ответ дан 29 November 2019 в 20:06
поделиться
Другие вопросы по тегам:

Похожие вопросы: