From: Nicolas Blanc <nicolas.blanc@intel.com>
To: gdb-patches@sourceware.org, lgustavo@codesourcery.com
Cc: nicolas.blanc@intel.com
Subject: [PATCH v10 5/5] Test 'info files' after 'add-symbol-file' and 'remove-symbol-file'.
Date: Mon, 24 Jun 2013 08:36:00 -0000 [thread overview]
Message-ID: <1372062967-28510-6-git-send-email-nicolas.blanc@intel.com> (raw)
In-Reply-To: <1372062967-28510-1-git-send-email-nicolas.blanc@intel.com>
2013-17-06 Nicolas Blanc <nicolas.blanc@intel.com>
gdb/testsuite
* gdb.base/sym-file.exp: Test 'info files'.
Signed-off-by: Nicolas Blanc <nicolas.blanc@intel.com>
---
gdb/testsuite/gdb.base/sym-file.exp | 44 ++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/gdb/testsuite/gdb.base/sym-file.exp b/gdb/testsuite/gdb.base/sym-file.exp
index 873e488..9387b95 100644
--- a/gdb/testsuite/gdb.base/sym-file.exp
+++ b/gdb/testsuite/gdb.base/sym-file.exp
@@ -17,14 +17,16 @@
# 1) Run to gdb_add_symbol_file in $srcfile.
# 2) Set a pending breakpoint at bar in $libsrc.
# 3) Load $shlib_name using 'add-symbol-file'.
-# 4) Continue to bar in $libsrc.
-# 5) Set a breakpoint at foo in $librc.
-# 6) Continue to foo in $libsrc.
-# 7) Set a breakpoint at gdb_remove_symbol_file.
-# 8) Continue to gdb_remove_symbol_file in $srcfile.
-# 9) Remove $shlib_name using 'remove-symbol-file'.
-# 10) Check that the breakpoints at foo and bar are pending.
-# 11) Check that the execution can continue without error.
+# 4) 'info files' must display $libname.
+# 5) Continue to bar in $libsrc.
+# 6) Set a breakpoint at foo in $librc.
+# 7) Continue to foo in $libsrc.
+# 8) Set a breakpoint at gdb_remove_symbol_file.
+# 9) Continue to gdb_remove_symbol_file in $srcfile.
+# 10) Remove $shlib_name using 'remove-symbol-file'.
+# 11) 'info files' must not display $libname, anymore.
+# 12) Check that the breakpoints at foo and bar are pending.
+# 13) Check that the execution can continue without error.
if [skip_shlib_tests] {
return 0
@@ -91,33 +93,38 @@ if { $result != 0 } then {
return
}
-# 4) Continue to bar in $libsrc to ensure that the breakpoint
+# 4) 'info files' must display $libname.
+gdb_test "info files" \
+ "^(?=(.*${libname})).*" \
+ "info files must display $libname"
+
+# 5) Continue to bar in $libsrc to ensure that the breakpoint
# was bound correctly after adding $shilb_name.
set lnum_bar [gdb_get_line_number "break at bar" ${libfile}.c]
gdb_continue_to_breakpoint bar ".*$libfile\\.c:$lnum_bar.*"
-# 5) Set a breakpoint at foo in $libsrc.
+# 6) Set a breakpoint at foo in $libsrc.
set result [gdb_breakpoint foo]
if { !$result } then {
return
}
-# 6) Continue to foo in $libsrc to ensure that the breakpoint
+# 7) Continue to foo in $libsrc to ensure that the breakpoint
# was bound correctly.
set lnum_foo [gdb_get_line_number "break at foo" ${libfile}.c]
gdb_continue_to_breakpoint foo ".*$libfile\\.c:$lnum_foo.*"
-# 7) Set a breakpoint at gdb_remove_symbol_file in $srcfile for
+# 8) Set a breakpoint at gdb_remove_symbol_file in $srcfile for
# removing $shlib_name.
set result [gdb_breakpoint gdb_remove_symbol_file]
if { !$result } then {
return
}
-# 8) Continue to gdb_remove_symbol_file in $srcfile.
+# 9) Continue to gdb_remove_symbol_file in $srcfile.
gdb_continue_to_breakpoint gdb_remove_symbol_file
-# 9) Remove $shlib_name using 'remove-symbol-file'.
+# 10) Remove $shlib_name using 'remove-symbol-file'.
set result [gdb_test "remove-symbol-file -a addr" \
""\
"remove-symbol-file -a addr" \
@@ -128,7 +135,12 @@ if { $result != 0 } then {
return
}
-# 10) Check that the breakpoints at foo and bar are pending after removing
+# 11) 'info files' must not display $libname, anymore.
+gdb_test "info files" \
+ "^(?!(.*${libname})).*" \
+ "info files must not display ${libname}"
+
+# 12) Check that the breakpoints at foo and bar are pending after removing
# $shlib_name.
gdb_test "info breakpoints 2" \
".*PENDING.*" \
@@ -138,6 +150,6 @@ gdb_test "info breakpoints 3" \
".*PENDING.*" \
"check if Breakpoint 3 is pending."
-# 11) Check that the execution can continue without error.
+# 13) Check that the execution can continue without error.
gdb_continue_to_end
--
1.7.1
next prev parent reply other threads:[~2013-06-24 8:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-24 8:36 [PATCH v10 0/5] remove-symbol-file & add-symbol-file Nicolas Blanc
2013-06-24 8:36 ` [PATCH v10 3/5] Documentation for the remove-symbol-file command Nicolas Blanc
2013-06-24 16:39 ` Eli Zaretskii
2013-06-25 9:39 ` Blanc, Nicolas
2013-06-25 15:13 ` Eli Zaretskii
2013-06-24 8:36 ` [PATCH v10 1/5] New " Nicolas Blanc
2013-06-24 8:36 ` Nicolas Blanc [this message]
2013-06-24 8:36 ` [PATCH v10 2/5] Test adding and removing a symbol file at runtime Nicolas Blanc
2013-06-24 11:33 ` [PATCH v10 4/5] 'add-symbol-file' should update the current target sections Nicolas Blanc
2013-06-24 12:56 ` [PATCH v10 0/5] remove-symbol-file & add-symbol-file Luis Machado
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1372062967-28510-6-git-send-email-nicolas.blanc@intel.com \
--to=nicolas.blanc@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=lgustavo@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox