7ea0c33def
gdbstub: introduce gdb_get_max_cpus
...
This is needed for handling vcont packets as the way of calculating
max cpus vhanges between user and softmmu mode.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-17-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-17-richard.henderson@linaro.org >
2023-03-07 20:44:08 +00:00
589a58672e
gdbstub: specialise target_memory_rw_debug
...
The two implementations are different enough to encourage having a
specialisation and we can move some of the softmmu only stuff out of
gdbstub.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-16-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-16-richard.henderson@linaro.org >
2023-03-07 20:44:08 +00:00
8a2025b36b
gdbstub: specialise handle_query_attached
...
In both user and softmmu cases we are just replying with a constant.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-15-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-15-richard.henderson@linaro.org >
2023-03-07 20:44:08 +00:00
a7e0f9bd2a
gdbstub: abstract target specific details from gdb_put_packet_binary
...
We unfortunately handle the checking of packet acknowledgement
differently for user and softmmu modes. Abstract the user mode stuff
behind gdb_got_immediate_ack with a stub for softmmu.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-14-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-14-richard.henderson@linaro.org >
2023-03-07 20:44:08 +00:00
d96bf49ba8
gdbstub: move chunks of user code into own files
...
The process was pretty similar to the softmmu move except we take the
time to split stuff between user.c and user-target.c to avoid as much
target specific compilation as possible. We also start to make use of
our shiny new header scheme so the user-only helpers can be included
without the rest of the exec/gsbstub.h cruft.
As before we split some functions into user and softmmu versions
Reviewed-by: Fabiano Rosas <farosas@suse.de >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-12-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-12-richard.henderson@linaro.org >
2023-03-07 20:44:04 +00:00
b6fa2ec238
gdbstub: move chunk of softmmu functionality to own file
...
This is mostly code motion but a number of things needed to be done
for this minimal patch set:
- move shared structures to internals.h
- splitting some functions into user and softmmu versions
- fixing a few casting issues to keep softmmu common
More CONFIG_USER_ONLY stuff will be handled in a following patches.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Fabiano Rosas <farosas@suse.de >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-11-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-11-richard.henderson@linaro.org >
2023-03-07 17:06:41 +00:00
36e067b2f2
gdbstub: make various helpers visible to the rest of the module
...
We will be needing to use these helpers between the user and softmmu
files so declare them in the headers, add a system prefix and remove
static from the implementations.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-10-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-10-richard.henderson@linaro.org >
2023-03-07 17:06:38 +00:00
1678ea040e
gdbstub: move fromhex/tohex routines to internals
...
These will be needed from multiple places in the code. They are
declared as inline so move to the header and fix up to modern coding
style.
The only other place that messes with hex stuff at the moment is the
URI handling in utils but that would be more code churn so leave for
now.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-9-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-9-richard.henderson@linaro.org >
2023-03-07 17:06:36 +00:00
548c96095d
includes: move tb_flush into its own header
...
This aids subsystems (like gdbstub) that want to trigger a flush
without pulling target specific headers.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-8-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-8-richard.henderson@linaro.org >
2023-03-07 17:06:33 +00:00
9f56787c12
gdbstub: move GDBState to shared internals header
...
We are about to split softmmu and user mode helpers into different
files. To facilitate this we will need to share access to the GDBState
between those files.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-7-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-7-richard.henderson@linaro.org >
2023-03-07 17:06:31 +00:00
8e70c6f947
gdbstub: define separate user/system structures
...
In preparation for moving user/softmmu specific bits from the main
gdbstub file we need to separate the connection details into a
user/softmmu state. As these will eventually be defined in their own
files we move them out of the common GDBState structure.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20230302190846.2593720-6-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-6-richard.henderson@linaro.org >
2023-03-07 17:06:28 +00:00
ad9e4585b3
gdbstub: clean-up indent on gdb_exit
...
Otherwise checkpatch will throw a hissy fit on the later patches that
split this function up.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com >
Message-Id: <20230302190846.2593720-5-alex.bennee@linaro.org >
Message-Id: <20230303025805.625589-5-richard.henderson@linaro.org >
2023-03-07 17:06:26 +00:00
5b5968c477
replay: Extract core API to 'exec/replay-core.h'
...
replay API is used deeply within TCG common code (common to user
and system emulation). Unfortunately "sysemu/replay.h" requires
some QAPI headers for few system-specific declarations, example:
void replay_input_event(QemuConsole *src, InputEvent *evt);
Since commit c2651c0eaa
("qapi/meson: Restrict UI module to system
emulation and tools") the QAPI header defining the InputEvent is
not generated anymore.
To keep it simple, extract the 'core' replay prototypes to a new
"exec/replay-core.h" header which we include in the TCG code that
doesn't need the rest of the replay API.
Reviewed-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru >
Message-Id: <20221219170806.60580-5-philmd@linaro.org >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
2023-02-27 22:29:01 +01:00
55b5b8e928
gdbstub: Use vaddr type for generic insert/remove_breakpoint() API
...
Both insert/remove_breakpoint() handlers are used in system and
user emulation. We can not use the 'hwaddr' type on user emulation,
we have to use 'vaddr' which is defined as "wide enough to contain
any #target_ulong virtual address".
gdbstub.c doesn't require to include "exec/hwaddr.h" anymore.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Fabiano Rosas <farosas@suse.de >
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org >
Message-Id: <20221216215519.5522-4-philmd@linaro.org >
2023-02-27 22:29:01 +01:00
a48e7d9e52
gdbstub: move guest debug support check to ops
...
This removes the final hard coding of kvm_enabled() in gdbstub and
moves the check to an AccelOps.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20220929114231.583801-46-alex.bennee@linaro.org >
2022-10-06 11:53:41 +01:00
ae7467b1ac
gdbstub: move breakpoint logic to accel ops
...
As HW virtualization requires specific support to handle breakpoints
lets push out special casing out of the core gdbstub code and into
AccelOpsClass. This will make it easier to add other accelerator
support and reduces some of the stub shenanigans.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20220929114231.583801-45-alex.bennee@linaro.org >
2022-10-06 11:53:41 +01:00
3b7a93880a
gdbstub: move sstep flags probing into AccelClass
...
The support of single-stepping is very much dependent on support from
the accelerator we are using. To avoid special casing in gdbstub move
the probing out to an AccelClass function so future accelerators can
put their code there.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org >
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Reviewed-by: Mads Ynddal <mads@ynddal.dk >
Message-Id: <20220929114231.583801-44-alex.bennee@linaro.org >
2022-10-06 11:53:41 +01:00
842b42df2b
gdbstub: move into its own sub directory
...
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 <richard.henderson@linaro.org >
Signed-off-by: Alex Bennée <alex.bennee@linaro.org >
Message-Id: <20220929114231.583801-43-alex.bennee@linaro.org >
2022-10-06 11:53:41 +01:00