From patchwork Fri Jun 28 05:08:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Romero X-Patchwork-Id: 808144 Delivered-To: patch@linaro.org Received: by 2002:adf:fe0a:0:b0:362:4979:7f74 with SMTP id n10csp194974wrr; Thu, 27 Jun 2024 22:22:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUUgsAJ8FT/7JPJwBxMSgLFJrRrxhzx3BLfV3V74L+Mibrg7rpLNveEXS8lWi1NfYfBTK7KYwr5wAkfluqY2yl X-Google-Smtp-Source: AGHT+IEx2HpF7oaI0XzCK1ozAciexAkwHZy8TlX4XE9/bxcPdMqUDxz3HeBQCC2MB0193DhZWEHY X-Received: by 2002:a05:622a:6:b0:446:58cb:8264 with SMTP id d75a77b69052e-44658cba56amr1941821cf.20.1719552144673; Thu, 27 Jun 2024 22:22:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719552144; cv=none; d=google.com; s=arc-20160816; b=MphGmLAQxqOwNBtM2+4EmJol4BrnBgStr0RQvefQSCvgMRqa/Z8hCRu2rLmdCv2CYK F6khMSk8l8FUqMZyyslmr/gzm/Mr8p4nzpnYo4hhAdIwz9MOX5w69JMIBcrMmmK72Gdp k0lgmIUoB8dciQPHiVCGlN+VsP7aZ8QJCs0SyyQMBeemH5cd6jQKOLCafpzwVvOsdNK7 2pb9gtHPl76RJgp11QpMRvvjLRSXlhTBn3nBKsAGQGxaYc2+d1JNropXeghv4Y78O5tD wAaSzQorbudVgNcwxbEy4gSuoT+2CMkjLP0IjIxT08Al49wwsgDX4T66ZI7mCoCD7o6y Ed9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i7+5Sk6k3Qdhdd1bPl+/zET47DgJiYeK1rga8DTRerY=; fh=fQSRkfw+DkTHa5KQssXieneufL+rl3wPoA2jkVIsZpk=; b=EOH0Pw640HGoTyQ1FShT8HvRTxh9rjKWTxTcm/67ucVzqGFWAhQXFOvO1CHnz3KVtl q54LOY+quj2/y3ajSuV98TTWsuaB2eJZVUQ9erBCvPEs6iv/AdDQOnO2lD2tuFas807C jM1YxmTdG2iNGeatrVaJzwGp8hm23lcmyv3zWmzHcJKuN28K+zWh7QH4suFY71LV37U6 SS9RY+WctKBiBo5H9DLazFXWG73U/DB8KDxJY8WQ5QGm3EvC6g198FtSxCZSOt/B7B9i 3vpA7/EmWUySPvLXQ7TrCRwvetGyXB6RyEXP1arKDpCFbOrDICRBopZcdr8bzhZxymY8 /u9w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNDYs3y8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-446514a02e6si11447161cf.410.2024.06.27.22.22.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Jun 2024 22:22:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YNDYs3y8; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sN42x-0003Ir-H1; Fri, 28 Jun 2024 01:21:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sN42v-0003IX-Pj for qemu-devel@nongnu.org; Fri, 28 Jun 2024 01:21:17 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sN42u-0008En-7b for qemu-devel@nongnu.org; Fri, 28 Jun 2024 01:21:17 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-706b53ee183so985082b3a.1 for ; Thu, 27 Jun 2024 22:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719552074; x=1720156874; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i7+5Sk6k3Qdhdd1bPl+/zET47DgJiYeK1rga8DTRerY=; b=YNDYs3y8fjqsDlhEnDOdiPGD2r9jC4MZ1fFsDmri/kR0Rr3pPww+jIhS0IXT2zSB7h yIhaCvaaGr47YZZjkeZstnAfOfcqITw7ficzMW+mu89+D7XJob8Hm26Djml8VIn4SWXd xRdimOIvBNFZm2rynHVr5aXGjPt9gxf1TCvBeR1r0KcpnBOW2ukWiT/EHt4y1dufbwfi Uc8tZK9UCUTTOg0WsAeAkOH+9fG4mczaBdlyxIHWfqWA7J9/ezFuMCcmPXfdl0OCxorJ CSbEpg8zq8L5M4pZgKChQbO4T9MJkAc40sLHdAsnPWut6eg2kfMEPa8XKZqlxZFi4EP+ rEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719552074; x=1720156874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i7+5Sk6k3Qdhdd1bPl+/zET47DgJiYeK1rga8DTRerY=; b=fG6S4IAZKqS3zB83XG13Z9/+UlGZuFQgXhaPdqFWCUILofaST9cc2PoGz8L2TItNcu t3DokVdooBrO1PRCdqkzt4cGE79uXKHTA9JbBm2XzjJf1Rmwtm6nylgUiQtu/uSe9eR7 Gc/KgYIrrrpAshRJX8gDwow5qyeJjELgSBoTTOBw9mSOV0Jl1VmcH7bEzlac0fuuTp/u TSeFahEGWt/aWCuLhFZvV9jJpy4sKEX1/VGHcGQ2uTv0cbSE/8oT3W3L+m0vOYQYh51X JMOj2diblfi69hUsdxUDEOGwFBn9F1hY4Lpjase5r3WKhIBob3sCTs9otxcB8KoHYWxQ IpsQ== X-Gm-Message-State: AOJu0YzHV7+U0/cLUL9QBrg229b18pL3Ulh9b0jbRaeaUCWrVGG2LSr4 F+iPkaYr5WY77zgYZppvp5Mz4pxwv0bBNE69XbdSqoluLg9diN8piLP1UTK4RPS1+YBYnXTdbyt + X-Received: by 2002:a05:6a20:a10f:b0:1bc:bd60:e7fa with SMTP id adf61e73a8af0-1bee48ff465mr1158861637.2.1719552074375; Thu, 27 Jun 2024 22:21:14 -0700 (PDT) Received: from amd.. ([2804:7f0:b401:391e:3e7c:3fff:fe7a:e83b]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-72c6b2a16cdsm423932a12.46.2024.06.27.22.21.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 22:21:13 -0700 (PDT) From: Gustavo Romero To: qemu-devel@nongnu.org, philmd@linaro.org, alex.bennee@linaro.org, richard.henderson@linaro.org Cc: peter.maydell@linaro.org, gustavo.romero@linaro.org Subject: [PATCH v6 07/11] gdbstub: Make hex conversion function non-internal Date: Fri, 28 Jun 2024 05:08:46 +0000 Message-Id: <20240628050850.536447-8-gustavo.romero@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240628050850.536447-1-gustavo.romero@linaro.org> References: <20240628050850.536447-1-gustavo.romero@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=gustavo.romero@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Make gdb_hextomem non-internal so it's not confined to use only in gdbstub.c. Signed-off-by: Gustavo Romero Reviewed-by: Richard Henderson --- gdbstub/internals.h | 1 - include/gdbstub/commands.h | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 34121dc61a..bf5a5c6302 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -107,7 +107,6 @@ static inline int tohex(int v) void gdb_put_strbuf(void); int gdb_put_packet_binary(const char *buf, int len, bool dump); -void gdb_hextomem(GByteArray *mem, const char *buf, int len); void gdb_memtohex(GString *buf, const uint8_t *mem, int len); void gdb_memtox(GString *buf, const char *mem, int len); void gdb_read_byte(uint8_t ch); diff --git a/include/gdbstub/commands.h b/include/gdbstub/commands.h index 306dfdef97..e51f276b40 100644 --- a/include/gdbstub/commands.h +++ b/include/gdbstub/commands.h @@ -91,4 +91,10 @@ void gdb_extend_set_table(GdbCmdParseEntry *table, int size); */ void gdb_extend_qsupported_features(char *qsupported_features); +/** + * Convert a hex string to bytes. Conversion is done per byte, so 2 hex digits + * are converted to 1 byte. Invalid hex digits are treated as 0 digits. + */ +void gdb_hextomem(GByteArray *mem, const char *buf, int len); + #endif /* GDBSTUB_COMMANDS_H */