aboutsummaryrefslogtreecommitdiff
path: root/gdb/inferior.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-05-18 21:36:42 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-07-23 15:38:54 -0400
commita69e37dc2b1dbb84a1ba924532cbaede648b69e8 (patch)
tree45cc2a1627d12639d6377b2185a0a26844effb53 /gdb/inferior.h
parent5b8bf2e75ed61ff5bc9bb2cb9d4b8ed581ee6f19 (diff)
downloadgdb-a69e37dc2b1dbb84a1ba924532cbaede648b69e8.zip
gdb-a69e37dc2b1dbb84a1ba924532cbaede648b69e8.tar.gz
gdb-a69e37dc2b1dbb84a1ba924532cbaede648b69e8.tar.bz2
gdb: remove inferior::{argc,argv}
There are currently two states that the inferior args can be stored. The main one is the `args` field, where they are stored as a single string. The other one is the `argc`/`argv` fields. This last one is only used for arguments passed in GDB's command line. And the only outcome is that when get_inferior_args is called, `argc`/`argv` are serialized into `args`. So really, `argc`/`argv` is just a staging area before moving the arguments in `args`. Simplify this by only keeping the `args` field. Change set_inferior_args_vector to immediately serialize the arguments into `args`, work that would be done in get_inferior_args later anyway. The only time where this work would be "wasted" is when the user passes some arguments on the command line, but does not end up running the program. But that just seems unlikely. And it's not that much work. Change-Id: Ica0b9859397c095f6530350c8fb3c36905f2044a
Diffstat (limited to 'gdb/inferior.h')
-rw-r--r--gdb/inferior.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 94fbac0..feb3686 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -478,15 +478,6 @@ public:
/* The arguments string to use when running. */
gdb::unique_xmalloc_ptr<char> args;
- /* The size of elements in argv. */
- int argc = 0;
-
- /* The vector version of arguments. If ARGC is nonzero,
- then we must compute ARGS from this (via the target).
- This is always coming from main's argv and therefore
- should never be freed. */
- char **argv = NULL;
-
/* The current working directory that will be used when starting
this inferior. */
gdb::unique_xmalloc_ptr<char> cwd;