From patchwork Tue Oct 4 13:01:26 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: 612250 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp187428pvb; Tue, 4 Oct 2022 06:52:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7s4/rLIzNJXlVV6IuyHdXzkX01Hot9fmweKh7KBVCu/B/nD7FY1/SF0nGzjiphZicPaabJ X-Received: by 2002:a05:6214:2b0f:b0:4af:b379:256 with SMTP id jx15-20020a0562142b0f00b004afb3790256mr17735887qvb.117.1664891541390; Tue, 04 Oct 2022 06:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664891541; cv=none; d=google.com; s=arc-20160816; b=VeTd8qk5yzFQ9xJIN1gHreru1RV1Rg9dPDZflKcJr/KReDXIdhVDGxGAV4xkYbQ3Kb fwEAXQ/OCCKNjOt5tqXAfYoA02P//v0vMRqx65eHfnvmeKv178VvI/Lfzr0P3lrQaVdB ndO0Jtmqro6TsN8q9UQXhLhgBEgXhLsouVasL1JBg71LXUaA55mOTAfgwq7h52FF4Uqu dKjqxKLMG71LnWuNSImyOgrjbyNRuvxWWw2yfcJakDYNGlDU10ldWVDBkazP9JWT06Bd EdmaGG6m2UGIX49jGIYy23SwyHiW+zhVGFfQP7paRqyaF/PcSSlovGQpMwht7khQB9Ou ALHA== 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=IiROcdgqykUU3sm/aV8gw0RCaDZ8buQu6BrAfYeGbsk=; b=OuWXebWvvjV7OVe2NxtPR9kRiWqJfDFZcA5HFfSeZacPF+sIHACt8sVWdq5o26z6hR sOn/7YfyTSvfIE0UXBFQbNTReIMlbNPjaVqaGir8V98D7u0XRCaBGoTdoKbkCR4zlu34 cOSnkUpKgVZDBIwvW2KzmhauHLppnp4+LX1xQ8kUSV0/tKbix3hPQLegytaEXumTk/ov EBgazRFhLs+NvK+sV9YBU/gqGXh8npcGCC0cb1boZbtCDidwG00VuxEbBRR3tTm8S+f5 8SQkUCBwdeoFPbJ5aMjTcXzIhgGFnTBFcw7RuKfSXGx2eJWqcl0AMMU12l2JeRWgswGP fFUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RiA8jllb; 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 s202-20020a3745d3000000b006ce718a5cfasi4811830qka.721.2022.10.04.06.52.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 04 Oct 2022 06:52:21 -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=RiA8jllb; 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]:39478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofiLM-0008Vx-K6 for patch@linaro.org; Tue, 04 Oct 2022 09:52:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofhgU-0007iY-UM for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:10:07 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:46987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofhgS-0000B6-OD for qemu-devel@nongnu.org; Tue, 04 Oct 2022 09:10:06 -0400 Received: by mail-wr1-x430.google.com with SMTP id bk15so21238181wrb.13 for ; Tue, 04 Oct 2022 06:10:04 -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=IiROcdgqykUU3sm/aV8gw0RCaDZ8buQu6BrAfYeGbsk=; b=RiA8jllboB5tecWk9tBvjWpZE+uVEdSc0XJdpzFIKOWCc3lS6lDaxeQOy6uPsYyieG 5tEyqHCci7umC0KcKC/UIbHlRrpLkqA+AtKYzVkYR+I7W11pBbcR+lpDMlfgUNuaBnus 942yg+Oca1MEP+aeE4595MqpTB9cbyBRGzR8lQ1tqXFcq2/gtsCrwJh3AK4ncjsFcNZh XbZy3N/rmKsJSSph9m++DRIb+Z2rA6ZqmNREHlZIXNbvNNvMIv9Yr01ic5vImwmsGpmW /GsHYfqUAITKqaGAYhMaQkbBCpKk/zXiExjZy0660O+hwiwO7lxrUWu8+rBo19kC3qTp YgvQ== 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=IiROcdgqykUU3sm/aV8gw0RCaDZ8buQu6BrAfYeGbsk=; b=kv209SI7FIVmiRQMxFC9o9CiMwQXb0S4pRWNfarSTNvM6I76RrxeG1JZB/3+r5JuXJ F6Zz0wkxJ0oL9DBm7cK1fPJQ10ivmSQ98C/aX4E2QlLUibbSxACqatMc+xn5zKNWldjX fxMhsIf4ixOjuWI+EjG1/CqJgUQLIs7uZ1jaiR2cuwf7JR1WtkrdZQiFuKGmkwpp+vEu cJ0oWrZbM5rWJmX2ElJhEJ7fv98MfJXeLh7Wtdc71+geB+Wzb54HOMJYuzYDbHQROmXW eb0xnjyGiMIUulNdoLmFzBvQ/NnVNHxiJsNXmD2E2k4yd4nhlJ+o2yw358gh1nPQ+4Sg iB3w== X-Gm-Message-State: ACrzQf34IcCUkZpDXSAdnVPAS+iu/CIke4iKHpKIcvNfKGMQLt15yicx lNhvxOOL6KQ5MvhqPrZgrcSAJNYOxNMTOQ== X-Received: by 2002:a05:6000:18c7:b0:22e:5503:9c46 with SMTP id w7-20020a05600018c700b0022e55039c46mr1344062wrq.668.1664889002881; Tue, 04 Oct 2022 06:10:02 -0700 (PDT) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id ay26-20020a05600c1e1a00b003b4868eb6bbsm19282333wmb.23.2022.10.04.06.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 06:10:00 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0B38A1FFDD; Tue, 4 Oct 2022 14:01:43 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: stefanha@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PULL 42/54] gdbstub: move into its own sub directory Date: Tue, 4 Oct 2022 14:01:26 +0100 Message-Id: <20221004130138.2299307-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221004130138.2299307-1-alex.bennee@linaro.org> References: <20221004130138.2299307-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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. Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20220929114231.583801-43-alex.bennee@linaro.org> diff --git a/meson.build b/meson.build index ac5ef05c21..73646558db 100644 --- a/meson.build +++ b/meson.build @@ -2837,6 +2837,7 @@ trace_events_subdirs = [ 'qom', 'monitor', 'util', + 'gdbstub', ] if have_linux_user trace_events_subdirs += [ 'linux-user' ] @@ -2960,6 +2961,7 @@ subdir('authz') subdir('crypto') subdir('ui') subdir('hw') +subdir('gdbstub') if enable_modules @@ -3037,7 +3039,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 789172b2a8..e1530b51a2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2677,7 +2677,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)"