Message ID | 20230302190846.2593720-9-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 m6csp64679wrb; Thu, 2 Mar 2023 11:09:58 -0800 (PST) X-Google-Smtp-Source: AK7set91sfNdGg7SjCtf8+DAoyPr051WNBjvG0EaDlNgBcYJrOZOFkZg74/Xbs5moCr95KTnyXyH X-Received: by 2002:a05:622a:5cf:b0:3bf:d5e4:308c with SMTP id d15-20020a05622a05cf00b003bfd5e4308cmr19641359qtb.46.1677784198652; Thu, 02 Mar 2023 11:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677784198; cv=none; d=google.com; s=arc-20160816; b=MNWLYgcOFI39hu50rJgm+l34T53dlJuNZc6Q7L/WvVCCOOeS0gkIkRNRQiVajxYIi4 91//pGrrn2un8fip0Ji4vaKzrYrIoDfOafOLOaSLB2pfFBJlsVrXDjzV7JcAw1bkaJwZ KbSnkeMEUrQ4YU/WLQG95mIA1hzGf2wXmFuLmY+k2AgPZYoI0+s6yjuLjXMi1lOML0A+ FcoQHgXthz29fHnJrYKyCuw+FJwCd2hPbHsZEQlPHkZ0Gz6CxfDE5/oMl0sK4fWk72w8 26ZmpwkD028mAAvRjPaTWwDNsDWOtJrCe54U8bo99Dv7fr5IF0yFloh0a1uVe0X+n8S5 oK4g== 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=zhv1r+37cIdO73Hx2ePtuQOU7s/kw+X5fYnQSMO6fRk=; b=gVULV534K4iVA1eM5JtcsbQk566qbPWu0PlOLI8QFmpRuvC8cRa0NvBUIn8Yjdlm/j Ynd2R5/JdvafkJZsATcPNkdL5aRg7gtX8kYAedqdMpO3Zdu9Wa56ZPZBQtnfCHX5tLKV s9b/A++r8Oggguh+uKATi50PdD+1S2P40XLuwnSwKyZxDp0mvISszJPMi3kCoLGWb8qf A9YmlJNEOdBuSwlJmqLpPBVK0XlrZC5f5iSXqbFYBIoFJP/H6T7KolIIRHluO4BzdYq0 p6C+2w2wFkKjT+nZ3Jd9mgZqqE48APlGXL/6tIvz8dQ9cNqfj3bTnAouflfQAZ8OwVXC Dj3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fv7CdPJT; 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 m1-20020ac85b01000000b003b68aef3869si201978qtw.663.2023.03.02.11.09.58 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Mar 2023 11:09:58 -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=fv7CdPJT; 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 1pXoIb-0007Un-MT; Thu, 02 Mar 2023 14:09:05 -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 1pXoIZ-0007Rz-Vm for qemu-devel@nongnu.org; Thu, 02 Mar 2023 14:09:04 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) 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 1pXoIO-0004X5-Du for qemu-devel@nongnu.org; Thu, 02 Mar 2023 14:09:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id l25so148509wrb.3 for <qemu-devel@nongnu.org>; Thu, 02 Mar 2023 11:08:52 -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=zhv1r+37cIdO73Hx2ePtuQOU7s/kw+X5fYnQSMO6fRk=; b=fv7CdPJTK9CJaeTbeeSsek2LKFF9kpjrFZaRix6juRaohfp3SLvfs3Ggy602Up+h22 rM2xGkf/oXZa4xPJz1dMsS/9nSu4BO2fUaLutGMQQZBJacAaysZ9yjQaij8vg+rbctxQ Q5MnIaXHSg9UzOK0B53f4LSbOxoFhEJqE/JrC9ChRXQiO2ZQZ+9DU+Xq0CMEbWfA2HBB Kxe50BtD8Df5BZeNZ2RrVKItDRm/fhDLrIk6vt0R20H34+d4SvBadDANJHcqLzxkCqCV kc70xW8lcrMlG6QToYS7BYHHbJOq+m1tQBnEwCkuHs+ArsDP3CmduWv/bJKuT+1ibyy2 VQXg== 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=zhv1r+37cIdO73Hx2ePtuQOU7s/kw+X5fYnQSMO6fRk=; b=Pu9gHPLmSlLcA0/pxf657aZ2jFtyXrEUzhXbX05Ns2ljqBM4IMVOycZqOvm+OzLn1I /qqrqu72Cl8uGr9qWRH3Jd+6PEODDKNCvNbaNYMPI1UOEiar2dkoF2IBIGj/UMbXwSOi nC/+tcHlbFcd6R7hZn0nvWVNaI277lqW1s4g+jEgJUYcsTAPjLSI41eG48Fg0vaEWi3Y kKITxOk+HM6T20qPMkgbG+I+KIPB7zOPa4TZjLATJAHAyjcfNeOnoEr20INrvMFPR+D0 5xvPLhgosEfORzsnZw+e9Nk75jCOIJIwRJl9WQHrsHXFI7wqaDyPL+epsDy3ydxbsEi8 gnAQ== X-Gm-Message-State: AO0yUKVy522BrH9D0y2Z+eXe7ivOzXzHfB0fEEfXthgLeYtHXNtajvsx 1AbA6AjdoK/7niHGfbI0HxT8fQ== X-Received: by 2002:a5d:604b:0:b0:2c7:faf:af32 with SMTP id j11-20020a5d604b000000b002c70fafaf32mr7953987wrt.14.1677784131052; Thu, 02 Mar 2023 11:08:51 -0800 (PST) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r4-20020a5d4944000000b002c56013c07fsm114369wrs.109.2023.03.02.11.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 11:08:48 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 941401FFB7; Thu, 2 Mar 2023 19:08:47 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: qemu-devel@nongnu.org Cc: Weiwei Li <liweiwei@iscas.ac.cn>, =?utf-8?q?C=C3=A9dric_Le_Goater?= <clg@kaod.org>, Palmer Dabbelt <palmer@dabbelt.com>, Laurent Vivier <laurent@vivier.eu>, nicolas.eder@lauterbach.com, Ilya Leoshkevich <iii@linux.ibm.com>, kvm@vger.kernel.org, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Max Filippov <jcmvbkbc@gmail.com>, Sunil Muthuswamy <sunilmut@microsoft.com>, qemu-s390x@nongnu.org, Stafford Horne <shorne@gmail.com>, Bin Meng <bin.meng@windriver.com>, Marek Vasut <marex@denx.de>, Greg Kurz <groug@kaod.org>, Song Gao <gaosong@loongson.cn>, Aleksandar Rikalo <aleksandar.rikalo@syrmia.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Alistair Francis <alistair.francis@wdc.com>, Chris Wulff <crwulff@gmail.com>, qemu-riscv@nongnu.org, Michael Rolnik <mrolnik@gmail.com>, qemu-arm@nongnu.org, Cleber Rosa <crosa@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Eduardo Habkost <eduardo@habkost.net>, Yoshinori Sato <ysato@users.sourceforge.jp>, Alexandre Iooss <erdnaxe@crans.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= <philmd@linaro.org>, mads@ynddal.dk, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, qemu-ppc@nongnu.org, Richard Henderson <richard.henderson@linaro.org>, John Snow <jsnow@redhat.com>, Xiaojuan Yang <yangxiaojuan@loongson.cn>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Mahmoud Mandour <ma.mandourr@gmail.com>, Aurelien Jarno <aurelien@aurel32.net>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Yanan Wang <wangyanan55@huawei.com>, David Hildenbrand <david@redhat.com>, Taylor Simpson <tsimpson@quicinc.com>, Peter Maydell <peter.maydell@linaro.org>, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> Subject: [PATCH v4 08/26] gdbstub: move fromhex/tohex routines to internals Date: Thu, 2 Mar 2023 19:08:28 +0000 Message-Id: <20230302190846.2593720-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230302190846.2593720-1-alex.bennee@linaro.org> References: <20230302190846.2593720-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::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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/next: re-organise and split build
|
expand
|
diff --git a/gdbstub/internals.h b/gdbstub/internals.h index 32daaf73a3..b4620f99c4 100644 --- a/gdbstub/internals.h +++ b/gdbstub/internals.h @@ -57,6 +57,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 abb1777e73..ba46ed73b3 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) {