From patchwork Thu Sep 22 14:58:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 608220 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp437079pvb; Thu, 22 Sep 2022 09:20:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4jFXfXiofi94i06WZjL5y2JkfeFfus39/g7vkU1sqKBUhr7Kg+EeDqVmSIme39TVriUX0M X-Received: by 2002:a05:622a:246:b0:35c:f707:27bb with SMTP id c6-20020a05622a024600b0035cf70727bbmr3427517qtx.225.1663863648857; Thu, 22 Sep 2022 09:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663863648; cv=none; d=google.com; s=arc-20160816; b=si7Xyo04DHYlCazR3OHFwXedBsNzw5Wfk4Y2P1Zt5OH7Ao9aEu2LjVpAf5nxqnOku3 yYRs8oZ3tEvA6TJ8XqRcQ8g4kkyPyfh8f96hE+cGESmfIUfNa1k1Dehb2i+KdtGCR2Dv cggaa7KnBmPyZgaMSXBcBrKNtb24pnpUTSWv6gqy9f4yRNwTscB4ErPkwmlAn7qlx9qV m8Wp/ahgv8rOz3YR++jSnMHQy1ZWmCEVgDDZg3mbvfoRXXe7B7hAG5TEjPVHNiEE77Kk FNYh4QqIBCGnx8PYOKi5wlzv8yN6gMPfedAipXu54B5ifhO61MkUIvdsJv7VbOSbwI1R YvEg== 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=z9o2xyA00hgdatFEtcmjPjjMM0wNvRNVxGVmWKD34T8=; b=kNkbQ7/hatm5hebQ44Y8dwXEMOOgBbrKqMLHKGp+A6LoENqKS1cMDuQk8X6vGyU5pW 9R3tooSVLamQ5SfW/eH0SscNXxWJePUbC8SyxK3hqiKx6mbswnk2TQSZeRNFdzT24NfB 3L9fxkf7gS1xuGda033qTbOixkkrj82HMeyvO1Cx+FxC6q+2Fe1kcj1pwJV2KTc3lxXg jLXMhED05Kk+Qqoo9t2ZIdHW6JH3U4PDlELXG6a83l4W7ITnM15mucjlwPYghfrojIYa eTmHNkIyC9VOfW3VeQODh3BBweVHPBCCv3eIS06cdoFmKxHgmD8I8hgOOYChnuJty8nD d+FQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tYIpNMvE; 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 e17-20020ac80111000000b0035cec3c80absi3044310qtg.223.2022.09.22.09.20.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 09:20:48 -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=tYIpNMvE; 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]:60446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obOwS-00070h-AK for patch@linaro.org; Thu, 22 Sep 2022 12:20:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obNf3-0001Kd-MI for qemu-devel@nongnu.org; Thu, 22 Sep 2022 10:58:45 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:45770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obNex-0000wE-U1 for qemu-devel@nongnu.org; Thu, 22 Sep 2022 10:58:42 -0400 Received: by mail-wr1-x433.google.com with SMTP id n10so15930632wrw.12 for ; Thu, 22 Sep 2022 07:58:39 -0700 (PDT) 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; bh=z9o2xyA00hgdatFEtcmjPjjMM0wNvRNVxGVmWKD34T8=; b=tYIpNMvEPjH8GymyGLT7vp2pAfSalT2BUmseu6X/CHNP5Qj5CCgFTVGWyJ4ftMqieR t+rnE8NiPSwmggLzKwGlq3CFN9Js645Wj8tXPOs675maMKZUxNABZyEdCK568dEETbJz eONJ8lo2HX2czK8ipgWOSf8NfEaynBdYZG8wVhiuY0MPJPEzqta7FYsvaYEDpREvhH1Z kU2Sgyou1aZWvoVc3Q3J9wsGCBq//s5df3AqCrRe+N02B9PtqQtAXI+WqEMyFwLPiQK9 GVXNwPVQAXgoN8CmaqOBBH7wRSQqA0sOX97tNVd3fo4OmXWt4ZWfzhA0RHgaCaR0/hed KwMA== 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; bh=z9o2xyA00hgdatFEtcmjPjjMM0wNvRNVxGVmWKD34T8=; b=sYas17rPlpS7ecFEOf51UflbMHDR4QDHr7oHoO9wP9p8Tk974/4bTtAHqd96ivIITt 9OLjmmRmBOSua/F6rslj9RsavZ1RsB7C4EP01zQVfkzQh7+tfo7Ol+mmrb3LI1F/MTKK BFRP7nsy/1wYAzcOejL8O++wY9JMWYVtypU3JY9mqThmapIWB9WVTf721Cz5AYnicNpR 5Tjnc8b/cU+ZQwQchqQwNcnpx/z/erUq5zc0TReWuE19Gw7ehK3eCbRbuJdD+LsGs+Kh i8oa7sxbBFstBLQTJ9teil0dXNEQN2uKMqtV0lDnKFJIjy1HamvwOiS+IfKWmd2fFML+ 3zaA== X-Gm-Message-State: ACrzQf3/duBRNVoPY1ML9mFpnMPoI/L/DvRmcyHJlVMhlFPyEyzBQUEm ObD4Bvw80ZO+x3t0kiI1PBysYv2vs78PRQ== X-Received: by 2002:a05:6000:124f:b0:228:8713:ced9 with SMTP id j15-20020a056000124f00b002288713ced9mr2401617wrx.198.1663858718263; Thu, 22 Sep 2022 07:58:38 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id m16-20020a5d6250000000b0022ae59d472esm5161211wrv.112.2022.09.22.07.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 07:58:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC0431FFBE; Thu, 22 Sep 2022 15:58:32 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: f4bug@amsat.org, mads@ynddal.dk, =?utf-8?q?Alex_Benn=C3=A9e?= , Stefan Hajnoczi Subject: [PATCH v1 6/9] gdbstub: move into its own sub directory Date: Thu, 22 Sep 2022 15:58:29 +0100 Message-Id: <20220922145832.1934429-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220922145832.1934429-1-alex.bennee@linaro.org> References: <20220922145832.1934429-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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" This is in preparation of future refactoring as well as cleaning up the source tree. Aside from the minor tweaks to meson and trace.h this is pure code motion. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- meson.build | 4 +++- gdbstub/trace.h | 1 + gdbstub.c => gdbstub/gdbstub.c | 2 +- MAINTAINERS | 2 +- gdbstub/meson.build | 1 + gdbstub/trace-events | 29 +++++++++++++++++++++++++++++ trace-events | 28 ---------------------------- 7 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 gdbstub/trace.h rename gdbstub.c => gdbstub/gdbstub.c (99%) create mode 100644 gdbstub/meson.build create mode 100644 gdbstub/trace-events diff --git a/meson.build b/meson.build index 3885fc1076..2c9209c2b8 100644 --- a/meson.build +++ b/meson.build @@ -2914,6 +2914,7 @@ trace_events_subdirs = [ 'qom', 'monitor', 'util', + 'gdbstub', ] if have_linux_user trace_events_subdirs += [ 'linux-user' ] @@ -3037,6 +3038,7 @@ subdir('authz') subdir('crypto') subdir('ui') subdir('hw') +subdir('gdbstub') if enable_modules @@ -3114,7 +3116,7 @@ common_ss.add(files('cpus-common.c')) subdir('softmmu') common_ss.add(capstone) -specific_ss.add(files('cpu.c', 'disas.c', 'gdbstub.c'), capstone) +specific_ss.add(files('cpu.c', 'disas.c'), capstone) # Work around a gcc bug/misfeature wherein constant propagation looks # through an alias: diff --git a/gdbstub/trace.h b/gdbstub/trace.h new file mode 100644 index 0000000000..dee87b1238 --- /dev/null +++ b/gdbstub/trace.h @@ -0,0 +1 @@ +#include "trace/trace-gdbstub.h" diff --git a/gdbstub.c b/gdbstub/gdbstub.c similarity index 99% rename from gdbstub.c rename to gdbstub/gdbstub.c index cf869b10e3..7d8fe475b3 100644 --- a/gdbstub.c +++ b/gdbstub/gdbstub.c @@ -29,7 +29,7 @@ #include "qemu/ctype.h" #include "qemu/cutils.h" #include "qemu/module.h" -#include "trace/trace-root.h" +#include "trace.h" #include "exec/gdbstub.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" diff --git a/MAINTAINERS b/MAINTAINERS index 738c4eb647..82575b2486 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2670,7 +2670,7 @@ GDB stub M: Alex Bennée R: Philippe Mathieu-Daudé S: Maintained -F: gdbstub* +F: gdbstub/* F: include/exec/gdbstub.h F: gdb-xml/ F: tests/tcg/multiarch/gdbstub/ diff --git a/gdbstub/meson.build b/gdbstub/meson.build new file mode 100644 index 0000000000..6d4ae2d03c --- /dev/null +++ b/gdbstub/meson.build @@ -0,0 +1 @@ +specific_ss.add(files('gdbstub.c')) diff --git a/gdbstub/trace-events b/gdbstub/trace-events new file mode 100644 index 0000000000..03f0c303bf --- /dev/null +++ b/gdbstub/trace-events @@ -0,0 +1,29 @@ +# See docs/devel/tracing.rst for syntax documentation. + +# gdbstub.c +gdbstub_op_start(const char *device) "Starting gdbstub using device %s" +gdbstub_op_exiting(uint8_t code) "notifying exit with code=0x%02x" +gdbstub_op_continue(void) "Continuing all CPUs" +gdbstub_op_continue_cpu(int cpu_index) "Continuing CPU %d" +gdbstub_op_stepping(int cpu_index) "Stepping CPU %d" +gdbstub_op_extra_info(const char *info) "Thread extra info: %s" +gdbstub_hit_watchpoint(const char *type, int cpu_gdb_index, uint64_t vaddr) "Watchpoint hit, type=\"%s\" cpu=%d, vaddr=0x%" PRIx64 "" +gdbstub_hit_internal_error(void) "RUN_STATE_INTERNAL_ERROR" +gdbstub_hit_break(void) "RUN_STATE_DEBUG" +gdbstub_hit_paused(void) "RUN_STATE_PAUSED" +gdbstub_hit_shutdown(void) "RUN_STATE_SHUTDOWN" +gdbstub_hit_io_error(void) "RUN_STATE_IO_ERROR" +gdbstub_hit_watchdog(void) "RUN_STATE_WATCHDOG" +gdbstub_hit_unknown(int state) "Unknown run state=0x%x" +gdbstub_io_reply(const char *message) "Sent: %s" +gdbstub_io_binaryreply(size_t ofs, const char *line) "0x%04zx: %s" +gdbstub_io_command(const char *command) "Received: %s" +gdbstub_io_got_ack(void) "Got ACK" +gdbstub_io_got_unexpected(uint8_t ch) "Got 0x%02x when expecting ACK/NACK" +gdbstub_err_got_nack(void) "Got NACK, retransmitting" +gdbstub_err_garbage(uint8_t ch) "received garbage between packets: 0x%02x" +gdbstub_err_overrun(void) "command buffer overrun, dropping command" +gdbstub_err_invalid_repeat(uint8_t ch) "got invalid RLE count: 0x%02x" +gdbstub_err_invalid_rle(void) "got invalid RLE sequence" +gdbstub_err_checksum_invalid(uint8_t ch) "got invalid command checksum digit: 0x%02x" +gdbstub_err_checksum_incorrect(uint8_t expected, uint8_t got) "got command packet with incorrect checksum, expected=0x%02x, received=0x%02x" diff --git a/trace-events b/trace-events index bc71006675..035f3d570d 100644 --- a/trace-events +++ b/trace-events @@ -46,34 +46,6 @@ ram_block_discard_range(const char *rbname, void *hva, size_t length, bool need_ memory_notdirty_write_access(uint64_t vaddr, uint64_t ram_addr, unsigned size) "0x%" PRIx64 " ram_addr 0x%" PRIx64 " size %u" memory_notdirty_set_dirty(uint64_t vaddr) "0x%" PRIx64 -# gdbstub.c -gdbstub_op_start(const char *device) "Starting gdbstub using device %s" -gdbstub_op_exiting(uint8_t code) "notifying exit with code=0x%02x" -gdbstub_op_continue(void) "Continuing all CPUs" -gdbstub_op_continue_cpu(int cpu_index) "Continuing CPU %d" -gdbstub_op_stepping(int cpu_index) "Stepping CPU %d" -gdbstub_op_extra_info(const char *info) "Thread extra info: %s" -gdbstub_hit_watchpoint(const char *type, int cpu_gdb_index, uint64_t vaddr) "Watchpoint hit, type=\"%s\" cpu=%d, vaddr=0x%" PRIx64 "" -gdbstub_hit_internal_error(void) "RUN_STATE_INTERNAL_ERROR" -gdbstub_hit_break(void) "RUN_STATE_DEBUG" -gdbstub_hit_paused(void) "RUN_STATE_PAUSED" -gdbstub_hit_shutdown(void) "RUN_STATE_SHUTDOWN" -gdbstub_hit_io_error(void) "RUN_STATE_IO_ERROR" -gdbstub_hit_watchdog(void) "RUN_STATE_WATCHDOG" -gdbstub_hit_unknown(int state) "Unknown run state=0x%x" -gdbstub_io_reply(const char *message) "Sent: %s" -gdbstub_io_binaryreply(size_t ofs, const char *line) "0x%04zx: %s" -gdbstub_io_command(const char *command) "Received: %s" -gdbstub_io_got_ack(void) "Got ACK" -gdbstub_io_got_unexpected(uint8_t ch) "Got 0x%02x when expecting ACK/NACK" -gdbstub_err_got_nack(void) "Got NACK, retransmitting" -gdbstub_err_garbage(uint8_t ch) "received garbage between packets: 0x%02x" -gdbstub_err_overrun(void) "command buffer overrun, dropping command" -gdbstub_err_invalid_repeat(uint8_t ch) "got invalid RLE count: 0x%02x" -gdbstub_err_invalid_rle(void) "got invalid RLE sequence" -gdbstub_err_checksum_invalid(uint8_t ch) "got invalid command checksum digit: 0x%02x" -gdbstub_err_checksum_incorrect(uint8_t expected, uint8_t got) "got command packet with incorrect checksum, expected=0x%02x, received=0x%02x" - # job.c job_state_transition(void *job, int ret, const char *legal, const char *s0, const char *s1) "job %p (ret: %d) attempting %s transition (%s-->%s)" job_apply_verb(void *job, const char *state, const char *verb, const char *legal) "job %p in state %s; applying verb %s (%s)"