From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2168 invoked by alias); 15 Dec 2008 22:38:59 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 2142 invoked by uid 306); 15 Dec 2008 22:38:58 -0000 Date: Mon, 15 Dec 2008 22:38:00 -0000 Message-ID: <20081215223858.2127.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: gdb X-Git-Refname: refs/heads/archer-tromey-python X-Git-Reftype: branch X-Git-Oldrev: 7a5b414ecee8a41ec23abf555747f521e7e82c05 X-Git-Newrev: 3af011f203616a293e1d709fe074e5eb8e62660d X-SW-Source: 2008-q4/txt/msg00211.txt.bz2 List-Id: The branch, archer-tromey-python has been updated via 3af011f203616a293e1d709fe074e5eb8e62660d (commit) from 7a5b414ecee8a41ec23abf555747f521e7e82c05 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 3af011f203616a293e1d709fe074e5eb8e62660d Author: Tom Tromey Date: Mon Dec 15 15:38:17 2008 -0700 gdb * python/python.c (gdbpy_new_objfile): Look in debug_file_directory as well. gdb/doc * gdb.texinfo (Auto-loading): Document debug-file-directory search. ----------------------------------------------------------------------- Summary of changes: gdb/ChangeLog | 5 +++++ gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 15 +++++++++++---- gdb/python/python.c | 17 +++++++++++++++++ 4 files changed, 38 insertions(+), 4 deletions(-) First 500 lines of diff: diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d147835..6828a6a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2008-12-15 Tom Tromey + * python/python.c (gdbpy_new_objfile): Look in + debug_file_directory as well. + +2008-12-15 Tom Tromey + * python/python.c (print_children): Wrap after ",". 2008-12-15 Tom Tromey diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 2f87e4c..bac5d78 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,10 @@ 2008-12-15 Tom Tromey + * gdb.texinfo (Auto-loading): Document debug-file-directory + search. + +2008-12-15 Tom Tromey + * gdb.texinfo (Basic Python): Document gdb.breakpoints. (Breakpoints in Python): New node. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dedf24b..1ada58b 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18192,10 +18192,17 @@ traceback. When a new object file (@pxref{Objfiles in Python}) is read (for example, due to the @code{file} command, or because the inferior has loaded a shared library), @value{GDBN} will look for a file named by -adding @samp{-gdb.py} to the object file's name. If this file exists -and is readable, @value{GDBN} will evaluate it as a Python script. -Note that, if a separate debug file is used, @value{GDBN} will look -for the @samp{-gdb.py} file both in the directory associated with the +adding @samp{-gdb.py} to the object file's real name (the name formed +after following all symlinks and resolving @code{.} and @code{..} +components). If this file exists and is readable, @value{GDBN} will +evaluate it as a Python script. + +If this file does not exist, and if the parameter +@code{debug-file-directory} is set, then @value{GDBN} will append the +object file's real name to the value of this parameter, and try again. + +Also, if a separate debug file is used, @value{GDBN} will look for the +@samp{-gdb.py} file both in the directory associated with the application and the directory associated with the separate debug file. When reading a @samp{-gdb.py} file, @var{GDBN} sets the ``current diff --git a/gdb/python/python.c b/gdb/python/python.c index 9a1d321..fd84f60 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -741,6 +741,23 @@ gdbpy_new_objfile (struct objfile *objfile) input = fopen (filename, "r"); + if (!input && debug_file_directory) + { + /* Also try the same file in the separate debug info directory. */ + char *debugfile; + + debugfile = xmalloc (strlen (filename) + + strlen (debug_file_directory) + 1); + strcpy (debugfile, debug_file_directory); + /* FILENAME is absolute, so we don't need a "/" here. */ + strcat (debugfile, filename); + + xfree (filename); + filename = debugfile; + + input = fopen (filename, "r"); + } + if (input) { /* We don't want to throw an exception here -- but the user hooks/post-receive -- Repository for Project Archer.