From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id B3ogD2pU5mls6CwAWB0awg (envelope-from ) for ; Mon, 20 Apr 2026 12:29:30 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jQIwp0op; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 28CF01E0BA; Mon, 20 Apr 2026 12:29:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 78A451E093 for ; Mon, 20 Apr 2026 12:29:28 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 9B1094B35884 for ; Mon, 20 Apr 2026 16:29:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B1094B35884 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jQIwp0op Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id A59954BA23CA for ; Mon, 20 Apr 2026 16:28:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A59954BA23CA Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A59954BA23CA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776702537; cv=none; b=pcDY0c6E+ir2jhj+maK84168Dkha+hKX7KKF8dxo0ZsdHKC6D1pe4Dg3uMiBPQJKdzYVyuI41XV3KbEAXAjw3uHvylFqYl70CwYGOapCsWtkuAZfnGWDetZawdd7k4FwdmUfFYvlTrD/6wnugd+4NvBqZ5A0gg9ed2FXD7qxl9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776702537; c=relaxed/simple; bh=/VGqLm771KvqCQhY06vhOMEiZLXxraHbFReQYcfdC3A=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=E5gZ62VXGSjHQaKrEClCt5l8P8B1DxC0BvI+st0bt0b7z5TuTybzCyXDZ6m1SElGJ590Rjc9TbsQgoRJVDQkwIFhv5aYfBKQe5zBFQI8LPTMPDrLLc5geQSUUj4CVRcnF0gPCeU3Q8S8OuJi5Oi/+DCN9QKZqlSQJAxoI+Tbmbw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A59954BA23CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776702536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P0/CHjAp/ZP4sxkBayY2IXK2g23s76nYLPDH5U5Sg6I=; b=jQIwp0opbnIlxiNXLey07I5flzB5y1qO5DN9I5wpndsAoWHlzKV46+nt44E6iR/LXMkIDi aXeQ3b3Odv9mmf8KzvaG0zT1fd/StIFJDkKx75zUbV6U/w87rtCVb9pJ2mlMePTYinPUao 1PePpPngM/cvhwOKM/O4m+/mqIhX0z4= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-672-Pk8eeIuYNsm6xEa4YKROCA-1; Mon, 20 Apr 2026 12:28:54 -0400 X-MC-Unique: Pk8eeIuYNsm6xEa4YKROCA-1 X-Mimecast-MFC-AGG-ID: Pk8eeIuYNsm6xEa4YKROCA_1776702533 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4836abfc742so36724325e9.0 for ; Mon, 20 Apr 2026 09:28:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776702533; x=1777307333; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=P0/CHjAp/ZP4sxkBayY2IXK2g23s76nYLPDH5U5Sg6I=; b=oXEVRXzcWXuKA/8pbct+eEAor8Sk7H+0qv2hwEZcREmMLl4ExhJUtLzrXMSFTjP49j B6RDLVAzhWnhRo/ZWBsbvpjEoqToUdxLkacdXcvaqpCQ9D12dPRRuvJx0FJqA+/NOFaY WDMhYCay0NX/x9aUyhZsfcr+Fu3c1+egX+Tl3W6JQHeFp+vcy2uLFbColXM9FebN/R/F Jhey+ILk/U6A6icE/5Y0jAjRynpmsiMRjljPrNtCfCCZ3nNwuH51eNMgF307T1J0Ix3/ lhUAAXd2Oj0FDG9narTFfru/TOd/yXvfP8sdh7UQFAwMRfusjf9FuGOW5I7taO2ROPGl PRhw== X-Forwarded-Encrypted: i=1; AFNElJ+i+J6WA8ULTP3rG8ks0iqWZPaMKQLIHEQONFUCpR+mT39nOGMXu/V8uD9t7MGRLLw6t7VTNexJtrUHBA==@sourceware.org X-Gm-Message-State: AOJu0YwZxUGqWQBWX4ljb+gUe6MH+mpsfyJJ8OOHonDn7VbVE1YKEAul PyT/WGpiv5sB3/t8pfwbmczG316yH2u3VtYKbGmQPoxg4X7J/z8ERUafUm0qVXWrgDrIOTrNlB7 6/s19g5pi0PRBMCtL49w65g1eJXArNDoMwcU1UhLRWuXeSt+AjmqDefamADziN/c= X-Gm-Gg: AeBDievUjEFA3AwhPM3o5dAjQuVnoHnGkeyMtEntChjNl/JYO8Lvorwqq4eup3rON0L TMuu8HiRvdy6EGZuglTQ1U8geOX4TL3+CXMWoTv+MqmbBe5VBIH1d9ypnDW3PSTRNzGMKyr8zUo d/8imnSnuH0WMOzT1vCDtbkCPmDFJ5WJuIZJXO9Q2qq60ZiE3aGhqP+GMuyIS/p4Q9rH5k72nqn V2OlHL8XJUC3I4cQh6N4Je3WVk1CakEIaO2vVYYukBsX3iGbm4/UD4FOASZDnnDqIPuV8t/XSxv vZINqgcOnhPAHlMKY+tXo1IucJBuwePzcwGh/+ywkFWLGpZcPdTBjHBGNEqO+CX3qlqhiU8YLok id/dFS315y11F+aO8hH+fnQMBrXg= X-Received: by 2002:a05:600c:a414:b0:48a:53ea:13e6 with SMTP id 5b1f17b1804b1-48a53ea14d3mr12185885e9.25.1776702532784; Mon, 20 Apr 2026 09:28:52 -0700 (PDT) X-Received: by 2002:a05:600c:a414:b0:48a:53ea:13e6 with SMTP id 5b1f17b1804b1-48a53ea14d3mr12185325e9.25.1776702532097; Mon, 20 Apr 2026 09:28:52 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fc181c6dsm274808515e9.6.2026.04.20.09.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Apr 2026 09:28:51 -0700 (PDT) From: Andrew Burgess To: Guinevere Larsen , gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: Re: [PATCH v7] gdb: Print linker namespace when showing a frame In-Reply-To: <20260113174341.3532973-1-guinevere@redhat.com> References: <20260113174341.3532973-1-guinevere@redhat.com> Date: Mon, 20 Apr 2026 17:28:50 +0100 Message-ID: <87se8p38al.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: PojE0TjC5CMm9fGINbI-HfaSO1UtNUM6H5U2Oay6CJ8_1776702533 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Guinevere Larsen writes: > When a user is stopped in a private linker namespace, the only way for > them to realize that is using the _linker_namespace convenience > variable. While serviceable, this is a sub-optimal solution, as most > users are unaware of convenience variables. > > This commit introduces a new way for users to be informed of the linker > namespace of a function, by printing it along with the function name. > This is done by using the proposed syntax for symbols and locations, > like so: > > #0 [[0]]::main () > > This is done by introducing a new method to general_symbol_info, which > uses part of the functionality behind the _linker_namespace variable > , namely, find the linker namespace that contains the given address on > the given program space. The reason print_name was not changed to do > this is that the old method returns a "const char *", but the new one > needs to return a string, and the refactor was very complicated, so the > new method is introduced. > > The namespace ID is only printed if multiple namespaces are active, > otherwise no change in behavior is expected. This commit also updates > the test gdb.base/dlmopen-ns-ids.exp to test this functionality. > --- > gdb/NEWS | 4 +++ > gdb/doc/gdb.texinfo | 9 ++++++ > gdb/solib.c | 29 ++++++++++------- > gdb/solib.h | 8 +++++ > gdb/stack.c | 9 ++++-- > gdb/symtab.c | 15 +++++++++ > gdb/symtab.h | 13 ++++++-- > .../gdb.base/dlmopen-ns-ids-framefilter.py | 31 +++++++++++++++++++ > gdb/testsuite/gdb.base/dlmopen-ns-ids.exp | 25 +++++++++++++-- > gdb/testsuite/gdb.mi/mi-dlmopen.exp | 2 +- > 10 files changed, 125 insertions(+), 20 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/dlmopen-ns-ids-framefilter.py > > diff --git a/gdb/NEWS b/gdb/NEWS > index cd0303fa199..80dfc25f824 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -54,6 +54,10 @@ > on the index. Any existing indexes should be regenerated. > * Support for Floating Point Mode Register (FPMR) in AArch64. > > +* When debugging an inferior with multiple linker namespaces, functions > + will be printed like so [[N]]::foo, where N is the namespace that > + contains foo. For example [[0]]::main. > + > * New targets > > GNU/Linux/MicroBlaze (gdbserver) microblazeel-*linux* > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index 7059f73935c..d18710ca273 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -22406,6 +22406,15 @@ possibility that those objects may cross-talk. Each set of isolated > shared objects is said to belong to a ``namespace'', and linker related > actions such as relocations do not cross namespace boundaries. > > +When multiple linker namespaces are active, @value{GDBN} will print the > +identifier of the namespace that contains the function, when a function > +is printed. It will look like this: > + > +@smallexample > +#0 [[1]]::inc (n=0) at dlmopen-ns-ids-lib.c > +#1 0x0000000000400591 in [[0]]::main () at dlmopen-ns-ids-main.c > +@end smallexample > + > @kindex info dll > @item info dll @var{regex} > This is an alias of @code{info sharedlibrary}. > diff --git a/gdb/solib.c b/gdb/solib.c > index 492ff5580c9..a3e40940ddd 100644 > --- a/gdb/solib.c > +++ b/gdb/solib.c > @@ -1825,6 +1825,22 @@ solib_linker_namespace_count (program_space *pspace) > return 0; > } > > +/* See solib.h. */ > + > +int > +linker_namespace_for_addr (CORE_ADDR addr, program_space *pspace) > +{ > + for (const solib &so : pspace->solibs ()) > + if (solib_contains_address_p (so, addr)) > + { > + if (so.ops().supports_namespaces ()) Missing space after 'ops'. > + return so.ops ().find_solib_ns (so); > + break; > + } > + > + return 0; > +} > + > /* Implementation of the linker_namespace convenience variable. > > This returns the GDB internal identifier of the linker namespace, > @@ -1833,19 +1849,10 @@ solib_linker_namespace_count (program_space *pspace) > > static value * > linker_namespace_make_value (gdbarch *gdbarch, internalvar *var, > - void *ignore) > + void *ignore) > { > - int nsid = 0; > CORE_ADDR curr_pc = get_frame_pc (get_selected_frame ()); > - > - for (const solib &so : current_program_space->solibs ()) > - if (solib_contains_address_p (so, curr_pc)) > - { > - if (so.ops ().supports_namespaces ()) > - nsid = so.ops ().find_solib_ns (so); > - > - break; > - } > + int nsid = linker_namespace_for_addr (curr_pc, current_program_space); > > /* If the PC is not in an SO, or the solib_ops doesn't support > linker namespaces, the inferior is in the default namespace. */ > diff --git a/gdb/solib.h b/gdb/solib.h > index 4709669c54e..48cc709f2de 100644 > --- a/gdb/solib.h > +++ b/gdb/solib.h > @@ -335,6 +335,14 @@ extern const char *solib_name_from_address (struct program_space *, CORE_ADDR); > > extern bool solib_contains_address_p (const solib &, CORE_ADDR); > > +/* Given the address ADDR, return which linker namespace contains > + this address in PSPACE. If ADDR is present in multiple namespaces, > + an arbitrary one is returned. If ADDR is not present in any > + namespace, or if the target doesn't support linker namespaces, > + returns 0. */ > + > +extern int linker_namespace_for_addr (CORE_ADDR addr, program_space *pspace); > + > /* Return whether the data starting at VADDR, size SIZE, must be kept > in a core file for shared libraries loaded before "gcore" is used > to be handled correctly when the core file is loaded. This only > diff --git a/gdb/stack.c b/gdb/stack.c > index 9d8e9da6aa8..bdfd41b7827 100644 > --- a/gdb/stack.c > +++ b/gdb/stack.c > @@ -1276,7 +1276,9 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang, > func = get_frame_function (frame); > if (func) > { > - const char *print_name = func->print_name (); > + std::string print_name > + = func->print_name_with_namespace (get_frame_pc_if_available (frame), > + get_frame_program_space (frame)); > > *funlang = func->language (); > if (funcp) > @@ -1288,13 +1290,13 @@ find_frame_funname (const frame_info_ptr &frame, enum language *funlang, > stored in the symbol table, but we stored a version > with DMGL_PARAMS turned on, and here we don't want to > display parameters. So remove the parameters. */ > - funname = cp_remove_params (print_name); > + funname = cp_remove_params (print_name.c_str ()); Does this work? The PRINT_NAME will have the namepsace prefix in place, but doesn't cp_remove_params parse the name as a C++ symbol, so will this correctly find and remove the parameters? I haven't looked at the earlier versions, but I have a suspicion that this might be me causing problems, as I think originally you were adding the namespace-id as a prefix, and I pushed you to write print_name_with_namespace. Anyway, I think you should write a test to cover this case (C++ symbol in a namespace) and see if this works, if not, then you might need to go back to something more like your original approach, adding the namespace prefix. > } > > /* If we didn't hit the C++ case above, set *funname > here. */ > if (funname == NULL) > - funname.reset (xstrdup (print_name)); > + funname.reset (xstrdup (print_name.c_str ())); > } > else > { This 'else' block looks up the funname via lookup_minimal_symbol_by_pc, but doesn't add the namespace-id. If we had code without debug in a namespace, I think this is the path it would take, should we not be displaying the id in this case? This might be a good new test to add. > @@ -1362,6 +1364,7 @@ print_frame (struct ui_out *uiout, > annotate_frame_function_name (); > > string_file stb; > + > gdb_puts (funname ? funname.get () : "??", &stb); > uiout->field_stream ("func", stb, function_name_style.style ()); > uiout->wrap_hint (3); > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 63505a94d41..bf4c3c7183f 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c > @@ -756,6 +756,21 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) > > /* See symtab.h. */ > > +std::string > +general_symbol_info::print_name_with_namespace (std::optional pc, GDB style is not to place a space before the template arguments. > + program_space *pspace) > +{ > + std::string name = print_name (); > + if (pc.has_value () > + && solib_linker_namespace_count (pspace) > 1) > + return string_printf > + ("[[%d]]::%s", linker_namespace_for_addr (*pc, pspace), > + name.c_str ()); > + return name; > +} Following on from an earlier thought, maybe this was a bad suggestion. Maybe better would be just a function like 'linker_namespace_prefix_str' which would return a std::string, either empty (no namespaces in use) or '[[N]]::'. Then this could be used though out GDB wherever we wish to print the namespace? > + > +/* See symtab.h. */ > + > void > general_symbol_info::set_demangled_name (const char *name, > struct obstack *obstack) > diff --git a/gdb/symtab.h b/gdb/symtab.h > index b771851f03a..4b0e21c4cee 100644 > --- a/gdb/symtab.h > +++ b/gdb/symtab.h > @@ -448,9 +448,10 @@ struct general_symbol_info > /* Short version as to when to use which name accessor: > Use natural_name () to refer to the name of the symbol in the original > source code. Use linkage_name () if you want to know what the linker > - thinks the symbol's name is. Use print_name () for output. Use > - demangled_name () if you specifically need to know whether natural_name () > - and linkage_name () are different. */ > + thinks the symbol's name is. Use print_name_with_namespace () for most > + output. Use print_name () if you have a reason to always omit the > + namespace identifier. Use demangled_name () if you specifically need > + to know whether natural_name () and linkage_name () are different. */ > > const char *linkage_name () const > { return m_name; } > @@ -470,6 +471,12 @@ struct general_symbol_info > const char *print_name () const > { return demangle ? natural_name () : linkage_name (); } > > + /* Similar to print_name, but may prefix the name of the symbol with the > + linker namespace identifier, if the target supports it and the inferior > + has more than one identifier loaded. */ > + std::string print_name_with_namespace > + (std::optional pc, program_space *pspace); Space before template arguments again. > + > /* Return the demangled name for a symbol based on the language for > that symbol. If no demangled name exists, return NULL. */ > const char *demangled_name () const; > diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids-framefilter.py b/gdb/testsuite/gdb.base/dlmopen-ns-ids-framefilter.py > new file mode 100644 > index 00000000000..11d96fcfbc4 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids-framefilter.py > @@ -0,0 +1,31 @@ > +# Copyright (C) 2026 Free Software Foundation, Inc. > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > + > +# This file is part of the GDB testsuite. It tests if printing the > +# linker namespace id is affected by a null frame filter > + > +import gdb > + > + > +class NullFilter: > + def __init__(self): > + self.name = "null filter" > + self.priority = 100 > + self.enabled = True > + gdb.frame_filters[self.name] = self > + > + def filter(self, iterator): > + return iterator > diff --git a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > index e40bc213454..e9832664566 100644 > --- a/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > +++ b/gdb/testsuite/gdb.base/dlmopen-ns-ids.exp > @@ -21,7 +21,7 @@ > > require allow_dlmopen_tests > > -standard_testfile -main.c -lib.c > +standard_testfile -main.c -lib.c -framefilter.py > > set srcfile_lib $srcfile2 > set so_name dlmopen-lib.so > @@ -192,6 +192,11 @@ proc_with_prefix test_conv_vars {} { > gdb_test "print \$_linker_namespace" ".* = 0" \ > "Still in the default namespace" > > + # There should be no namespace ID visible, since there's > + # only one namespace loaded. > + gdb_test "backtrace" "\#0\\s+main .*" \ > + "No namespace ID in backtrace" > + > gdb_breakpoint "inc" allow-pending > gdb_breakpoint [gdb_get_line_number "TAG: first dlclose"] > > @@ -200,14 +205,30 @@ proc_with_prefix test_conv_vars {} { > > gdb_test "print \$_linker_namespace" ".* = $dl" \ > "Verify we're in namespace $dl" > + > + gdb_test "frame" "\#0\\s+\\\[\\\[$dl\\\]\\\]::inc.*" \ > + "Namespace ID in the frame" > } > > # Check that we display the namespace of the selected > # frame, not the lowermost one. > - gdb_test "up" "\#1.*in main.*" > + gdb_test "up" "\#1.*in \\\[\\\[0\\\]\\\]::main.*" > gdb_test "print \$_linker_namespace" ".* = 0" \ > "print namespace of selected frame" > > + gdb_test "backtrace" [multi_line \ > + "\#0\\s+\\\[\\\[1\\\]\\\]::inc \[^\r\n\]*" \ > + "\#1\\s+$::hex in \\\[\\\[0\\\]\\\]::main \[^\r\n\]*" ] \ > + "raw backtrace" > + > + set remote_python_file [gdb_remote_download host \ > + $::srcdir/$::subdir/$::srcfile3] > + gdb_test_no_output "source $remote_python_file" "load frame filter" > + gdb_test "backtrace" [multi_line \ > + "\#0\\s+\\\[\\\[1\\\]\\\]::inc \[^\r\n\]*" \ > + "\#1\\s+$::hex in \\\[\\\[0\\\]\\\]::main \[^\r\n\]*" ] \ > + "With null frame filter" > + > gdb_continue_to_breakpoint "first dlclose" > gdb_test "print \$_linker_namespace_count" "4" "all SOs loaded" > > diff --git a/gdb/testsuite/gdb.mi/mi-dlmopen.exp b/gdb/testsuite/gdb.mi/mi-dlmopen.exp > index ff854ac7dd4..832c6ea6fe6 100644 > --- a/gdb/testsuite/gdb.mi/mi-dlmopen.exp > +++ b/gdb/testsuite/gdb.mi/mi-dlmopen.exp > @@ -156,7 +156,7 @@ proc check_solib_unload_events {} { > -disp keep -func main -file ".*$::srcfile" -line $::bp_main > > # Run past all the dlopen and dlmopen calls. > - mi_execute_to "exec-continue" "breakpoint-hit" main "" ".*" $::bp_loaded \ > + mi_execute_to "exec-continue" "breakpoint-hit" {\[\[0\]\]::main} "" ".*" $::bp_loaded \ > {"" "disp=\"keep\""} "continue until all libraries are loaded" This change worries me a little. The hope here is that having the [[0]] appear will not cause problems for any MI consumers. What if existing MI frontends are looking up the function by name? One possibility would be to add a new field to the stop event, e.g. linker_nsid or similar. How feasible do you think this might be? > > # Check that the dynamic linker has now been loaded multiple times. > > base-commit: 6b8fb74a9403092c4e4813c728e20ed10a84676f > -- > 2.52.0 Thanks, Andrew