From nobody Mon Feb 9 20:35:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1584381145; cv=none; d=zohomail.com; s=zohoarc; b=EhLKN+VuZi/HP/eFnxDN8mdB0shOxRTMp6EC2Cn8ZDPhCqaqVXP7t0Sep3kow5RiipraON8MmfW9jup97jboDZxTMdm9GKQgqHEvivQRv0BDvXkfYL3NZs50t517MFJJn405C+jWQz8HlszFYJvRd9TrDy4oC/wz8byCht6Wry8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584381145; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7aNXZAoL0fEr8CHp9NIvYI/wCGleSQwEmfp3SuRJ1II=; b=mbXpCouImw5hwUJ78u9JQwuqEytUA4udgeD7EhLWhoxtGxwAV8Nj99V+MgmWEdV2FO9iVzsLhALWkvzmZuVBjoxhId3Q15jNq5Lon6rPjVewFpO/3iwGNauNkEElcscMRIRQ38+0jgeILlsf0E320OwpdyqiM33MZ5Rk8JZgdQM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1584381145962587.0544518096895; Mon, 16 Mar 2020 10:52:25 -0700 (PDT) Received: from localhost ([::1]:44908 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDtua-0005YU-SQ for importer@patchew.org; Mon, 16 Mar 2020 13:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45711) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jDtRj-0001Io-AO for qemu-devel@nongnu.org; Mon, 16 Mar 2020 13:22:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jDtRf-00024w-4p for qemu-devel@nongnu.org; Mon, 16 Mar 2020 13:22:35 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:33096) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jDtRe-0001uD-Q7 for qemu-devel@nongnu.org; Mon, 16 Mar 2020 13:22:30 -0400 Received: by mail-wm1-x343.google.com with SMTP id r7so13797952wmg.0 for ; Mon, 16 Mar 2020 10:22:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s22sm414601wmc.16.2020.03.16.10.22.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2020 10:22:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC0801FFB5; Mon, 16 Mar 2020 17:21:57 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7aNXZAoL0fEr8CHp9NIvYI/wCGleSQwEmfp3SuRJ1II=; b=GZ3O3rJrzhGNg0CM8AEaKyrEvYVxBCL51fXVE/7hRqQr1tt/5Ncc6kWQAFdf+m8Glw tQYL6Kf42n+Za4+rA7MrmCCWJMYriBqjUX58jEr1jL/ZVnTvONbtZpqJWtCvm+eb7H86 7f1FJxZhmaVNqES1vYNeuAgKhQYZF68R5Lfz6VHlc9zGY/74c/ZqFD/bfs+cWtJgZGA1 YixPbCgtH/iY6scDl3mmK9qOUBKzQdil9xGrHtOISIWRdlXzsFgryw1ZDRgh06Vg3Oo0 BxAytqJ3hN6tX8z20HhII2qudjjpkRYSThlWqB2eLVMMUOuH08Vas1H2NuzAFDx3H/AD Wv/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7aNXZAoL0fEr8CHp9NIvYI/wCGleSQwEmfp3SuRJ1II=; b=RJlM6zjBiPDUEg7yXpVf26GNQxBd55ZmfFxDRx34vei7ckTmWH9MK7KQolwQr62L+u hefGi+kS/OI0pSCVOPtfdEg2uhqAQAdcAwUSl/uQ75hoWNRJ+gZrSO0pjj285+4xwORO AOVtduLhJehRnxeHPmXbSDAO9ZaCbl8vt1O78Unqzl9f6v3Jqc5ld/roUxJwnzpFH01G iangcy0E0ATezzdCTYvCDpDOH0WYwoxAnPiCY+DR+5/W0bqRI3UOF7h3Vw16jbVC5n2x CiTM6qCnzyhGXtt0XiwKYfO55UC1EuE9d7m2Xm9q4ViGAYro0O+PtcHInzm9bBcYMoVj mDEg== X-Gm-Message-State: ANhLgQ2eeSW1e3kRjM9UVvCId+7KDsq6DxTqqohXp3ktBCXPbk91RXx1 /omkoMMyNguvsTGermHcZVoHNA== X-Google-Smtp-Source: ADFU+vsdrorSCRHex1nb95ebvHsRyd/B8fRk97wi5pQPeCfiK2sgXn0zQeixDGN9JIeVdgNC9ekPEg== X-Received: by 2002:a1c:6605:: with SMTP id a5mr194207wmc.32.1584379348650; Mon, 16 Mar 2020 10:22:28 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 28/28] gdbstub: Fix single-step issue by confirming 'vContSupported+' feature to gdb Date: Mon, 16 Mar 2020 17:21:55 +0000 Message-Id: <20200316172155.971-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200316172155.971-1-alex.bennee@linaro.org> References: <20200316172155.971-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Luc Michel , Changbin Du Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Changbin Du Recently when debugging an arm32 system on qemu, I found sometimes the single-step command (stepi) is not working. This can be reproduced by below steps: 1) start qemu-system-arm -s -S .. and wait for gdb connection. 2) start gdb and connect to qemu. In my case, gdb gets a wrong value (0x60) for PC, which is an another bug. 3) After connected, type 'stepi' and expect it will stop at next ins. But, it has never stopped. This because: 1) We doesn't report =E2=80=98vContSupported=E2=80=99 feature to gdb expli= citly and gdb think we do not support it. In this case, gdb use a software breakpoint to emulate single-step. 2) Since gdb gets a wrong initial value of PC, then gdb inserts a breakpoint to wrong place (PC+4). Not only for the arm target, Philippe has also encountered this on MIPS. Probably gdb has different assumption for different architectures. Since we do support =E2=80=98vContSupported=E2=80=99 query command, so let'= s tell gdb that we support it. Before this change, gdb send below 'Z0' packet to implement single-step: gdb_handle_packet: Z0,4,4 After this change, gdb send "vCont;s.." which is expected: gdb_handle_packet: vCont? put_packet: vCont;c;C;s;S gdb_handle_packet: vCont;s:p1.1;c:p1.-1 Signed-off-by: Changbin Du Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20200221002559.6768-1-changbin.du@gmail.com> [AJB: fix for static gdbstub] Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Luc Michel --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index 9ae148cd1ff..013fb1ac0f1 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2130,7 +2130,7 @@ static void handle_query_supported(GdbCmdContext *gdb= _ctx, void *user_ctx) gdbserver_state.multiprocess =3D true; } =20 - g_string_append(gdbserver_state.str_buf, ";multiprocess+"); + g_string_append(gdbserver_state.str_buf, ";vContSupported+;multiproces= s+"); put_strbuf(); } =20 --=20 2.20.1