From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by sourceware.org (Postfix) with ESMTPS id 558F73858D28 for ; Mon, 3 Jul 2023 08:33:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 558F73858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1688373194; x=1719909194; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=9iWoUc1gpf7QBX8bdR7L0dHw3FhLs57s63YRzhDQ5p4=; b=SWK8VJIp1NmhYD0LXmBa5wbmHa440CqYrXPI1YCIkp3h407RsqoaaNkk Ebt5A/qZQbsHY/SiGWnjVSXAhfI2irwIdoviSHx9Yz5lmKD9AA5sgpOhI tMtQPuuX/zJI2WvWK2+0B1fbSqWkOquBxLM870TWBXPdSg3GSt7Xgci7z tGDaX9oNvjp4APNBu8aEClXsQfuQigZZi3QtpcYfjty374boso5fB2f04 kRadOoxhZBsKtsMwX63VYy/xVaShnIwt5hH8wycb6APNRIrGk3oeOpbop cdQMmbNDywrHyo4n9Xe1tFLX05cMR54SAM4ABANEnveb81m5gOfVtG23U Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="426508406" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="426508406" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2023 01:33:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10759"; a="788447378" X-IronPort-AV: E=Sophos;i="6.01,177,1684825200"; d="scan'208";a="788447378" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 03 Jul 2023 01:33:10 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul 2023 01:33:10 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul 2023 01:33:09 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27 via Frontend Transport; Mon, 3 Jul 2023 01:33:09 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.105) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.27; Mon, 3 Jul 2023 01:33:09 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fPLnVFEzl11oAUQtwt14djyUt1HUT6HkpShJF1VFHqIG3vkJk61XcY2YHHoPPdGnbLfY22ouGonRHLoeTHrvNGXTjCQfVj26EhMF+7CcXwtFMAygKzuHrIq5dVITm17K9Kc+sf9sH4sxeZkUUWIJ88Ahf3a2KRBO3O24hYIpGRGq3tnDvARE+e73LQLEKi8ZlpKt1f3FDujAGgKuyuuPfViI565sjjI3AbpLy+AhHQi/GkZ0ZZhMxIj3AW5bBg4wWPDw2BjxIXeS9Vfopw30EzmEKn3/+u4B07YmLf5kYT1KDcwDAtWFrnKBslVOXNVtHp5Tc0Gf+soUkK4X1kVIkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=T/Iwm6bBavSBlnaTbFcSiylGeS+XQTMe52ZUWHLsLuY=; b=nzjey6r8USYUh9/OO/hZ2EjDcXxPBMiQDszQtYi2yId1Jb2qxGpDSDAy9CjanmMHQ4CtC+cn5Tg5Xl4u2xj9olaFX4MEmp+vfvv3aMrT90o8W1llQColuiEY3DrjevQowzWDUvjuPTT2gYTFaHTR+Q5hDngXT9AwzhFu8XzPRlKBqs5IomjZ7BJdA/Wf5Rf7lBSQrQAjBDBI3qoa+fVvJTX3xmjw93YD8InX7vtOjM1MRdyF4kBI8cgb/T4AMuWdMH/WGSH+kA8zX8SCBFkIe8egJAqlN0nmTsqwVLQ/dQVJvkLUtHLECJG/xFBGXdfLtvNxctdw3NW5ZlhRu+CbWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from CY4PR11MB2005.namprd11.prod.outlook.com (2603:10b6:903:2e::18) by DM4PR11MB6479.namprd11.prod.outlook.com (2603:10b6:8:8c::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.24; Mon, 3 Jul 2023 08:33:07 +0000 Received: from CY4PR11MB2005.namprd11.prod.outlook.com ([fe80::b405:9025:f19c:90c1]) by CY4PR11MB2005.namprd11.prod.outlook.com ([fe80::b405:9025:f19c:90c1%5]) with mapi id 15.20.6544.024; Mon, 3 Jul 2023 08:33:06 +0000 From: "Schimpe, Christina" To: "gdb-patches@sourceware.org" CC: "aburgess@redhat.com" , "simark@simark.ca" , "eliz@gnu.org" , "blarsen@redhat.com" Subject: RE: [PING][PATCH v5 1/1] gdb, breakpoint: add breakpoint location debugging logs Thread-Topic: [PING][PATCH v5 1/1] gdb, breakpoint: add breakpoint location debugging logs Thread-Index: AQHZnQYTxBE9wW7SJEmQU+q5JuC87a+n1+zg Date: Mon, 3 Jul 2023 08:33:06 +0000 Message-ID: References: <20230612081436.429842-1-christina.schimpe@intel.com> <20230612081436.429842-2-christina.schimpe@intel.com> In-Reply-To: <20230612081436.429842-2-christina.schimpe@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CY4PR11MB2005:EE_|DM4PR11MB6479:EE_ x-ms-office365-filtering-correlation-id: 04d8bcef-857f-4895-b853-08db7ba02002 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: vxC6cwa8GUw5sS8Fqf0RkBAznegIXuMObxOlppxkSeHHLzbbWfGaSpd7FiMjFz8u4z2+KhpXV5VekZgrqItmH+HRde/oTL0FVWHaoqAJO4YqcwBH4iRFF0tsM5A4IcV+e3TlnCwl2XIFawWS5Ctsis5rW4jG2ZaJmXTuwUiSiCRbeR04KjABacD2r/vpl8Ji1aEiXZe4JbHkvJyluW8KFiQoS3mIsKNH9U15jH/3g9IX4XJMXP4UERUvxqCslFyMeNCqLgD0ZSoOzzI8wRFSpQ0A+wkavzu/CtKPWHivy+hZ85O3c+meoTgKHPD/CPKqzBOCwvf+Pb3TKeTnDvDB7GYr1naLjWOZCpMw9EyY0iRL9u1FEfzbxzchpseNlST0Y1FMJ242YFGvS1tJQ5Y2Lkg2Mf6Q15smtYonrZYkkE3BEJvB4GR+EKSXi8SFn4JCh08dREEBKfHuK5shdwygKgFC7ovnOIzbj/8gpMFT46Nby9Tdj2DSvEgTse/cJUKUMnhyVXjpJxy68C9OQGAE43O1aZoCMczLv+mmnya6SptLBN9Ao4pDk7q3/xv+fQ0FWzq5LVhv4BGAO5NdT1gxJRLnS+tJL58n9+juEPIqPeI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR11MB2005.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(346002)(366004)(39860400002)(396003)(136003)(376002)(451199021)(41300700001)(38100700002)(7696005)(122000001)(71200400001)(82960400001)(83380400001)(6506007)(26005)(186003)(53546011)(9686003)(55016003)(38070700005)(54906003)(86362001)(478600001)(316002)(2906002)(15974865002)(66476007)(64756008)(33656002)(66446008)(6916009)(4326008)(66946007)(76116006)(66556008)(8936002)(8676002)(52536014)(5660300002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?MdVKKjdor4Wx5boylBZKTBT+EJUk+11QNSXW7KhV0jVOvnkGjwv1FL1lCEwh?= =?us-ascii?Q?usgAhAIJ2DP46HvGJ9BRdTdycCjVnidHtwrXScr5DPcSTg4ZIw+Rj76Eb/iy?= =?us-ascii?Q?a3Juqnf9grDMds6Fxiu4K5AUJsurXG/jni+o5XvfjCBZ+dS4MRzRN4x0Ml7U?= =?us-ascii?Q?lzc3TJEH3pzYz2qIjwFjCscrQZNxQzjMQQBtEwy5oNlKtLvY2et26ebveFYv?= =?us-ascii?Q?My6ZFw1RFZWLo4ad8E6AQwRJ8dmP1i7yahtoIFFCCjX9dbe/xlCQMVqOeMVa?= =?us-ascii?Q?61eGHEFUJTlWesmA/4E3hioEX1SW1wXztFZsZCi2a5l/LgayEnj9fA23MkuG?= =?us-ascii?Q?3vubdh/JgQkz+57C1RP7VELNCZXJ14KWBrQE3STOgbQr4dEvdjPLMmzVuf5C?= =?us-ascii?Q?q93zy8jxwEzNYot3mve5Sr39oGEXs8K9SBCTa7NRLa1Twj0A0GG8rG/tjYje?= =?us-ascii?Q?nmDQRqoJgJ4fu8mqw5E0Sytk199IuCG+ujAGyMBYudDZgj57zWp0/X33wbPz?= =?us-ascii?Q?JYBXIOJRLTNOauVAb06/2JfgK+iUkyQbUCtWKLW67m6dQztdNVvAMClHVg0T?= =?us-ascii?Q?IQM2LYK2diJ9wMPS7GBWLjtk9yo/iTajuqaGxrzxBqu7o1CTz0RIbLfiawuj?= =?us-ascii?Q?7EclyoCezLPHzTKJo9F0qhHBFbo+HGmKDj2lC41ono01r2apZjfVB3VRM9+n?= =?us-ascii?Q?S50UsmO+uA02MOFF8w90TtDiXu1Wx9fijUqk6uQC/Sl+P36fhXNsR4laQ9zJ?= =?us-ascii?Q?N+Dtb+dxUmBS2tcToKNI7s0v17SDzEcxVOaTCOLKAgWbjxw/CdDoFpWK6oJ1?= =?us-ascii?Q?j623+89Qbo1lw77ANykrEbEnzkhY9D/D/R8MMpyeQ6z8HfK2PQ8VLKMdxrYK?= =?us-ascii?Q?VLYmWTIqy1jXibXzWzs80GtDz+VA1cU19MZmmGVQbo3Vb1vXp/A1axp9SLsx?= =?us-ascii?Q?ViKC3rZjXc61TfbKsiCpgKTOqbX62ygUdIFlTkoc4xSDnIbCpZAzDFmQjoD2?= =?us-ascii?Q?9JZuwUiui4aopkEWsoqKko/tx3jqEHDVQUGbld7/VSX6xyn/1sKxQ6nPHeQA?= =?us-ascii?Q?OcLtCal+JEqoZVmEthXoZf8DZA99cS6SnaHSlmjakRQrFB26zhqYy27hVp7h?= =?us-ascii?Q?cl8qAobEMNg4d0ajq2DVpesBYfMUpTc1dgrSBeuU8ydxR7PEILd16bT+iwBY?= =?us-ascii?Q?FZ3F6KqvKt0lfcFF81clfbHeYaJ3lnYWzA86MsHA4X/fEjDDYQGZE1pw0pY5?= =?us-ascii?Q?7DvewoiMDRFRnx1DWnMZHYkox/UDdsq3AWbbm8PjmQ/XlO0UMY0w9MHSYZGG?= =?us-ascii?Q?eM7G6uOacnNZ6Et+ff8bzAC46rxsRuo0mTpBsMF16wBsF6V91OInqbwqlc+F?= =?us-ascii?Q?pqq9IqkMMjQJaoPUUnJBGIT5bPytYT5FYYiojd/qF+s7aQHXqXZwtUSO4RqW?= =?us-ascii?Q?wiMZfNes/+hX8Is4fYwiJH9c1Klo9SC9OTkMMTz5RH/JPyxJgRhPPRlxuSo3?= =?us-ascii?Q?bH7VPuXVSzdPvu5BMxyeGjrD/bZfJSadnbp2Dx6DzJeXJLE7qfpL4GPH81yf?= =?us-ascii?Q?TcUCePyAJUx1dlFaZ6AWaXJNrpGdQ203bNVOBVlD?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CY4PR11MB2005.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04d8bcef-857f-4895-b853-08db7ba02002 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2023 08:33:06.4661 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: A5X5mJGs7M+2o4Se2g23Px8f/BAnstiBwtGzKtrm4vPVVfYbzuPWKX6H8NEHFbhHd8T2gad+rjMa6mvYTtlSfUr8yp/mTV1RexpflNsgiPE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR11MB6479 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Kindly pinging for this patch. Thanks, Christina > -----Original Message----- > From: Gdb-patches bounces+christina.schimpe=3Dintel.com@sourceware.org> On Behalf Of Christ= ina > Schimpe via Gdb-patches > Sent: Monday, June 12, 2023 10:15 AM > To: gdb-patches@sourceware.org > Cc: aburgess@redhat.com; simark@simark.ca; eliz@gnu.org; > blarsen@redhat.com > Subject: [PATCH v5 1/1] gdb, breakpoint: add breakpoint location debuggin= g logs > = > From: Mihails Strasuns > = > Add new commands: > = > set debug breakpoint on|off > show debug breakpoint > = > This patch introduces new debugging information that prints breakpoint lo= cation > insertion and removal flow. > = > The debug output looks like: > ~~~ > (gdb) set debug breakpoint on > (gdb) disassemble main > Dump of assembler code for function main: > 0x0000555555555129 <+0>: endbr64 > 0x000055555555512d <+4>: push %rbp > 0x000055555555512e <+5>: mov %rsp,%rbp > =3D> 0x0000555555555131 <+8>: mov $0x0,%eax > 0x0000555555555136 <+13>: pop %rbp > 0x0000555555555137 <+14>: ret > End of assembler dump. > (gdb) break *0x0000555555555137 > Breakpoint 2 at 0x555555555137: file main.c, line 4. > [breakpoint] update_global_location_list: insert_mode =3D UGLL_MAY_INSERT > (gdb) c > Continuing. > [breakpoint] update_global_location_list: insert_mode =3D UGLL_INSERT > [breakpoint] insert_bp_location: Breakpoint 2 (0x5565daddb1e0) at address > 0x555555555137 in main at main.c:4 [breakpoint] insert_bp_location: Break= point > -2 (0x5565dab51c10) at address 0x7ffff7fd37b5 [breakpoint] insert_bp_loca= tion: > Breakpoint -5 (0x5565dab68f30) at address 0x7ffff7fe509e [breakpoint] > insert_bp_location: Breakpoint -7 (0x5565dab694f0) at address 0x7ffff7fe6= 3f4 > [breakpoint] remove_breakpoint_1: Breakpoint 2 (0x5565daddb1e0) at address > 0x555555555137 in main at main.c:4 due to regular remove [breakpoint] > remove_breakpoint_1: Breakpoint -2 (0x5565dab51c10) at address > 0x7ffff7fd37b5 due to regular remove [breakpoint] remove_breakpoint_1: > Breakpoint -5 (0x5565dab68f30) at address 0x7ffff7fe509e due to regular r= emove > [breakpoint] remove_breakpoint_1: Breakpoint -7 (0x5565dab694f0) at addre= ss > 0x7ffff7fe63f4 due to regular remove > = > Breakpoint 2, 0x0000555555555137 in main () at main.c:4 > 4 } > ~~~ > = > Co-Authored-By: Christina Schimpe > --- > gdb/NEWS | 4 ++ > gdb/breakpoint.c | 109 ++++++++++++++++++++++++++++++++++++++++++++ > gdb/breakpoint.h | 4 ++ > gdb/doc/gdb.texinfo | 8 ++++ > 4 files changed, 125 insertions(+) > = > diff --git a/gdb/NEWS b/gdb/NEWS > index 649a3a9824a..2aafe103dab 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -80,6 +80,10 @@ > = > * New commands > = > +set debug breakpoint on|off > + show debug breakpoint > + Print additional debug messages about breakpoint insertion and removal. > + > maintenance print record-instruction [ N ] > Print the recorded information for a given instruction. If N is not g= iven > prints how GDB would undo the last instruction executed. If N is nega= tive, diff -- > git a/gdb/breakpoint.c b/gdb/breakpoint.c index da6c8de9d14..dc502df9d79 > 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -83,6 +83,7 @@ > #include "progspace-and-thread.h" > #include "gdbsupport/array-view.h" > #include "gdbsupport/gdb_optional.h" > +#include "gdbsupport/common-utils.h" > = > /* Prototypes for local functions. */ > = > @@ -200,6 +201,68 @@ enum ugll_insert_mode > UGLL_INSERT > }; > = > +/* Return a textual version of INSERT_MODE. */ > + > +static const char * > +ugll_insert_mode_text (ugll_insert_mode insert_mode) { > +/* Make sure the compiler warns if a new ugll_insert_mode enumerator is > added > + but not handled here. */ > +DIAGNOSTIC_PUSH > +DIAGNOSTIC_ERROR_SWITCH > + switch (insert_mode) > + { > + case UGLL_DONT_INSERT: > + return "UGLL_DONT_INSERT"; > + case UGLL_MAY_INSERT: > + return "UGLL_MAY_INSERT"; > + case UGLL_INSERT: > + return "UGLL_INSERT"; > + } > +DIAGNOSTIC_POP > + > + gdb_assert_not_reached ("must handle all enum values"); } > + > +/* Return a textual version of REASON. */ > + > +static const char * > +remove_bp_reason_str (remove_bp_reason reason) { > +/* Make sure the compiler warns if a new remove_bp_reason enumerator is > added > + but not handled here. */ > +DIAGNOSTIC_PUSH > +DIAGNOSTIC_ERROR_SWITCH > + switch (reason) > + { > + case REMOVE_BREAKPOINT: > + return "regular remove"; > + case DETACH_BREAKPOINT: > + return "detach"; > + } > +DIAGNOSTIC_POP > + > + gdb_assert_not_reached ("must handle all enum values"); } > + > +/* Return a textual version of breakpoint BL describing number, location= and > + address. */ > + > +static std::string > +breakpoint_location_address_str (const bp_location* bl) { > + std::string str =3D string_printf ("Breakpoint %d (%s) at address %s", > + bl->owner->number, > + host_address_to_string (bl), > + paddress (bl->gdbarch, bl->address)); > + > + std::string loc_string =3D bl->to_string (); if (!loc_string.empty ()) > + str +=3D string_printf (" %s", loc_string.c_str ()); > + > + return str; > +} > + > static void update_global_location_list (enum ugll_insert_mode); > = > static void update_global_location_list_nothrow (enum ugll_insert_mode);= @@ - > 510,6 +573,22 @@ show_always_inserted_mode (struct ui_file *file, int fro= m_tty, > value); > } > = > +/* True if breakpoint debug output is enabled. */ static bool > +debug_breakpoint =3D false; > + > +/* Print a "breakpoint" debug statement. */ #define > +breakpoint_debug_printf(fmt, ...) \ > + debug_prefixed_printf_cond (debug_breakpoint, "breakpoint", fmt, \ > + ##__VA_ARGS__) > + > +/* "show debug breakpoint" implementation. */ static void > +show_debug_breakpoint (struct ui_file *file, int from_tty, > + struct cmd_list_element *c, const char *value) { > + gdb_printf (file, _("Breakpoint location debugging is %s.\n"), > +value); } > + > /* See breakpoint.h. */ > = > int > @@ -2728,6 +2807,8 @@ insert_bp_location (struct bp_location *bl, > if (!should_be_inserted (bl) || (bl->inserted && !bl->needs_update)) > return 0; > = > + breakpoint_debug_printf ("%s", breakpoint_location_address_str > + (bl).c_str ()); > + > /* Note we don't initialize bl->target_info, as that wipes out > the breakpoint location's shadow_contents if the breakpoint > is still inserted at that location. This in turn breaks @@ -3270,6= +3351,8 @@ > remove_breakpoints_inf (inferior *inf) { > int val; > = > + breakpoint_debug_printf ("inf->num =3D %d", inf->num); > + > for (bp_location *bl : all_bp_locations ()) > { > if (bl->pspace !=3D inf->pspace) > @@ -3914,6 +3997,10 @@ detach_breakpoints (ptid_t ptid) static int > remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reaso= n) > { > + breakpoint_debug_printf ("%s due to %s", > + breakpoint_location_address_str (bl).c_str (), > + remove_bp_reason_str (reason)); > + > int val; > = > /* BL is never in moribund_locations by our callers. */ @@ -7424,6 +7= 511,16 > @@ bp_location::bp_location (breakpoint *owner) { } > = > +/* See breakpoint.h. */ > + > +std::string bp_location::to_string () const { > + string_file stb; > + ui_out_redirect_pop redir (current_uiout, &stb); > + print_breakpoint_location (this->owner, this); > + return stb.string (); > +} > + > /* Decrement reference count. If the reference count reaches 0, > destroy the bp_location. Sets *BLP to NULL. */ > = > @@ -11157,6 +11254,9 @@ update_global_location_list (enum ugll_insert_mode > insert_mode) > /* Last breakpoint location program space that was marked for update. = */ > int last_pspace_num =3D -1; > = > + breakpoint_debug_printf ("insert_mode =3D %s", > + ugll_insert_mode_text (insert_mode)); > + > /* Used in the duplicates detection below. When iterating over all > bp_locations, points to the first bp_location of a given address. > Breakpoints and watchpoints of different types are never @@ -14899,6 > +14999,15 @@ when execution stops."), > &breakpoint_set_cmdlist, > &breakpoint_show_cmdlist); > = > + add_setshow_boolean_cmd ("breakpoint", class_maintenance, > + &debug_breakpoint, _("\ > +Set breakpoint location debugging."), _("\ Show breakpoint location > +debugging."), _("\ When on, breakpoint location specific debugging is > +enabled."), > + NULL, > + show_debug_breakpoint, > + &setdebuglist, &showdebuglist); > + > add_setshow_enum_cmd ("condition-evaluation", class_breakpoint, > condition_evaluation_enums, > &condition_evaluation_mode_1, _("\ > diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index > da150585f73..f4896293bb7 100644 > --- a/gdb/breakpoint.h > +++ b/gdb/breakpoint.h > @@ -509,6 +509,10 @@ class bp_location : public refcounted_object, public > intrusive_list_node = > /* The objfile the symbol or minimal symbol were found in. */ > const struct objfile *objfile =3D NULL; > + > + /* Return a string representation of the bp_location. > + This is only meant to be used in debug messages. */ std::string > + to_string () const; > }; > = > /* A policy class for bp_location reference counting. */ diff --git > a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 40d1f244417..ce0444c3c02 > 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -28356,6 +28356,14 @@ debugging info. > Turn on or off debugging messages for built-in XML parsers. > @item show debug xml > Displays the current state of XML debugging messages. > + > +@item set debug breakpoints > +@cindex breakpoint debugging info > +Turns on or off display of @value{GDBN} debugging info for breakpoint > +insertion and removal. The default is off. > +@item show debug breakpoints > +Displays the current state of displaying @value{GDBN} debugging info > +for breakpoint insertion and removal. > @end table > = > @node Other Misc Settings > -- > 2.25.1 > = > Intel Deutschland GmbH > Registered Address: Am Campeon 10, 85579 Neubiberg, Germany > Tel: +49 89 99 8853-0, www.intel.de Managing Direct= ors: > Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the > Supervisory Board: Nicole Lau Registered Office: Munich Commercial Regist= er: > Amtsgericht Muenchen HRB 186928 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva = Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928