]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/solib: rename convenience variable to _linker_namespace
authorGuinevere Larsen <guinevere@redhat.com>
Thu, 15 May 2025 14:07:03 +0000 (11:07 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Thu, 5 Jun 2025 11:54:06 +0000 (08:54 -0300)
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>
gdb/NEWS
gdb/doc/gdb.texinfo
gdb/solib.c
gdb/testsuite/gdb.base/default.exp
gdb/testsuite/gdb.base/dlmopen-ns-ids.exp

index 507e53359ce47209a6e4beb972163e3abc59bbaf..4dcc344b07278654b1d54ca71db6749d62890d01 100644 (file)
--- 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.
index 9aad9e7bc702e0f4359087145ac9df6784156a1f..7d06e1f5fa4eb1fc348f8b22a90f79f019ae5e6b 100644 (file)
@@ -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
index afc1dcc02baf9a4593ddffeda8ab114465153227..3e821ba418a40ffa565ddadaa0ad76f9936a6d0c 100644 (file)
@@ -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 (
index b012ace7d1358c352ba42e6de9212e35fd06568e..01e3cc12bd3ef5dfc82f6d28717f8db34b734366 100644 (file)
@@ -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 \
index cae1be75b770dc00fe0aaaf9ccbe5fb828a8f1fc..801022b769e3c7de93cc072ff647c7fc1f9459c8 100644 (file)
@@ -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
 }