From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1AF0A385842C for ; Mon, 2 Oct 2023 13:11:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1AF0A385842C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1696252282; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=c4LROW/zIRlAGSkGpmvFtcpHokHBXvu9QnD1DMK30Qo=; b=QRsCYzPG3twO8ZsFZDKabkq4saphjDPUFtcvppWxNvcHLmTWTtSbleip0X57myglUQlWei wEkeaTEmflC0Augy69Gk5XAMCg2hdOIrsR5TwoosaQSZ/C/5260/BpvwgjgguPfCaZ4x4V zSfoNzF33xJkTOc+xIvY5QkSb+brVR4= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-dVYG-CCzOIW15BsVavRDNw-1; Mon, 02 Oct 2023 09:11:21 -0400 X-MC-Unique: dVYG-CCzOIW15BsVavRDNw-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-9ae686dafedso1415398366b.3 for ; Mon, 02 Oct 2023 06:11:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696252280; x=1696857080; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=c4LROW/zIRlAGSkGpmvFtcpHokHBXvu9QnD1DMK30Qo=; b=BEFmfBtyNh8PFjWgBYdWlj1fKCFDow1C9TjV/VqqfE7vbZvD8PKVMA2zCg24+epjXA jNB5KSGOBKfWeL1fhQz0gjX83VDVRbxRVsUbP0sb7PDaXro6RnDEo+Ov0qeXZ56Xfheh dHIDS+u/LSMnk5ON2HArAuiymI4Tq5U+mb57Xtlt2eFnN4u1na/c6HMcGGSBW3SeCFiK OjyabLxiSIaOwrE2Xml+LHwlEAEpVcXLOAXD1Sp9CwD8GRhr/83308ik4dtR55Amqtxs ryYqpvRZo6gS0pJlbXLxdF1bxTJKQKIdbojhHxsbed2b4vkjUvvuvCzeipxbdlZyshJ3 iMvA== X-Gm-Message-State: AOJu0Yz9bPCfP2mJkEqQsf5zCOSxrEd/I/1zyqb3oBFNakKsbbuA/cpB ZnaBYjPFkZt8Q1a28TzE0i6WT31VTuPD70UdzOEWVEA7B1HwkSN5tj9+z6nYviF0PCzFszRcGER D+Psynd0yNtg1suF6MTV1ht3u/NygGQ== X-Received: by 2002:a17:906:74ca:b0:9b2:94a8:df5 with SMTP id z10-20020a17090674ca00b009b294a80df5mr10258909ejl.35.1696252280189; Mon, 02 Oct 2023 06:11:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBHcy7sT7dveK6PnEX17YUrlg2uY6E+wSYDaNQdKzbcNRdfQejkpoDtQmMTR9SZsQSXptkig== X-Received: by 2002:a17:906:74ca:b0:9b2:94a8:df5 with SMTP id z10-20020a17090674ca00b009b294a80df5mr10258878ejl.35.1696252279651; Mon, 02 Oct 2023 06:11:19 -0700 (PDT) Received: from [192.168.0.129] (ip-94-112-227-180.bb.vodafone.cz. [94.112.227.180]) by smtp.gmail.com with ESMTPSA id i13-20020a170906090d00b0099cbfee34e3sm16989367ejd.196.2023.10.02.06.11.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Oct 2023 06:11:18 -0700 (PDT) Message-ID: Date: Mon, 2 Oct 2023 15:11:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 1/2] gdb/record: print frame information when exiting a recursive call To: Kevin Buettner , Kevin Buettner via Gdb-patches References: <20230927101950.1913970-3-blarsen@redhat.com> <20230927101950.1913970-4-blarsen@redhat.com> <20230927142619.04ca311d@f37-zws-nv> <20230927162231.5d301671@f37-zws-nv> <20230927185710.3475c282@f37-zws-nv> From: Guinevere Larsen In-Reply-To: <20230927185710.3475c282@f37-zws-nv> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 List-Id: On 28/09/2023 03:57, Kevin Buettner wrote: > On Wed, 27 Sep 2023 16:22:31 -0700 > Kevin Buettner wrote: > >> I'll now do some actual debugging, comparing what happens with and >> without Gwen's patch... > I think I understand what's going on now. This part of the > patch... > > diff --git a/gdb/infrun.c b/gdb/infrun.c > index 4730d290442..3491327422d 100644 > --- a/gdb/infrun.c > +++ b/gdb/infrun.c > @@ -6923,6 +6923,11 @@ process_event_stop_test (struct execution_control_state *ecs) > frame = get_current_frame (); > gdbarch = get_frame_arch (frame); > > + /* Shorthand to make if statements smaller. */ > + struct frame_id original_frame_id > + = ecs->event_thread->control.step_frame_id; > + struct frame_id curr_frame_id = get_frame_id (get_current_frame ()); > + > switch (what.main_action) > { > case BPSTAT_WHAT_SET_LONGJMP_RESUME: > > ...is causing get_frame_id() to be called in situations where it might > not have been called before. For the test case in question, it's > causing glibc's symbols to be loaded - they weren't before. If the > new code is either removed or moved to a location later in the > function, then glibc's symbols aren't loaded. Huh! I moved this code further up from v2, but I didn't expect this change to make any difference at all. Thanks for spotting it! This is only that far up because then I could simplify more stuff on patch 2. > > Is this a problem? > > For most (almost all?) debugging scenarios, this will merely cause > some symbols to be loaded somewhat earlier in the debugging session > than they would have been otherwise. Therefore, I don't think it's a > problem. However, if someone has a different point of view, I'd like > to hear it... I'll give it a week or so before sending a new version with your suggestions. If the ultimate decision is to leave things as they are, it is trivial to revert my patch to where the test case doesn't have that regression. -- Cheers, Guinevere Larsen She/Her/Hers > > How should we fix the regresssion? > > The problematic command in gdb.dwarf2/dw2-out-of-range-end-of-seq.exp > is: > > maint info line-table main.c$ > > The 'main.c$' part of it is actually a regular expression. Due > to the fact that glibc has been loaded earlier than it had been > in the past, this RE is matching main.c, which is what we want, > but also textdomain.c and support_test_main.c, which we don't. > These latter two files are from glibc. The relevant lines from > the log file are as follows: > > (gdb) maint info line-table main.c$ > objfile: /mesquite2/sourceware-git/f38-review/bld/gdb/testsuite/outputs/gdb.dwarf2/dw2-out-of-range-end-of-seq/dw2-out-of-range-end-of-seq ((struct objfile *) 0x2273d50) > compunit_symtab: main.c ((struct compunit_symtab *) 0x2267b80) > symtab: /mesquite2/sourceware-git/worktree-review/gdb/testsuite/gdb.dwarf2/main.c ((struct symtab *) 0x2267c00) > linetable: ((struct linetable *) 0x2267e20): > INDEX LINE REL-ADDRESS UNREL-ADDRESS IS-STMT PROLOGUE-END > 0 1 0x0000000000401106 0x0000000000401106 Y > 1 END 0x0000000000401111 0x0000000000401111 Y > > objfile: /usr/lib/debug/usr/lib64/libc.so.6-2.37-5.fc38.x86_64.debug ((struct objfile *) 0x23eecc0) > compunit_symtab: ((struct compunit_symtab *) 0x2c47a50) > symtab: /usr/src/debug/glibc-2.37-5.fc38.x86_64/intl/textdomain.c ((struct symtab *) 0x2c71530) > linetable: ((struct linetable *) 0x0): > No line table. > > objfile: /usr/lib/debug/usr/lib64/libc.so.6-2.37-5.fc38.x86_64.debug ((struct objfile *) 0x23eecc0) > compunit_symtab: ((struct compunit_symtab *) 0x2c47a50) > symtab: /usr/src/debug/glibc-2.37-5.fc38.x86_64/support/support_test_main.c ((struct symtab *) 0x2c87410) > linetable: ((struct linetable *) 0x0): > No line table. > > If the command is changed to "maint info line-table \bmain.c$", the > word boundary anchor \b will cause only main.c to be matched. > > (Ideally, the . would also be escaped with '\' so that it would only > match a literal . (period) and not any character.) > > Kevin >