aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuinevere Larsen <guinevere@redhat.com>2025-05-15 11:07:03 -0300
committerGuinevere Larsen <guinevere@redhat.com>2025-06-05 08:54:06 -0300
commit96662aacaa0cf0a9766d874fc9577a5da417dbcc (patch)
tree94d4e64ba53b6fd9db72d7d90b49ae59d950e592
parent9dbef4c2897df267fc0b783e673ddcc48ed04c90 (diff)
downloadbinutils-96662aacaa0cf0a9766d874fc9577a5da417dbcc.zip
binutils-96662aacaa0cf0a9766d874fc9577a5da417dbcc.tar.gz
binutils-96662aacaa0cf0a9766d874fc9577a5da417dbcc.tar.bz2
gdb/solib: rename convenience variable to _linker_namespace
Based on feedback from IRC and PR solib/32959, this commit renames the recently introduced convenience variable $_current_linker_namespace to the shorter name $_linker_namespace. This makes it more in line with existing convenience variables such as $_thread and $_inferior, and faster to type. It should be ok to simply change the name because the variable was never released to the public, so there should be no existing scripts depending on the name. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32959 Reviewed-By: Eli Zaretskii <eliz@gnu.org> Approved-By: Andrew Burgess <aburgess@redhat.com> Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r--gdb/NEWS2
-rw-r--r--gdb/doc/gdb.texinfo4
-rw-r--r--gdb/solib.c14
-rw-r--r--gdb/testsuite/gdb.base/default.exp2
-rw-r--r--gdb/testsuite/gdb.base/dlmopen-ns-ids.exp8
5 files changed, 15 insertions, 15 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index 507e533..4dcc344 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -41,7 +41,7 @@
is active.
* New built-in convenience variables $_active_linker_namespaces and
- $_current_linker_namespace. These show the number of active linker
+ $_linker_namespace. These show the number of active linker
namespaces, and the namespace to which the current location belongs to.
In systems that don't support linker namespaces, these always return
the integers 1 and 0 respectively.
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 9aad9e7..7d06e1f 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -13109,8 +13109,8 @@ environment variable.
Number of active linkage namespaces in the inferior. In systems with no
support for linkage namespaces, this variable will always be set to @samp{1}.
-@vindex $_current_linker_namespace@r{, convenience variable}
-@item $_current_linker_namespace
+@vindex $_linker_namespace@r{, convenience variable}
+@item $_linker_namespace
The namespace which contains the current location in the inferior. This
returns @value{GDBN}'s internal numbering for the namespace. In systems with no
support for linker namespaces, this variable will always be set to
diff --git a/gdb/solib.c b/gdb/solib.c
index afc1dcc..3e821ba 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1818,13 +1818,13 @@ default_find_solib_addr (solib &so)
return {};
}
-/* Implementation of the current_linker_namespace convenience variable.
+/* Implementation of the linker_namespace convenience variable.
This returns the GDB internal identifier of the linker namespace,
for the current frame, as an integer. If the inferior doesn't support
linker namespaces, this always returns 0. */
static value *
-current_linker_namespace_make_value (gdbarch *gdbarch, internalvar *var,
+linker_namespace_make_value (gdbarch *gdbarch, internalvar *var,
void *ignore)
{
const solib_ops *ops = gdbarch_so_ops (gdbarch);
@@ -1846,11 +1846,11 @@ current_linker_namespace_make_value (gdbarch *gdbarch, internalvar *var,
return value_from_longest (builtin_type (gdbarch)->builtin_int, nsid);
}
-/* Implementation of `$_current_linker_namespace' variable. */
+/* Implementation of `$_linker_namespace' variable. */
-static const struct internalvar_funcs current_linker_namespace_funcs =
+static const struct internalvar_funcs linker_namespace_funcs =
{
- current_linker_namespace_make_value,
+ linker_namespace_make_value,
nullptr,
};
@@ -1869,8 +1869,8 @@ _initialize_solib ()
/* Convenience variables for debugging linker namespaces. These are
set here, even if the solib_ops doesn't support them,
for consistency. */
- create_internalvar_type_lazy ("_current_linker_namespace",
- &current_linker_namespace_funcs, nullptr);
+ create_internalvar_type_lazy ("_linker_namespace",
+ &linker_namespace_funcs, nullptr);
set_internalvar_integer (lookup_internalvar ("_active_linker_namespaces"), 1);
add_com (
diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp
index b012ace..01e3cc1 100644
--- a/gdb/testsuite/gdb.base/default.exp
+++ b/gdb/testsuite/gdb.base/default.exp
@@ -772,7 +772,7 @@ set show_conv_list \
{$_shell_exitsignal = void} \
{$_shell_exitcode = 0} \
{$_active_linker_namespaces = 1} \
- {$_current_linker_namespace = <error: No registers.>}\
+ {$_linker_namespace = <error: No registers.>}\
}
if [allow_python_tests] {
append show_conv_list \
diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp
index cae1be7..801022b 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,7 +130,7 @@ 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"
}
@@ -154,7 +154,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 \$_current_linker_namespace == 2"
+ gdb_breakpoint "inc if \$_linker_namespace == 2"
gdb_continue_to_breakpoint "inc"
gdb_continue_to_end "" continue 1
}