From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iLgjAAy/i2Ib5QcAWB0awg (envelope-from ) for ; Mon, 23 May 2022 13:06:20 -0400 Received: by simark.ca (Postfix, from userid 112) id EF71D1E220; Mon, 23 May 2022 13:06:19 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=QT6UsFUK; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED, WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 6B4F81E143 for ; Mon, 23 May 2022 13:06:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0FA33383F971 for ; Mon, 23 May 2022 17:06:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0FA33383F971 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653325579; bh=5W7Y4JditW7NGA2/Q8FP7dKRg4o1qnss5EAUBegtMhE=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=QT6UsFUKkNyYhb1kmZ4uoHTQVhYIxbDSipf7ssQ7mL8jiI7V9K4qIH7z5t8TUfOuk 8RClJ7b5bmP46W5Ra84gqB9fcgUBskFq4S3R4dnipCUpQL79vQ1HcSVnc3nCXi4OSe l8vKcBxZkNNqcoML686CryLq/7BGqGU4GP52GAJk= Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 9608C3858C51 for ; Mon, 23 May 2022 17:05:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9608C3858C51 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id 75ABC86E09; Mon, 23 May 2022 17:05:58 +0000 (UTC) Date: Mon, 23 May 2022 17:05:49 +0000 To: "Metzger, Markus T" Subject: Re: [PATCH 1/2] Always show locations for breakpoints & show canonical location spec Message-ID: <20220523170538.7qyaw5sm6i45ravg@ubuntu.lan> References: <20220519215552.3254012-1-pedro@palves.net> <20220519215552.3254012-2-pedro@palves.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Mon, 23 May 2022 17:05:58 +0000 (UTC) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: "gdb-patches@sourceware.org" , Pedro Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On Fri, May 20, 2022 at 07:45:09AM +0000, Metzger, Markus T via Gdb-patches wrote: > Hello Pedro, > > > (top-gdb) info breakpoints > > Num Type Disp Enb Address What > > 1 breakpoint keep y internal_error > > 1.1 y 0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54 > > 2 breakpoint keep y -qualified internal_error > > 2.1 y 0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54 > > 3 breakpoint keep y errors.c:54 > > 3.1 y 0x00000000005755a5 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54 > > 3.2 y 0x00007ffff6d50410 in PyErr_SetObject at /usr/src/debug/python2-2.7.15-4.fc27.x86_64/Python/errors.c:54 > > This change looks very nice to me. It will be very helpful once GDB starts > sliding breakpoints per function and we end up with different source lines > for different instances. > > I wouldn't indent the breakpoint instances, though. There is already visual > feedback in the longer breakpoint numbers and the fact that 'type' and 'disp' > are omitted to separate the groups. Hi, I also find it usefull to have some information about the breakpoint location as entered by the user. I think the motivating examples Pedro gave give good examples that similar breakpoint locations can come from quite different user intentions. As for the indentation, I have to admit I do not really have a strong opinion. I am used to the way the things currently are, but this is probably not the greatest justifications. Just to experiment with other options, I have a prototype usign a `tree`-like indentation: (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep y errors.cc:50 └─ 1.1 y 0x000000000224fd06 in internal_error(char const*, int, char const*, ...) at ../../gdbsupport/errors.cc:51 2 breakpoint keep y internal_error └─ 2.1 y 0x000000000224fd06 in internal_error(char const*, int, char const*, ...) at ../../gdbsupport/errors.cc:51 3 breakpoint keep y -qualified internal_error └─ 3.1 y 0x000000000224fd06 in internal_error(char const*, int, char const*, ...) at ../../gdbsupport/errors.cc:51 4 breakpoint keep y error ├─ 4.1 y 0x00000000010b30fe in gcc_c_plugin::error(char const*) const at ../../gdb/../include/gcc-c-fe.def:198 ├─ 4.2 y 0x00000000010c6290 in gcc_cp_plugin::error(char const*) const at ../../gdb/../include/gcc-cp-fe.def:983 └─ 4.3 y 0x000000000224fbe1 in error(char const*, ...) at ../../gdbsupport/errors.cc:39 I am not sure this is a clear improvement, but I can push the patches somewhere if someone wants to give it a try. Best, Lancelot.