From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id D7E313839C5F for ; Thu, 19 May 2022 21:55:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D7E313839C5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id t6so9015723wra.4 for ; Thu, 19 May 2022 14:55:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=HcFILsusipGtp4Y2TbIFKP1Ao0w8o8raQSbx5JICMJw=; b=N8b+QY+gYhlQUju7MPt8tNG5mhHI6XhiuQ67Sxe4aoenJaa5apOT2SqfOsArMKerTk AZ8ejIAi+KnngwO0hNRa6RNoraryUbb35eo66VB9t2won6BVT+YrlsXk0qa1d82ejzNz D3nkb2xhjo7kObpdK/TQS+FkBLk9vtk77V2kLJkoB51EsGN3+za3JyWYLyUus95l2Zsb Idnx/6EFjxqR52315p3y9t9T0iDPpQxqJCOkJlFIcfFDFvJTzovcwTyRfnnNBOBXIwVm t5ZDRPKPk+awzzk33gVd42ofh8mHOPFec2uBkZHQx6+P8qFWjb0tvzIJt10jYFCDXC6e 1VzA== X-Gm-Message-State: AOAM533yOPFXpT9aAtUlywJedCR6sCQgyx/CHsoQhVbGSCy+HoFTi3zh a0ZgC+lBxAfNbVgUQTnc1HBUCtPXxqA= X-Google-Smtp-Source: ABdhPJzAHvHdSrSYT+SZ5hYQGTiacP522LMFfVBkVr/72pid0VnKBXUW/RKHfikl2lEVNLI6uOVGfg== X-Received: by 2002:a5d:618f:0:b0:20c:ffa0:95a8 with SMTP id j15-20020a5d618f000000b0020cffa095a8mr5743369wru.306.1652997354977; Thu, 19 May 2022 14:55:54 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id x5-20020adfbb45000000b0020d117a4e00sm650543wrg.105.2022.05.19.14.55.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 May 2022 14:55:53 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 0/2] info breakpoints improvements Date: Thu, 19 May 2022 22:55:50 +0100 Message-Id: <20220519215552.3254012-1-pedro@palves.net> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no 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.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 May 2022 21:55:58 -0000 The subject of breakpoint line number sliding came up again in an internal discussion, which reminded me of this WIP patch that I originally posted here: https://sourceware.org/pipermail/gdb-patches/2019-June/158638.html Here's an updated version that is close to ready for merging. It needs agreement, and, testsuite adjustments. Oh, and I realize now, NEWS entries. Both patches already contain documentation changes. I went through the whole "Set Breaks" chapter fixing up things to better match current reality as I was documenting the new features. Patch #1 changes GDB such that instead of: (top-gdb) info breakpoints 1 breakpoint keep y 0x0000000000575127 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54 2 breakpoint keep y 0x0000000000575127 in internal_error(char const*, int, char const*, ...) at src/gdb/common/errors.c:54 3 breakpoint keep y 3.1 y 0x0000000000575127 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 4 breakpoint keep y 0x000055555564107b in main(int, char**) at src/gdb/gdb.c:28 (top-gdb) we get: (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 4 breakpoint keep y gdb.c:27 4.1 y 0x000055555564107b in main(int, char**) at src/gdb/gdb.c:28 (top-gdb) i.e., always show the locations in their own rows, AND print the canonical location spec in the "What" column of the breakpoint's header row. It also indents the location numbers by one space for better grouping. The need for grouping is clearer if you have breakpoints with dozens of locations, such as when you do "b main" when debugging GDB. See that commit's log for a lot more details. Patch #2 introduces an "info breakpoints -hide-locations" option. With that, you get just the breakpoint header rows, showing the canonical location spec originally used to set the breakpoint, but not what the spec expanded to: (top-gdb) i b -h Num Type Disp Enb What 1 breakpoint keep y internal_error 2 breakpoint keep y -qualified internal_error 3 breakpoint keep y errors.c:54 Before this can go in, I'll need to address testsuite fallout, of course. I expect this will be a significant effort, so I'm hoping we can come to agreement on whether the GDB change is OK before wasting time adjusting the testsuite. Pedro Alves (2): Always show locations for breakpoints & show canonical location spec Introduce "info breakpoints -hide-locations" gdb/doc/gdb.texinfo | 208 ++++++++++++++++++++-------------- gdb/ada-lang.c | 9 +- gdb/break-catch-exec.c | 10 +- gdb/break-catch-fork.c | 10 +- gdb/break-catch-load.c | 8 +- gdb/break-catch-sig.c | 10 +- gdb/break-catch-syscall.c | 9 +- gdb/break-catch-throw.c | 10 +- gdb/breakpoint.c | 228 +++++++++++++++++++++++++------------- gdb/breakpoint.h | 5 +- gdb/cli/cli-option.c | 12 +- gdb/cli/cli-option.h | 6 + 12 files changed, 324 insertions(+), 201 deletions(-) base-commit: ee3272d472e864bcbe86d6c647d7b48df715c72b -- 2.36.0