From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 166E63858CD1; Thu, 18 Apr 2024 07:54:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 166E63858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713426851; bh=3mYojSWWw6W+7l+uO0oKtsY+vZlK7HTDai2Egh9Ic0Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NawgBnN8C67qg2Mc5WZUTDT0PmuSIYv5LayRh0Ff76boC05AZwlC9sDFybSE59S2U YE79QaXuKiL/aSSDXMsqmWMngcNfpryOHSSe+cJvlcrIbBQLTDOjRZgcb8XslqP+VP jNcp3j5hsktxfdkAPRYBLSdIWhZacFQD2MtAgnSw= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug ada/31648] [gdb/ada] segfault in coerce_ref Date: Thu, 18 Apr 2024 07:54:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: ada X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW 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: Message-ID: In-Reply-To: References: 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=3D31648 --- Comment #4 from Tom de Vries --- With this: ... diff --git a/gdb/valops.c b/gdb/valops.c index a17b937a963..90be1c0a86b 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -2330,6 +2330,9 @@ value_struct_elt (struct value **argp, struct type *t; struct value *v; + if (*argp =3D=3D nullptr) + error (_("%s"), err); + *argp =3D coerce_array (*argp); t =3D check_typedef ((*argp)->type ()); ... we have instead: ... $ gdb -q -batch -ex "set trace-commands on" -x gdb.in +file foo_n207_004 +break foo_n207_004.adb:25 Breakpoint 1 at 0x401cc0: file /usr/src/packages/BUILD/gdb-13.2/gdb/testsuite/gdb.ada/tick_length_array_en= um_idx/foo_n207_004.adb, line 25. +run=20 Breakpoint 1, foo_n207_004 () at /usr/src/packages/BUILD/gdb-13.2/gdb/testsuite/gdb.ada/tick_length_array_en= um_idx/foo_n207_004.adb:25 warning: 25=20=20=20=20 /usr/src/packages/BUILD/gdb-13.2/gdb/testsuite/gdb.ada/tick_length_array_en= um_idx/foo_n207_004.adb: No such file or directory +print vars'length gdb.in:4: Error in sourced command file: Bad GNAT array descriptor bounds ... --=20 You are receiving this mail because: You are on the CC list for the bug.=