Message ID | 20230221225227.3735319-8-alex.bennee@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp370327wrb; Tue, 21 Feb 2023 14:54:22 -0800 (PST) X-Google-Smtp-Source: AK7set8DmrTtYoYlCh8NzK+XTScqwf0CxUeNTGU2ohqcMSQ+4+IXD96R9vln2UvvkNK+k6bMYucW X-Received: by 2002:a05:6214:2508:b0:56f:8a99:1a7a with SMTP id gf8-20020a056214250800b0056f8a991a7amr10359295qvb.23.1677020062090; Tue, 21 Feb 2023 14:54:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677020062; cv=none; d=google.com; s=arc-20160816; b=wGq5zK2dNUS1vuy9PM64LRIA16GKTAUjGSVacKpBYa2bEgzQZn1Dvp5Df/9PR840Hl qEHZD9wX7aOXSkN2Cg0pPKfDx3F9zra8ypdD7nJkAMTfGWg1ogpauNQugIxGTMAOXlRH 6LLNcMqxZ0YWAUtcWn3aFu4N4jcS2zQ/0TWB77i4e+jQmz+7uHhWaeiVUB73YZAel0YV TJ0pPlK49NAReW6Kxu4zsQJMc2FRlJHfYvH865OcdiIU+TjA4ANmnBRVIN8gvV2eHv8l qpNmQdmogND1jnfplSQDWu+Bb+p6p32/kFbFh35VuvJvMykvwMv2nqVPgvXiOcwzy9s9 cseg== 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=JFc0w+Wapn0g+MU5vOsVkVSGetdAkH4dzviTgEpyCGU=; b=XKItAXP5QHkvg48LmVLS2iQB4PMq1bfs7Y5hvE9SybAVyUU66ME7obXbsaQgIH5iYM Avn2NJ+mNkvBBqQxIq8+KxmllHCxw1gBRWajE4M6TG07XQ0B7IQf+l4dF+k7bgEDB4lR GROJ8sfCCxkOOVfPTsLfNXq+m4PdeJGJnp5As35KapPC7JbeaT5Ec5y40cAtQSWPMgjo 8YNDynitRsjmY7NUoH2btoOVjjYJho7iEmtiFTyLjCST/G65S0Av4thEX+e73XMIThLU W0kTForaxZcNwGSe7m8jVevbQR0HstiDGarOHQ0neHyhn+H5A+xfBwJiDeScCrlq+Qy9 O6Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QZtRi94I; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m19-20020a0cf193000000b0053226b8f7ffsi13190337qvl.83.2023.02.21.14.54.21 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Feb 2023 14:54:22 -0800 (PST) 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=QZtRi94I; 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 <qemu-devel-bounces@nongnu.org>) id 1pUbVG-0007XI-Eq; Tue, 21 Feb 2023 17:52:54 -0500 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 <alex.bennee@linaro.org>) id 1pUbV6-0007NU-2L for qemu-devel@nongnu.org; Tue, 21 Feb 2023 17:52:44 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <alex.bennee@linaro.org>) id 1pUbUw-000460-0V for qemu-devel@nongnu.org; Tue, 21 Feb 2023 17:52:43 -0500 Received: by mail-wr1-x434.google.com with SMTP id bo30so5468204wrb.0 for <qemu-devel@nongnu.org>; Tue, 21 Feb 2023 14:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=JFc0w+Wapn0g+MU5vOsVkVSGetdAkH4dzviTgEpyCGU=; b=QZtRi94IRGvKdonD3rmSOlDZghkfwQWsjYeVFyDWXw5ADKQRlESp7ycSy+QiMpRR05 ape7Gd54vw9WQqA0HLhvpbloN8lA5Fo5zWB5xZvTxv86nkAgco0/g4r8bpjbPfOGVFFl pLtOlhyMEOXsbsMcQDyP/6xhHQ/KF68o7YERx/tONCH5uVGIvEzHcN5bCexc3JhCMHex BiCNtfGMEUA2HVQyIpRD/PikCxnTrMSxq4b2dChvLM++uTPxlDZobeOrujY4RgOzClqM 7oZPVahEQL8F6EnWkLXM9o57gzh/C1waqCsdvihuJ8sF9tNRdKNKztdoecPwMjmGkcxk Bjdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=JFc0w+Wapn0g+MU5vOsVkVSGetdAkH4dzviTgEpyCGU=; b=VI2qf58B0YMlx2D6+w1roQEjcm4F9tXEscK5M/4fFxrWc9w0N7SycgZwcGAFeDugX2 0Z/yXEHdXy5ffzkqCN6Wv8NzBP8e0icqiLKv3Qwk8G6eiAIofXaYa9f83KyRtrSV3W0B mFz93OEeBToI6eD1gvERI9GRj2rfCQT+b67z6Z/mkYqkSo+kUm2mED1A1rrVIx5nkYcx olUSZC3x2MWZvh2MW65HoDpo94BC8KO2stvDJZlmLdXWsOn8sU6sVx1MdDE+0/OcK+BR Rqn/MRn/1uYR+74vo7bo6i6UmxPYGfEFSyREQmvpAfiGpuwUsXEwJiqSqKKocAaaG1CI 5ygQ== X-Gm-Message-State: AO0yUKUfrEL//0cLLMcuFbjt+Jzta2qDsgxJ4Safp/J7C2VN68qYdsP2 XcmztocK8o0+13G+lh9uc0I91w== X-Received: by 2002:a05:6000:1091:b0:2c5:5d11:fa52 with SMTP id y17-20020a056000109100b002c55d11fa52mr6046534wrw.15.1677019952255; Tue, 21 Feb 2023 14:52:32 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t3-20020a5d4603000000b002bfd524255esm5807542wrq.43.2023.02.21.14.52.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 14:52:31 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2B2291FFB7; Tue, 21 Feb 2023 22:52:28 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Cc: Thomas Huth <thuth@redhat.com>, qemu-arm@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org, Yoshinori Sato <ysato@users.sourceforge.jp>, nicolas.eder@lauterbach.com, Stafford Horne <shorne@gmail.com>, Daniel Henrique Barboza <danielhb413@gmail.com>, Mahmoud Mandour <ma.mandourr@gmail.com>, Taylor Simpson <tsimpson@quicinc.com>, mads@ynddal.dk, Marek Vasut <marex@denx.de>, Artyom Tarasenko <atar4qemu@gmail.com>, Alistair Francis <alistair.francis@wdc.com>, qemu-ppc@nongnu.org, Yanan Wang <wangyanan55@huawei.com>, Sunil Muthuswamy <sunilmut@microsoft.com>, =?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>, Eduardo Habkost <eduardo@habkost.net>, Bin Meng <bin.meng@windriver.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Palmer Dabbelt <palmer@dabbelt.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Laurent Vivier <laurent@vivier.eu>, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Paolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Aurelien Jarno <aurelien@aurel32.net>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Richard Henderson <richard.henderson@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Alexandre Iooss <erdnaxe@crans.org>, Chris Wulff <crwulff@gmail.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, David Gibson <david@gibson.dropbear.id.au>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Greg Kurz <groug@kaod.org>, David Hildenbrand <david@redhat.com>, Song Gao <gaosong@loongson.cn>, Ilya Leoshkevich <iii@linux.ibm.com>, Max Filippov <jcmvbkbc@gmail.com>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Subject: [PATCH v3 07/24] gdbstub: move fromhex/tohex routines to internals Date: Tue, 21 Feb 2023 22:52:10 +0000 Message-Id: <20230221225227.3735319-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221225227.3735319-1-alex.bennee@linaro.org> References: <20230221225227.3735319-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
gdbstub: re-organise to for better compilation behaviour
|
expand
|
diff --git a/gdbstub/internals.h b/gdbstub/internals.h index de56328a2c..6be05fac9f 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -55,6 +55,33 @@ typedef struct GDBState { int supported_sstep_flags; } GDBState; + +/* + * Inline utility function, convert from int to hex and back + */ + +static inline int fromhex(int v) +{ + if (v >= '0' && v <= '9') { + return v - '0'; + } else if (v >= 'A' && v <= 'F') { + return v - 'A' + 10; + } else if (v >= 'a' && v <= 'f') { + return v - 'a' + 10; + } else { + return 0; + } +} + +static inline int tohex(int v) +{ + if (v < 10) { + return v + '0'; + } else { + return v - 10 + 'a'; + } +} + /* * Break/Watch point support - there is an implementation for softmmu * and user mode. diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c index d8bf90361e..4407706aa3 100644 --- a/gdbstub/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -546,26 +546,6 @@ static void put_buffer(const uint8_t *buf, int len) #endif } -static inline int fromhex(int v) -{ - if (v >= '0' && v <= '9') - return v - '0'; - else if (v >= 'A' && v <= 'F') - return v - 'A' + 10; - else if (v >= 'a' && v <= 'f') - return v - 'a' + 10; - else - return 0; -} - -static inline int tohex(int v) -{ - if (v < 10) - return v + '0'; - else - return v - 10 + 'a'; -} - /* writes 2*len+1 bytes in buf */ static void memtohex(GString *buf, const uint8_t *mem, int len) {