diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-12-02 22:24:32 +0100 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-12-02 22:24:32 +0100 |
commit | 04affae3ef7aa124b6ac0ce4f3a54063b7b4784f (patch) | |
tree | e7b3b2a4e5c71cce09d6ea41c6bba22e7c0322ba /gdb/testsuite/gdb.dwarf2 | |
parent | aee4bf85057de1905f5bfaad2a4be0295905d7fb (diff) | |
download | gdb-04affae3ef7aa124b6ac0ce4f3a54063b7b4784f.zip gdb-04affae3ef7aa124b6ac0ce4f3a54063b7b4784f.tar.gz gdb-04affae3ef7aa124b6ac0ce4f3a54063b7b4784f.tar.bz2 |
Record objfile->original_name as an absolute path
gdb/
2013-12-02 Doug Evans <dje@google.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
* objfiles.c (allocate_objfile): Save original_name as an absolute
path.
* objfiles.h (struct objfile): Expand comment on original_name.
* source.c (openp): Call gdb_abspath.
* utils.c (gdb_abspath): New function.
* utils.h (gdb_abspath): Declare.
gdb/testsuite/
2013-12-02 Doug Evans <dje@google.com>
* gdb.dwarf/dwp-symlink.c: Fake out gdb to not load debug info
at start.
* gdb.dwarf/dwp-symlink.exp: Test trying to load dwp when the binary
has been specified with a relative path and we have chdir'd before
accessing the debug info.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dwp-symlink.c | 7 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dwp-symlink.exp | 20 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.c b/gdb/testsuite/gdb.dwarf2/dwp-symlink.c index 5be12fb..a93d5e7 100644 --- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.c +++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.c @@ -15,6 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +/* Cheezy hack to prevent set_initial_language from trying to look up main. + We do this so that gdb won't try to open the dwp file when the file is + first selected. This gives us a chance to do a chdir before attempting + to access the debug info. */ +asm (".globl main.main"); +asm ("main.main: .byte 0"); + int main (int argc, char **argv) { diff --git a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp index ad0522b..a0daae4 100644 --- a/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp +++ b/gdb/testsuite/gdb.dwarf2/dwp-symlink.exp @@ -75,3 +75,23 @@ gdb_test "ptype main" {type = int \(\)} "binary default, dwp at symlink" clean_restart "$thelink" gdb_test "ptype main" {type = int \(int, char \*\*\)} "binary symlink, dwp at symlink" + +# Verify we can still find the dwp if we change directories and we specified +# a relative path for the program. + +set saved_pwd [pwd] + +# This is clean_restart, but specifying a relative path to the binary. +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_test "cd [file dirname [standard_output_file ${thelink}]]" \ + "Working directory .*" +gdb_load "./${thelink}" + +gdb_test "cd .." "Working directory .*" + +gdb_test "ptype main" {type = int \(int, char \*\*\)} \ + "relative path, binary symlink, dwp at symlink" + +cd $saved_pwd |