From patchwork Fri Sep 27 19:50:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 98085 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 592A7385DDC5 for ; Fri, 27 Sep 2024 19:52:20 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 3D1AC3858C48 for ; Fri, 27 Sep 2024 19:50:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D1AC3858C48 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3D1AC3858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466656; cv=none; b=sf3YFHqnOD5r5gFJGzqE4XSh9w/4kjfrp5qdAdyBtzm6TCCgamrqDeNvw0vSRW4Pi8jdUWmUbaZNvj+J/nGbaEpLzpmnu+gZLz7NKGiYkFHak6Kji1Q5Qyhbftm9Ng65dwq8cMOQTOLytznpkGRe+fml5r8zrCqBzw/BqVDQR68= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466656; c=relaxed/simple; bh=SsvyU2hutzsurfQetThdG0k35YJBQkE7UuZYRj2Gg0U=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=cTrHAb109UWfYwMvUN+BslPyMN8OrNRpNPvp5l0ih9zwvX6nwlZN2rtbAGNv1jgLLqgV7vhHMCJH3pBFBVEZb4chCskI0mbDRDOYliHdKX0tU97It59RYKpnMsMAX2cQQDLb05VBvUwL3bvJ4wyjWBv/yF1SdzOHjCrxBovy0HE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6001a.ext.cloudfilter.net ([10.0.30.140]) by cmsmtp with ESMTPS id uE13slNp8VpzpuGzNss2QB; Fri, 27 Sep 2024 19:50:53 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uGzMsV4YK2Zy0uGzMsLAii; Fri, 27 Sep 2024 19:50:52 +0000 X-Authority-Analysis: v=2.4 cv=Q4EZ4J2a c=1 sm=1 tr=0 ts=66f70c9c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=EaEq8P2WXUwA:10 a=ItBw4LHWJt0A:10 a=H_nENQ1kzipp0kDUo44A:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UZVxMt6TuDm1MTsKMfUXheHPMFHTwruOCqs9g0e3Yvg=; b=e5NkUETc9jG8E/dOl/iPEuSVGu o1ikar6F1Tx4GC05oBvf9eFE9TUf0rciX4Fu4GMfROmmanMggVQBELTAi8LSX3Q0dqBu+X/16BWuc DK6+fkhHA0vvX3CilDxsh2T6r; Received: from 97-118-34-56.hlrn.qwest.net ([97.118.34.56]:49214 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1suGzL-000BDl-2z for gdb-patches@sourceware.org; Fri, 27 Sep 2024 13:50:51 -0600 From: Tom Tromey Date: Fri, 27 Sep 2024 13:50:49 -0600 Subject: [PATCH 1/3] Add styling to symmisc.c MIME-Version: 1.0 Message-Id: <20240927-dwarf-incl-stuff-v1-1-cb925fa76af3@tromey.com> References: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> In-Reply-To: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.14.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.34.56 X-Source-L: No X-Exim-ID: 1suGzL-000BDl-2z X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-34-56.hlrn.qwest.net (prentzel.local) [97.118.34.56]:49214 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfPu6IIi8JNFdGCqfDGlWup3Z+kgXOEjhQOnZk+wLdRxOfiNFkDYNPWsSDTFngLxAZSJsCJ1PDlF4b+LMkPZ26sty8VPp0jA/BA6CubI9HAjU+A5nuesj /MwybybMx2BtsZtebx3BeInqAh2f03sTbx/eRyUphsv04d5roXYYhixHrl/ISAExcprOwejnNF/rjEtZ4iOI3mYx0cg6XsDhSSY= X-Spam-Status: No, score=-3020.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org I was looking at some "maint" output and noticed that symmisc.c could apply styling in a few spots. This patch is the result. --- gdb/symmisc.c | 81 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 3b004aee1d85385b9222efad9345650de0c2406e..230d6a1639b846274bb4e08c960449930f228f3f 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -58,7 +58,9 @@ print_objfile_statistics (void) for (objfile *objfile : pspace->objfiles ()) { QUIT; - gdb_printf (_("Statistics for '%s':\n"), objfile_name (objfile)); + gdb_printf (_("Statistics for '%ps':\n"), + styled_string (file_name_style.style (), + objfile_name (objfile))); if (OBJSTAT (objfile, n_stabs) > 0) gdb_printf (_(" Number of \"stab\" symbols read: %d\n"), OBJSTAT (objfile, n_stabs)); @@ -104,8 +106,9 @@ print_objfile_statistics (void) gdb_printf (_(" Total memory used for string cache: %d\n"), objfile->per_bfd->string_cache.memory_used ()); - gdb_printf (_("Byte cache statistics for '%s':\n"), - objfile_name (objfile)); + gdb_printf (_("Byte cache statistics for '%ps':\n"), + styled_string (file_name_style.style (), + objfile_name (objfile))); objfile->per_bfd->string_cache.print_statistics ("string cache"); objfile->print_stats (true); } @@ -114,7 +117,9 @@ print_objfile_statistics (void) static void dump_objfile (struct objfile *objfile) { - gdb_printf ("\nObject file %s: ", objfile_name (objfile)); + gdb_printf ("\nObject file %ps: ", + styled_string (file_name_style.style (), + objfile_name (objfile))); gdb_printf ("Objfile at %s, bfd at %s, %d minsyms\n\n", host_address_to_string (objfile), host_address_to_string (objfile->obfd.get ()), @@ -129,8 +134,9 @@ dump_objfile (struct objfile *objfile) { for (symtab *symtab : cu->filetabs ()) { - gdb_printf ("%s at %s", - symtab_to_filename_for_display (symtab), + gdb_printf ("%ps at %s", + styled_string (file_name_style.style (), + symtab_to_filename_for_display (symtab)), host_address_to_string (symtab)); if (symtab->compunit ()->objfile () != objfile) gdb_printf (", NOT ON CHAIN!"); @@ -150,7 +156,9 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile) int index; char ms_type; - gdb_printf (outfile, "\nObject file %s:\n\n", objfile_name (objfile)); + gdb_printf (outfile, "\nObject file %ps:\n\n", + styled_string (file_name_style.style (), + objfile_name (objfile))); if (objfile->per_bfd->minimal_symbol_count == 0) { gdb_printf (outfile, "No minimal symbols found.\n"); @@ -240,15 +248,18 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) const struct linetable *l; int depth; - gdb_printf (outfile, "\nSymtab for file %s at %s\n", - symtab_to_filename_for_display (symtab), + gdb_printf (outfile, "\nSymtab for file %ps at %s\n", + styled_string (file_name_style.style (), + symtab_to_filename_for_display (symtab)), host_address_to_string (symtab)); if (symtab->compunit ()->dirname () != NULL) - gdb_printf (outfile, "Compilation directory is %s\n", - symtab->compunit ()->dirname ()); - gdb_printf (outfile, "Read from object file %s (%s)\n", - objfile_name (objfile), + gdb_printf (outfile, "Compilation directory is %ps\n", + styled_string (file_name_style.style (), + symtab->compunit ()->dirname ())); + gdb_printf (outfile, "Read from object file %ps (%s)\n", + styled_string (file_name_style.style (), + objfile_name (objfile)), host_address_to_string (objfile)); gdb_printf (outfile, "Language: %s\n", language_str (symtab->language ())); @@ -294,8 +305,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile) gdb_puts (paddress (gdbarch, b->end ()), outfile); if (b->function ()) { - gdb_printf (outfile, ", function %s", - b->function ()->linkage_name ()); + gdb_printf (outfile, ", function %ps", + styled_string (function_name_style.style (), + b->function ()->linkage_name ())); if (b->function ()->demangled_name () != NULL) { gdb_printf (outfile, ", %s", @@ -758,7 +770,9 @@ maintenance_info_symtabs (const char *regexp, int from_tty) { if (! printed_objfile_start) { - gdb_printf ("{ objfile %s ", objfile_name (objfile)); + gdb_printf ("{ objfile %ps ", + styled_string (file_name_style.style (), + objfile_name (objfile))); gdb_stdout->wrap_here (2); gdb_printf ("((struct objfile *) %s)\n", host_address_to_string (objfile)); @@ -774,9 +788,12 @@ maintenance_info_symtabs (const char *regexp, int from_tty) (cust->producer () != nullptr ? cust->producer () : "(null)")); gdb_printf (" name %s\n", cust->name); - gdb_printf (" dirname %s\n", - (cust->dirname () != NULL - ? cust->dirname () : "(null)")); + if (cust->dirname () == nullptr) + gdb_printf (" dirname (null)\n"); + else + gdb_printf (" dirname %ps\n", + styled_string (file_name_style.style (), + cust->dirname ())); gdb_printf (" blockvector" " ((struct blockvector *) %s)\n", host_address_to_string @@ -806,15 +823,19 @@ maintenance_info_symtabs (const char *regexp, int from_tty) printed_compunit_symtab_start = 1; } - gdb_printf ("\t{ symtab %s ", - symtab_to_filename_for_display (symtab)); + gdb_printf + ("\t{ symtab %ps ", + styled_string (file_name_style.style (), + symtab_to_filename_for_display (symtab))); gdb_stdout->wrap_here (4); gdb_printf ("((struct symtab *) %s)\n", host_address_to_string (symtab)); - gdb_printf ("\t fullname %s\n", - symtab->fullname () != nullptr - ? symtab->fullname () - : "(null)"); + if (symtab->fullname () == nullptr) + gdb_printf ("\t fullname (void)\n"); + else + gdb_printf ("\t fullname %ps\n", + styled_string (file_name_style.style (), + symtab->fullname ())); gdb_printf ("\t " "linetable ((struct linetable *) %s)\n", host_address_to_string @@ -865,14 +886,18 @@ maintenance_check_symtabs (const char *ignore, int from_tty) { if (! printed_objfile_start) { - gdb_printf ("{ objfile %s ", objfile_name (objfile)); + gdb_printf ("{ objfile %ps ", + styled_string (file_name_style.style (), + objfile_name (objfile))); gdb_stdout->wrap_here (2); gdb_printf ("((struct objfile *) %s)\n", host_address_to_string (objfile)); printed_objfile_start = 1; } - gdb_printf (" { symtab %s\n", - symtab_to_filename_for_display (symtab)); + gdb_printf + (" { symtab %ps\n", + styled_string (file_name_style.style (), + symtab_to_filename_for_display (symtab))); if (cust->blockvector () == NULL) gdb_printf (" NULL blockvector\n"); gdb_printf (" }\n"); From patchwork Fri Sep 27 19:50:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 98084 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0B920385DDE6 for ; Fri, 27 Sep 2024 19:51:27 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta36.uswest2.a.cloudfilter.net (omta36.uswest2.a.cloudfilter.net [35.89.44.35]) by sourceware.org (Postfix) with ESMTPS id 3D1823858C98 for ; Fri, 27 Sep 2024 19:50:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D1823858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3D1823858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466655; cv=none; b=Xmr+KenLewE8nFVsTjmKws3Z6fai9iLnWfi1I2FzmAHy00iG0Xggx64t8CvXdSamVBGREOZPXQNYtfnHjboCPa5hVzEGjqNDvZCg0y41sAJb9e+GICCwJGq5hn6c7nod5KkG5YdIpfWFWTCOqGK0mOQMOsNFNm7imeBo+AF82yA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466655; c=relaxed/simple; bh=Lniyr66f2mvie8eMIWxHCnGVbkz/D7tl9k5DDIBDYsA=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=KeTlS7z05BImJ8BrqfTv6l+w3Ca8XSD44mvfZLFTJqAyndXd40WJ/Kk06/qv6e9wOlch4zL8SnN8YZzCSkNs4e75L66+xJrCIqFO5oeXZ19Qzblw+AwDMsZRRRE7A6dJjfwi/krmMWsA7FCPAezzgDT3KAHV250HPy/xOfY88tQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6010a.ext.cloudfilter.net ([10.0.30.248]) by cmsmtp with ESMTPS id uE2HsfxZWqvuouGzNsKRcA; Fri, 27 Sep 2024 19:50:53 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uGzMslapkA0JQuGzMsGDkF; Fri, 27 Sep 2024 19:50:52 +0000 X-Authority-Analysis: v=2.4 cv=A6RqPbWG c=1 sm=1 tr=0 ts=66f70c9c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=EaEq8P2WXUwA:10 a=ItBw4LHWJt0A:10 a=r_jJ2i1KwuqI6qwpXNsA:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=j2ZdI8foQl1Do0WR0i0vsnKouL3+ldQi+wnVAvGiz40=; b=kl2lEA6aWK31f+FRr+RBsQec85 5o8TD2z+Am8Le6DXorLHkeyBJauyScIgsFx2r8UVjgaiImIKMKm6cUC6g8zLT3XQ+nTCZmMYKckuI fs61blGdjZb2aT7rLYnQXYdap; Received: from 97-118-34-56.hlrn.qwest.net ([97.118.34.56]:49214 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1suGzM-000BDl-0C for gdb-patches@sourceware.org; Fri, 27 Sep 2024 13:50:52 -0600 From: Tom Tromey Date: Fri, 27 Sep 2024 13:50:50 -0600 Subject: [PATCH 2/3] Add styling to cooked_index::dump MIME-Version: 1.0 Message-Id: <20240927-dwarf-incl-stuff-v1-2-cb925fa76af3@tromey.com> References: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> In-Reply-To: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.14.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.34.56 X-Source-L: No X-Exim-ID: 1suGzM-000BDl-0C X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-34-56.hlrn.qwest.net (prentzel.local) [97.118.34.56]:49214 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJYYtykR/hk+vobVvB6IRUxaPRyZp/AVJy5bS6+cuf9KqNxSxJGsq1v/RQ9GMkhte50V0Drh791z2r8BLEDE6KQIXaJz6PjWKzRHPVV+FIMYIJ+q7jpe aCFPVFOUhQt9n9ks0RgEU7IEAm7rfJBDKJu9Zgov5Kxg56tuQB5CEua/W8dJ1DxNzCX4VnbusjxqKxixd6O+MyuGC9bElVLcNvU= X-Spam-Status: No, score=-3020.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org This patch adds some styling to cooked_index::dump, making the output a bit easier to read. --- gdb/dwarf2/cooked-index.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 4073c924890d6aec22989aa1c321a4fd00173a33..cf67bb6cef3a41518a41421959bf6b16bab43df0 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -38,6 +38,7 @@ #include #include #include "cli/cli-cmds.h" +#include "cli/cli-style.h" /* We don't want gdb to exit while it is in the process of writing to the index cache. So, all live cooked index vectors are stored @@ -796,10 +797,20 @@ cooked_index::dump (gdbarch *arch) { QUIT; + ui_file_style style; + if (entry->matches (SEARCH_FUNCTION_DOMAIN)) + style = function_name_style.style (); + else if (entry->matches (SEARCH_VAR_DOMAIN)) + style = variable_name_style.style (); + gdb_printf (" [%zu] ((cooked_index_entry *) %p)\n", i++, entry); - gdb_printf (" name: %s\n", entry->name); - gdb_printf (" canonical: %s\n", entry->canonical); - gdb_printf (" qualified: %s\n", entry->full_name (&temp_storage, false)); + gdb_printf (" name: %ps\n", styled_string (style, + entry->name)); + gdb_printf (" canonical: %ps\n", styled_string (style, + entry->canonical)); + gdb_printf (" qualified: %ps\n", + styled_string (style, + entry->full_name (&temp_storage, false))); gdb_printf (" DWARF tag: %s\n", dwarf_tag_name (entry->tag)); gdb_printf (" flags: %s\n", to_string (entry->flags).c_str ()); gdb_printf (" DIE offset: %s\n", sect_offset_str (entry->die_offset)); From patchwork Fri Sep 27 19:50:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 98083 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 65613385DDD8 for ; Fri, 27 Sep 2024 19:51:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta040.useast.a.cloudfilter.net (omta040.useast.a.cloudfilter.net [44.202.169.39]) by sourceware.org (Postfix) with ESMTPS id 9F9F93858D39 for ; Fri, 27 Sep 2024 19:50:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9F9F93858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9F9F93858D39 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466655; cv=none; b=sRkD4V6f1brVqlKUSAJuPi17mXSIvguX+kW88vIUnWXsMujLpilfIM4qHVDRfMLL9zlZgsh2TavDcFegvX3OmQqJ7xpAvozQqPoEIUvxAL9/WRUDyYstR7qL22+nGU/bS9YWSrEKfUbYHgZdfwr+3QWm1QoV4ZsYgTk2pdoUepA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727466655; c=relaxed/simple; bh=MqeZNAeg2xb4iu088Xxn5Yrj7N+QuCt0ElWAVbFFga4=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=jceIRIUoIBwn96RfYRa41OpuF67p0uXGs7mvg1Jgkg+UnHpBfXZpEU/EVGmVyox9MSRdbUFrAnBnsxSsCh7V2goVxMsKfrVuVyUjGqzw2fkjQjhbpVgRBRQqGG0eFi4HO2Ei1JaraVckPK+uyqlp0cXGYRNJnKSRV1agHVArv9c= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6004a.ext.cloudfilter.net ([10.0.30.197]) by cmsmtp with ESMTPS id tgyLsdB0gnNFGuGzNsZCP0; Fri, 27 Sep 2024 19:50:53 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id uGzMsL0giWdNZuGzMs8QzN; Fri, 27 Sep 2024 19:50:52 +0000 X-Authority-Analysis: v=2.4 cv=FtTO/Hrq c=1 sm=1 tr=0 ts=66f70c9c a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=IkcTkHD0fZMA:10 a=EaEq8P2WXUwA:10 a=ItBw4LHWJt0A:10 a=PxALOpzp3UgT7neOzO4A:9 a=QEXdDO2ut3YA:10 a=6Ogn3jAGHLSNbaov7Orx:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=b+QdGQL0s6E33OIqklPmzc7iBNdBjgl7oiOIuVOTrCM=; b=Nbs5rPlW8LR0rKfINz8VaYxauJ Rem7Q2vGfqD71A+nABBgFhy0H75relcA9lAY0NC0XnZ0+N69TQ8lALYvrmqMVlm9Vsb8URvG+cVmD fNzhOLbyU5g4IzYX3XftzZH+K; Received: from 97-118-34-56.hlrn.qwest.net ([97.118.34.56]:49214 helo=prentzel.local) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1suGzM-000BDl-0m for gdb-patches@sourceware.org; Fri, 27 Sep 2024 13:50:52 -0600 From: Tom Tromey Date: Fri, 27 Sep 2024 13:50:51 -0600 Subject: [PATCH 3/3] Print the CU index in cooked_index::dump MIME-Version: 1.0 Message-Id: <20240927-dwarf-incl-stuff-v1-3-cb925fa76af3@tromey.com> References: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> In-Reply-To: <20240927-dwarf-incl-stuff-v1-0-cb925fa76af3@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.14.2 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.118.34.56 X-Source-L: No X-Exim-ID: 1suGzM-000BDl-0m X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-118-34-56.hlrn.qwest.net (prentzel.local) [97.118.34.56]:49214 X-Source-Auth: tom+tromey.com X-Email-Count: 4 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCYR3fuxPAi0RTMPOWJQBnuF1xmN3QcIfqxZgw7bkoWYE7+UbTlRVevxbZgr8K97rVXcLpXrDLOpmVaU3curZsoBaGR+hBCScl3PAubi3p0woz5yeawM o5AuIzH9I85gHagtc/oLF2C86FlDwwjp7LaCSbXOSfRsNP7NZ4g68TIghzSIk4J5oh898PU1cUTofDDcd8pcIlHDcoW/cOld4mw= X-Spam-Status: No, score=-3020.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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~patchwork=sourceware.org@sourceware.org While exploring a question I had about the DWARF indexer, I found I wanted to see the CU index of each entry. This patch adds this information. --- gdb/dwarf2/cooked-index.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index cf67bb6cef3a41518a41421959bf6b16bab43df0..79dc2dbd9dc1f5867bbb508ad7ebb1a616bc5eb5 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -814,6 +814,7 @@ cooked_index::dump (gdbarch *arch) gdb_printf (" DWARF tag: %s\n", dwarf_tag_name (entry->tag)); gdb_printf (" flags: %s\n", to_string (entry->flags).c_str ()); gdb_printf (" DIE offset: %s\n", sect_offset_str (entry->die_offset)); + gdb_printf (" CU index: %u\n", entry->per_cu->index); if ((entry->flags & IS_PARENT_DEFERRED) != 0) gdb_printf (" parent: deferred (%" PRIx64 ")\n",