2 Commits

Author SHA1 Message Date
Simon Marchi
876c853cb9 gdbsupport: add missing include guard to remote-args.h
Also, fix a type in "namespace".

Change-Id: I3e5d1d49c765a035217437c0635b12dc28e41bf6
2025-04-24 15:36:23 -04:00
Andrew Burgess
bd036f034b gdb: move remote arg splitting and joining into gdbsupport/
This is a refactoring commit.  When passing inferior arguments to
gdbserver we have two actions that need to be performed, splitting and
joining.

On the GDB side, we take the inferior arguments, a single string, and
split the string into a list of individual arguments.  These are then
sent to gdbserver over the remote protocol.

On the gdbserver side we receive the list of individual arguments and
join these back together into a single inferior argument string.

In the next commit I plan to add some unit testing for this remote
argument passing process.  Ideally, for unit testing, we need the code
being tested to be located in some easily callable function, rather
than being inline at the site of use.

So in this commit I propose to move the splitting and joining logic
out into a separate file, we can then use this within GDB and
gdbserver when passing arguments between GDB and gdbserver, but we can
also call the same functions for some unit testing.

In this commit I'm not adding the unit tests, they will be added next,
so for now there should be no user visible changes after this commit.

Tested-By: Guinevere Larsen <guinevere@redhat.com>
2025-04-24 16:45:51 +01:00