From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C769D3858D20; Sun, 11 Feb 2024 11:50:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C769D3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707652219; bh=DBFxBXZr+wajQs5oInXmkqIJf0tqZ17MoLxeghs3AwI=; h=From:To:Subject:Date:From; b=Lho3xgsQ0cPm0+cA1vrXjO8mGrwADfouOiHxDEDbI/Sf7qZ3Ff4Mo3QYp1YDk2mVu V8zDgEa1oenu7Z45Dy0Firb18XbFyZAa2XEPaavE8CZwJadtpuZqRL38bCz42Y2gAT lDmwLiIjMNu/1oFLCJjAdTti5wyd8LDV2953Gm+Q= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31369] New: [gdb] command aborted with debug frame Date: Sun, 11 Feb 2024 11:50:18 +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: 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: 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=3D31369 Bug ID: 31369 Summary: [gdb] command aborted with debug frame Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- I investigated some problem on arm-linux in a gdb.in script, and added "set debug frame on". I ran into: ... [frame] frame_unwind_register_value: exit gdb.in:9: Error in sourced command file: value is not available ... and the script stopped. The corresponding backtrace is: ... (gdb) bt #0 0xf75906d2 in __cxa_throw () from /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 #1 0xab1ccffa in throw_it (reason=3DRETURN_ERROR, error=3DNOT_AVAILABLE_ER= ROR,=20 fmt=3D0xab3098ec "value is not available", ap=3D...) at /home/rock/gdb/src/gdbsupport/common-exceptions.cc:204 #2 0xab1cd076 in throw_verror (error=3DNOT_AVAILABLE_ERROR,=20 fmt=3D0xab3098ec "value is not available", ap=3D...) at /home/rock/gdb/src/gdbsupport/common-exceptions.cc:212 #3 0xab1cd0a8 in throw_error (error=3DNOT_AVAILABLE_ERROR,=20 fmt=3D0xab3098ec "value is not available") at /home/rock/gdb/src/gdbsupport/common-exceptions.cc:227 #4 0xab0490b6 in value::require_available (this=3D0xab5975d8) at /home/rock/gdb/src/gdb/value.c:1137 #5 0xab0499b0 in value::contents (this=3D0xab5975d8) at /home/rock/gdb/src/gdb/value.c:1307 #6 0xaad837ec in frame_unwind_register_value (next_frame=3D..., regnum=3D9= 1) at /home/rock/gdb/src/gdb/frame.c:1320 #7 0xab04eae8 in value::fetch_lazy_register (this=3D0xab542d68) at /home/rock/gdb/src/gdb/value.c:3962 #8 0xab04f09c in value::fetch_lazy (this=3D0xab542d68) at /home/rock/gdb/src/gdb/value.c:4057 #9 0xab049a50 in value::optimized_out (this=3D0xab542d68) at /home/rock/gdb/src/gdb/value.c:1339 #10 0xaad83718 in frame_unwind_register_value (next_frame=3D..., regnum=3D9= 1) at /home/rock/gdb/src/gdb/frame.c:1299 #11 0xaad8316e in frame_register_unwind (next_frame=3D..., regnum=3D91,=20 optimizedp=3D0xfffee5a4, unavailablep=3D0xfffee5a0, lvalp=3D0xfffee5a8, addrp=3D0xfffee598,=20 realnump=3D0xfffee594, bufferp=3D0x0) at /home/rock/gdb/src/gdb/frame.c= :1190 #12 0xaaf3f2ba in info_frame_command_core (fi=3D..., selected_frame_p=3Dfal= se) at /home/rock/gdb/src/gdb/stack.c:1761 #13 0xaaf448c6 in frame_command_helper::level ( arg=3D0xfffef17f "0", from_tty=3D0) at /home/rock/gdb/src/gdb/stack.c:1= 891 #14 0xaaf444b4 in frame_command_helper::base_comma= nd ( arg=3D0xfffef17f "0", from_tty=3D0) at /home/rock/gdb/src/gdb/stack.c:1= 966 #15 0xaac2774e in do_simple_func (args=3D0xfffef17f "0", from_tty=3D0, c=3D0xab4d42c0) at /home/rock/gdb/src/gdb/cli/cli-decode.c:95 #16 0xaac2afaa in cmd_func (cmd=3D0xab4d42c0, args=3D0xfffef17f "0", from_t= ty=3D0) at /home/rock/gdb/src/gdb/cli/cli-decode.c:2742 #17 0xaafac12a in execute_command (p=3D0xfffef17f "0", from_tty=3D0) at /home/rock/gdb/src/gdb/top.c:571 #18 0xaad5c76a in command_handler (command=3D0xfffef174 "info frame 0") at /home/rock/gdb/src/gdb/event-top.c:566 #19 0xaafab920 in read_command_file (stream=3D0xab4b9818) at /home/rock/gdb/src/gdb/top.c:338 #20 0xaac3678e in script_from_file (stream=3D0xab4b9818, file=3D0xfffef811 "gdb.in") at /home/rock/gdb/src/gdb/cli/cli-script.c:1644 #21 0xaac205d6 in source_script_from_stream (stream=3D0xab4b9818,=20 file=3D0xfffef811 "gdb.in", file_to_open=3D0xfffef268 "gdb.in") at /home/rock/gdb/src/gdb/cli/cli-cmds.c:730 #22 0xaac206dc in source_script_with_search (file=3D0xfffef811 "gdb.in", from_tty=3D0,=20 search_path=3D0) at /home/rock/gdb/src/gdb/cli/cli-cmds.c:775 #23 0xaac20730 in source_script (file=3D0xfffef811 "gdb.in", from_tty=3D0) at /home/rock/gdb/src/gdb/cli/cli-cmds.c:784 #24 0xaae3516c in catch_command_errors ( command=3D0xaac2071d , arg=3D0xfffef811 "gdb.in",=20 from_tty=3D0, do_bp_actions=3Dfalse) at /home/rock/gdb/src/gdb/main.c:5= 07 #25 0xaae352e6 in execute_cmdargs (cmdarg_vec=3D0xfffef404, file_type=3DCMDARG_FILE,=20 cmd_type=3DCMDARG_COMMAND, ret=3D0xfffef3f4) at /home/rock/gdb/src/gdb/main.c:603 #26 0xaae36714 in captured_main_1 (context=3D0xfffef544) at /home/rock/gdb/src/gdb/main.c:1304 #27 0xaae368e2 in captured_main (data=3D0xfffef544) at /home/rock/gdb/src/gdb/main.c:1325 #28 0xaae3694c in gdb_main (args=3D0xfffef544) at /home/rock/gdb/src/gdb/main.c:1354 #29 0xaaaee8ea in main (argc=3D5, argv=3D0xfffef6b4) at /home/rock/gdb/src/gdb/gdb.c:39 ... The problem is here in frame_unwind_register_value: ... if (value->lazy ()) gdb_printf (&debug_file, " lazy"); else { int i; gdb::array_view buf =3D value->contents (); ... It doesn't check for the value->entirely_available () case. This fixes it: ... diff --git a/gdb/frame.c b/gdb/frame.c index fae89cbbc0a..4b97c23e3d5 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1314,6 +1314,8 @@ frame_unwind_register_value (frame_info_ptr next_fram= e, int regnum) if (value->lazy ()) gdb_printf (&debug_file, " lazy"); + else if (!value->entirely_available ()) + gdb_printf (&debug_file, " unavailable"); else { int i; ... --=20 You are receiving this mail because: You are on the CC list for the bug.=