From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EcHGCd2RTWfrowEAWB0awg (envelope-from ) for ; Mon, 02 Dec 2024 05:54:21 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yld9BxGo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1C4601E0BB; Mon, 2 Dec 2024 05:54:21 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 94CA31E092 for ; Mon, 2 Dec 2024 05:54:20 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8561B3858C53 for ; Mon, 2 Dec 2024 10:54:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8561B3858C53 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Yld9BxGo Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 60A983858D26 for ; Mon, 2 Dec 2024 10:53:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60A983858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 60A983858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733136820; cv=none; b=Ertn01CVAUxN32vi8YkKQrgLca0ZhpM/5SMAdaZhnc5XvjFPc2vkiixvH4ptnDC9Hd+ZkXKXvT9kLVEZ1s6xJjiM0uLCZV6e1heVci2yPeOgmcoj0N5Gix/7JuKjXKryb5+591WkBBLHJLWu/ZLVvgXhRd0BYwJRTeKLM5sAlR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733136820; c=relaxed/simple; bh=BQSDzMzttpM/NFhv6zgbfxsCcLWtSIeNROK+ngWhKTI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=eHfwFVHSwEWndNNxmUvE3DmPeKWbc38gDxwSBQjBG+3fX2sIhYu1hAR9NSUAG9KsyYMfckrXpbnmRNI533Uor9aQYZFUwYMoFPmCBdEp9EnOPnpzsBT/Gzn8CDKxWwSiodNMGfCVhP4ng8vXjHwHQroYFtTkfJBu0NHg6R49BWU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60A983858D26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1733136820; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ckf1xmU1KVC3X9Lr5rgC22hsigENzQctTwVh5YKTlBY=; b=Yld9BxGogAdzIsbmscUS3+4Kz4KNcCfNUK+pOs+lbz33qHFIiP3/M0ayt6d3zUiutkN2gj wtAujgWjxrVrMhA84uw6Z7uRQhITGNpOQiqjiHCnqGZOnHjP+dslapJ4LszYJ/6bBip8PM VPMEiWwx7cIYSezX8fb4bsaw6nbNeXc= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-442-atfac9SOPeqMLK4IMGegYg-1; Mon, 02 Dec 2024 05:53:39 -0500 X-MC-Unique: atfac9SOPeqMLK4IMGegYg-1 X-Mimecast-MFC-AGG-ID: atfac9SOPeqMLK4IMGegYg Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-385e49efd59so759643f8f.0 for ; Mon, 02 Dec 2024 02:53:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733136817; x=1733741617; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ckf1xmU1KVC3X9Lr5rgC22hsigENzQctTwVh5YKTlBY=; b=iZnTOFV1maoWYDfN0wvNfEqLyDR0+oYWq80dYUxD1tiPpSIQyu4pcr+8CnF8o/aCdQ HOyhxHHEh7BUOENagWfHSKbCZWGknMHEayCy4ZJPK3BoLrYkErZVUrAAaZy1gnJqfihZ zOcB1lcV4p3667KU/zkoJjqBE+YAk+xw3r83OY8oiP5XdmcWUPx45/FrGOcOAmFcsDlg E4maXnyuHfuSZ/Yq2r8Qz1EQ+QHRfGeUPz7Fzb5zMCoQt4sfhlxUf3zrmOKyAQAaJ338 v8KcrN/w6PPJwhDyhhdtqGYYgVqvvEU2GxlHuk9mj4kC0Clggsix3T1v3pznXj1HUWq2 NqMg== X-Forwarded-Encrypted: i=1; AJvYcCU8APpAGZV3v7urs6xD777rUkfMh5HPghDacLuESeSG0Egp6TtsZJClqlX5zR5yBldL7N9X0viA6qavaQ==@sourceware.org X-Gm-Message-State: AOJu0YzDYzbY+bat9N8OAjKjtwSam9haIpwHIR3HCl1+QFQqt1BMrhnb mcFC5AYxXbA/WBcXXJI+v90kt/IKIuo3UhPe8tA1lFGdoL0YLLZ+uOK1abZYb4HqkKcbpvEz6is zUYopd73V3FWTrgqd74yR9BW0RhBQc7VUNzz8KJXfixIfthWawxxrXNL7nhvyWt06uQk= X-Gm-Gg: ASbGnctduf4i478653qH+4J3h1Q8smQ4hueCrcHmaZxp0qKc8Rbmh+ygtCw3QrxJOLk /cwRJHD8bq0uufb1bxGDUfbMysoOiiUrLIMksLB4G6H13K2qfyDiLyYmgTR9SjD1P40PuFVneIP 3kdbsGLES+JJnDvKMSlnz6ejCHfbXrQAmud8EhdLt2sEaO18i2yZ+ZdTBsBnVgTMHVJvdb44Tvj drySAQMBsdHOPBu9VI3NbCqR9+MYeDXc+wPAqY5KhAkjZoPmobem3IMkf7c6I+VjIdZTtfRvlW8 BQ== X-Received: by 2002:a05:600c:1d8d:b0:426:6edf:6597 with SMTP id 5b1f17b1804b1-434a9dd02a5mr189495035e9.19.1733136817217; Mon, 02 Dec 2024 02:53:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfmWsC2RBVev/V7luKEWuduWUqTUGO7dSkS5+CLyxS52QecueZMm8yXZk6xXGjr64QV4vngA== X-Received: by 2002:a05:600c:1d8d:b0:426:6edf:6597 with SMTP id 5b1f17b1804b1-434a9dd02a5mr189494865e9.19.1733136816812; Mon, 02 Dec 2024 02:53:36 -0800 (PST) Received: from localhost (197.209.200.146.dyn.plus.net. [146.200.209.197]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385e5b10478sm6485464f8f.73.2024.12.02.02.53.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 02:53:36 -0800 (PST) From: Andrew Burgess To: Bernd Edlinger , gdb-patches@sourceware.org Cc: Kevin Buettner Subject: Re: [PATCHv2] gdb: handle DW_AT_entry_pc pointing at an empty sub-range In-Reply-To: References: <34cfe440ffd0e53843bfaf92494d29a6951fa9fd.1732114887.git.aburgess@redhat.com> <79756797913a38e36ffd4e244c6bd0553613eb4a.1732815309.git.aburgess@redhat.com> Date: Mon, 02 Dec 2024 10:53:35 +0000 Message-ID: <87wmgijqz4.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: oHKuc2gqyuPlXvQWsGQhNscbUWdpmAeoJ9i7yqiv484_1733136818 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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~public-inbox=simark.ca@sourceware.org Bernd Edlinger writes: > Hi Andrew, > > On 11/28/24 18:44, Andrew Burgess wrote: >> Bernd, >> >> Here's a v2 with an extended DWARF assembler test that now includes a >> line table in some cases. Specifically, when I test with label foo_6, >> the address which is the end of a sub-range, which is also the end of >> the entire block range, then I add a line table which indicates that >> this address is the transition back from an inline function to the >> outer function. >> > > Respect! > > >> I've tested this with your series merge on top of this patch, and, >> with your modified block lookup logic in place, and with the 'addr < >> block->end ()' changed to 'addr <= block->end ()' in >> dwarf2_addr_in_block_ranges (as well as in block::set_entry_pc) GDB is >> able to stop at the foo_6 label. >> >> I think you were OK with the v1 patch being merged, but I'll give you >> some time to comment on the updated test. If you're happy with this >> then I'll get this merged. >> > > Yes, I am OK with the v1 patch to be merged now. Great. I pushed this patch. > >> Thanks, >> Andrew >> > > P.S: As I was pretty busy the last days, I have not been able to > give the requested data earlier, so here I have the line table of the > step-and-next-inline-no-header, compiled with gcc-9.4.0: > > $ readelf -w step-and-next-inline-no-header > [...] > <2><8d6>: Abbrev Number: 38 (DW_TAG_inlined_subroutine) > <8d7> DW_AT_abstract_origin: <0x9c7> > <8db> DW_AT_entry_pc : 0x1189 > <8e3> DW_AT_GNU_entry_view: 0 > <8e4> DW_AT_ranges : 0x30 > [...] > 00000030 0000000000001189 0000000000001189 (start == end) > 00000030 000000000000118d 0000000000001197 > 00000030 0000000000001060 0000000000001065 > 00000030 > [...] > > so the intersting end pc values are 0x1189 0x1197 and 0x1065. > > $ readelf -wL step-and-next-inline-no-header > File name Line number Starting address View Stmt > [...] > step-and-next-inline.cc 54 0x1184 1 > step-and-next-inline.cc 38 0x1189 x -->+ > step-and-next-inline.cc 40 0x1189 1 x | > step-and-next-inline.cc 50 0x1189 2 <--+ > step-and-next-inline.cc 40 0x118d > step-and-next-inline.cc 40 0x118f > step-and-next-inline.cc 42 0x1197 x -->+ > step-and-next-inline.cc 43 0x1197 1 x | > step-and-next-inline.cc 43 0x1197 2 | > step-and-next-inline.cc 52 0x1197 3 <--+ > step-and-next-inline.cc 52 0x119a > [...] > step-and-next-inline.cc 41 0x1060 1 > step-and-next-inline.cc 41 0x1065 > step-and-next-inline.cc - 0x1065 > > So we have most of the time one or two statement lines, > followed by one or more non-statement lines at the end_pc, these > statement lines are considered to be weak. When we have a breakpoint > there it should show the program stepping out of the inline to the > calling function. > > Then we have the third line, which is a non-statement line followed > by an end marker at the same pc, we usually ignore those, because they > are unreachable, in this case after the abort(), and could easily be > the beginning of the next function. If we happen to have a breakpoint > at this pc value, we should never consider any sub-range from the > function before. And a breakpoint there should show that we just > entered the function. Thanks for the details, and the analysis. Thanks, Andrew