From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 568083858C50; Thu, 6 Apr 2023 03:03:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 568083858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680750213; bh=sk/h/iHfTjxyYfNSCAJ6sVJS52AO9xTZmR1h1aZVXCo=; h=From:To:Subject:Date:From; b=kBsLWyhMYjhpUggl54TRABat19kBpub6HiXhpsQePiiHBx8Cx1L+zp8lJnAB3FGq4 XWELtG7rhEH1LtmxwHkwn+GVIBsmSICLt6mRqf0JaQHm7TEWgt4/WIZj8jluBTuvlL yW7VP31CespfwuyXR7MAVfre/V/nsN9dTGD6Rsec= From: "hluaw at connect dot ust.hk" To: gdb-prs@sourceware.org Subject: [Bug gdb/30318] New: GDB showing outdate value even though DWARF has a new value. Date: Thu, 06 Apr 2023 03:03:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 13.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hluaw at connect dot ust.hk X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30318 Bug ID: 30318 Summary: GDB showing outdate value even though DWARF has a new value. Product: gdb Version: 13.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: hluaw at connect dot ust.hk Target Milestone: --- Given the following code: #include "stdint.h" int a, b; int func_17() { int32_t *l_26 =3D 0; int32_t **c =3D &l_26; *c =3D &a; b =3D 0; return a; } int main() { func_17(); } Compiled with gcc 12.2.0 with -O2 and -g For l_26 the DWARF says: (gdb) info addr l_26 Symbol "l_26" is multi-location: Base address 0x401020 Range 0x401020-0x401020: the constant 0 Range 0x401020-0x40102a: a complex DWARF expression: 0: DW_OP_addr 0x404030 9: DW_OP_stack_value (gdb) p $pc $2 =3D (void (*)()) 0x401020
(gdb) p l_26 $3 =3D (int32_t *) 0x0 Though $pc is at the inclusive beginning of a valid range, gdb still says i= t's zero. --=20 You are receiving this mail because: You are on the CC list for the bug.=