Specify source file explicitly when setting a breakpoint
authorYao Qi <yao@codesourcery.com>
Tue, 20 May 2014 05:45:54 +0000 (13:45 +0800)
committerYao Qi <yao@codesourcery.com>
Mon, 26 May 2014 01:11:15 +0000 (09:11 +0800)
When I run no-thread-db.exp, the breakpoint is set on line 26.
However, the breakpoint is set to line 26 of dl-start.S rather than
no-thread-db.c, which is not intended.

(gdb) monitor set libthread-db-search-path /foo/bar^M
libthread-db-search-path set to `/foo/bar'^M
(gdb) PASS: gdb.server/no-thread-db.exp: libthread-db is now unresolvable
break 26^M
Breakpoint 1 at 0x48018078: file ../sysdeps/powerpc/powerpc32/dl-start.S, line 26.^M
(gdb) continue^M
Continuing.

This patch is to change the breakpoint setting with source file
specified, then it is correct now.

gdb/testsuite:

2014-05-26  Yao Qi  <yao@codesourcery.com>

* gdb.server/no-thread-db.exp: Specify source file name
explicitly when setting a breakpoint.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.server/no-thread-db.exp

index 11f49ea9a4d08824b848e836a4cbb991efd3816e..de32b614c97680727f3339e5d55c712938f12262 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-26  Yao Qi  <yao@codesourcery.com>
+
+       * gdb.server/no-thread-db.exp: Specify source file name
+       explicitly when setting a breakpoint.
+
 2014-05-23  Markus Metzger  <markus.t.metzger@intel.com>
 
        * gdb.btrace/vdso.c: New.
index 9246fa9bb579b54358985ef00d551cbba4046953..8a9c2919c6fb3c29f9ae04e7f6ddf2d29e376c96 100644 (file)
@@ -47,7 +47,7 @@ gdb_test "monitor set libthread-db-search-path ${unresolvable_thread_db_path}" \
     "libthread-db is now unresolvable"
 
 # Continue past tls assignment to make sure tls storage is allocated.
-gdb_breakpoint [gdb_get_line_number "after tls assignment"]
+gdb_breakpoint ${srcfile}:[gdb_get_line_number "after tls assignment"]
 gdb_continue_to_breakpoint "after tls assignment"
 
 # Printing a tls variable should fail gracefully without a libthread_db.