From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4C1E3858C2C; Mon, 17 Apr 2023 09:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4C1E3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681723905; bh=9/KnpPHNGnqnHfjNQcHBiHeVuo6/Xg1QwUn/+X4+ly8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IqfqlcffOehMUgWSg7/0GYbY7GwV5SVxOrb9mqbjucB+Rkp0JgIObcoMrnrMlGKHf cGOK27CV76XKxjb7f5Nk3uH7aeOS5WDbhUbZk+CRZwD8QHEOdp6XV/NdT7cADTbub8 pQLK7A5x+8S5/nlortBI4iwI/9z/+RK5wLl7Qv4U= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug cli/30353] [gdb/cli] segfault on -eiex "set editing off" Date: Mon, 17 Apr 2023 09:31:45 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: cli 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=3D30353 --- Comment #2 from Tom de Vries --- The easiest way to fix this is: ... diff --git a/gdb/event-top.c b/gdb/event-top.c index 53ddd515be7..f6e92655b0d 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -287,7 +287,13 @@ change_line_handler (int editing) if (ui !=3D main_ui) return; - /* Don't try enabling editing if the interpreter doesn't support it + if (top_level_interpreter () =3D=3D nullptr || command_interp () =3D=3D = nullptr) + { + gdb_printf ("Cannot set editing to on or off, no interpreter yet.\n"= ); + return; + } + + /* Don't try enabling editing if the interpreter doesn't support it (e.g., MI). */ if (!interp_supports_command_editing (top_level_interpreter ()) || !interp_supports_command_editing (command_interp ())) ... which gives us: ... $ gdb -eiex "set editing off" Cannot set editing to on or off, no interpreter yet. (gdb)=20 ... --=20 You are receiving this mail because: You are on the CC list for the bug.=