Andes Workshop

It is currently Thu Mar 28, 2024 10:53 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: gdb指定路徑
PostPosted: Fri Jan 11, 2013 6:46 pm 
Offline
User avatar

Joined: Fri Mar 04, 2011 9:36 pm
Posts: 500
參考這裡的說明

http://sourceware.org/gdb/current/onlin ... ource-Path

directory dirname ...

dir dirname ...
Add directory dirname to the front of the source path. Several directory names may be given to this command, separated by `:' (`;' on MS-DOS and MS-Windows, where `:' usually appears as part of absolute file names) or whitespace. You may specify a directory that is already in the source path; this moves it forward, so gdb searches it sooner.
You can use the string `$cdir' to refer to the compilation directory (if one is recorded), and `$cwd' to refer to the current working directory. `$cwd' is not the same as `.'—the former tracks the current working directory as it changes during your gdb session, while the latter is immediately expanded to the current directory at the time you add an entry to the source path.


directory
Reset the source path to its default value (`$cdir:$cwd' on Unix systems). This requires confirmation.

set directories path-list
Set the source path to path-list. `$cdir:$cwd' are added if missing.

show directories
Print the source path: show which directories it contains.



set substitute-path from to
Define a source path substitution rule, and add it at the end of the current list of existing substitution rules. If a rule with the same from was already defined, then the old rule is also deleted.
For example, if the file /foo/bar/baz.c was moved to /mnt/cross/baz.c, then the command

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

will tell gdb to replace `/usr/src' with `/mnt/cross', which will allow gdb to find the file baz.c even though it was moved.

In the case when more than one substitution rule have been defined, the rules are evaluated one by one in the order where they have been defined. The first one matching, if any, is selected to perform the substitution.

For instance, if we had entered the following commands:

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


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group