From patchwork Wed Nov 29 20:33:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 80985 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B390A382DC53 for ; Wed, 29 Nov 2023 20:33:45 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 0F5243858034 for ; Wed, 29 Nov 2023 20:33:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F5243858034 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0F5243858034 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701290011; cv=none; b=WwjllHp6BPUCWPLFEU8AYQ8CTkw1gz0wgp+JGiLuaw5ZpYfXk/4S48P/NaiJlHDhBoQKAlbeio8guak1GNSTBsJQcOifvon7h8v6646P/pdk+7Uh21bao4anYKxSBgQT2+FB2lhh48cF73ZQba5IafZg8WuqWHKjZd3lKC8JVHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701290011; c=relaxed/simple; bh=9Kyz9y/GlnhgQmUAA7xs32W6r3jHwHyBkVMaoyRw4+g=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-Id: MIME-Version; b=UNfEeuep/E/0L/caYzdDWtoJguTmZ27SonSw4Hg1gXYo9ZC8no3xbDOC9ue4tMWzWaH8SZ4NoMkFPkDOQrFkYtwoNXFshpPub2VBZ91VgFugVII0lX8RYiv/q/9EJT4QI0FFXFSV1U/Kw9S3YGt345YRT4+bJ3/xERaOGV67bgg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 051A41F8C2 for ; Wed, 29 Nov 2023 20:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1701290009; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TOrpK4WGE06a7X8Bge2o/BTQY/dPdE6Np9bh4hj7qtw=; b=U4u0ZrXgHzFCkxsyacSFOgLiD268F/pbDMGrbYvnGliOVLHfmjc19VBWEFLZS7CEvgkBI4 PMmZXdl1TOeDAu1L/j+hLG3SEic7DxqT6Qeo2VaQJtlwUWzjbZGtjSmAbaH8o++fayZFdM 8scruAA0VCysrwpcEi3YPucXHbzonNY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1701290009; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TOrpK4WGE06a7X8Bge2o/BTQY/dPdE6Np9bh4hj7qtw=; b=6Yyojoil8Jb7dIMlivoxzvYxIbHRAuJxFtaCpOesPSqhF0SIDFZRKsFGXjk2OvmxOSie7d Q9Gqa/5JzUyK2uCQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E75BB13AA2 for ; Wed, 29 Nov 2023 20:33:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UMUDNxigZ2U5QQAAD6G6ig (envelope-from ) for ; Wed, 29 Nov 2023 20:33:28 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [RFC 2/4] [gdb] Introduce maint set prefer-software-single-stepping on/off Date: Wed, 29 Nov 2023 21:33:24 +0100 Message-Id: <20231129203326.11952-2-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231129203326.11952-1-tdevries@suse.de> References: <20231129203326.11952-1-tdevries@suse.de> MIME-Version: 1.0 Authentication-Results: smtp-out2.suse.de; none X-Spam-Score: 3.86 X-Spamd-Result: default: False [3.86 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_MISSING_CHARSET(2.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.04)[58.17%] X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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+patchwork=sourceware.org@sourceware.org Add a maintenance command that enables using software single-stepping on targets that support this: ... (gdb) maint set prefer-software-single-stepping on ... By default, prefer-software-single-stepping is off, and behaviour is unchanged. Also, there are no users yet, the following patch will add one for amd64. This is an RFC for the moment, so no docs yet. Tested on x86_64-linux. --- gdb/breakpoint.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 60e795e1849..3d90e2a2159 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -13945,6 +13945,9 @@ insert_single_step_breakpoint (struct gdbarch *gdbarch, update_global_location_list (UGLL_INSERT); } +extern bool prefer_software_single_stepping; +bool prefer_software_single_stepping; + bool software_single_step_p (struct gdbarch *gdbarch) { @@ -15168,6 +15171,16 @@ When on, breakpoint location specific debugging is enabled."), show_debug_breakpoint, &setdebuglist, &showdebuglist); + add_setshow_boolean_cmd ("prefer-software-single-stepping", class_maintenance, + &prefer_software_single_stepping, _("\ +Set whether software single-stepping is preferred."), _("\ +Show whether software single-stepping is preferred."), _("\ +When on, if both are available, software single-stepping is preferred over hardware single-stepping."), + NULL, + NULL, + &maintenance_set_cmdlist, + &maintenance_show_cmdlist); + add_setshow_enum_cmd ("condition-evaluation", class_breakpoint, condition_evaluation_enums, &condition_evaluation_mode_1, _("\