aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/dlmopen-ns-ids.exp')
-rw-r--r--gdb/testsuite/gdb.base/dlmopen-ns-ids.exp20
1 files changed, 16 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
index 8f52199..4d3e8eb 100644
--- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
+++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
@@ -112,7 +112,7 @@ proc_with_prefix test_conv_vars {} {
gdb_test "print \$_active_linker_namespaces" "1" \
"1 namespace before starting inferior"
- gdb_test "print \$_current_linker_namespace" "No registers." \
+ gdb_test "print \$_linker_namespace" "No registers." \
"No current namespace before starting inferior"
if { ![runto_main] } {
@@ -121,7 +121,7 @@ proc_with_prefix test_conv_vars {} {
gdb_test "print \$_active_linker_namespaces" "1" \
"Before activating namespaces"
- gdb_test "print \$_current_linker_namespace" ".*\"\\\[\\\[0\\\]\\\]\"" \
+ gdb_test "print \$_linker_namespace" ".* = 0" \
"Still in the default namespace"
gdb_breakpoint "inc" allow-pending
@@ -130,10 +130,16 @@ proc_with_prefix test_conv_vars {} {
foreach_with_prefix dl {3 2 1} {
gdb_continue_to_breakpoint "inc"
- gdb_test "print \$_current_linker_namespace" ".*\"\\\[\\\[$dl\\\]\\\]\"" \
+ gdb_test "print \$_linker_namespace" ".* = $dl" \
"Verify we're in namespace $dl"
}
+ # Check that we display the namespace of the selected
+ # frame, not the lowermost one.
+ gdb_test "up" "\#1.*in main.*"
+ gdb_test "print \$_linker_namespace" ".* = 0" \
+ "print namespace of selected frame"
+
gdb_continue_to_breakpoint "first dlclose"
gdb_test "print \$_active_linker_namespaces" "4" "all SOs loaded"
@@ -154,7 +160,7 @@ proc_with_prefix test_conv_vars {} {
# breakpoints and pending breakpoints at the same time with
# gdb_breakpoint.
gdb_test "next" ".*assert.*" "load the first SO"
- gdb_breakpoint "inc if \$_streq(\$_current_linker_namespace, \"\[\[2\]\]\")"
+ gdb_breakpoint "inc if \$_linker_namespace == 2"
gdb_continue_to_breakpoint "inc"
gdb_continue_to_end "" continue 1
}
@@ -163,6 +169,12 @@ proc_with_prefix test_conv_vars {} {
proc test_info_linker_namespaces {} {
clean_restart $::binfile
+ # Check that "info linker-namespaces" while the inferior is not running
+ # doesn't crash.
+ gdb_test "info linker-namespaces" \
+ "Current inferior does not support linker namespaces\\. Use \"info sharedlibrary\" instead\\." \
+ "info linker-namespaces before running"
+
if { ![runto_main] } {
return
}