aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-01 23:04:01 -0400
committerMike Frysinger <vapier@gentoo.org>2021-05-01 23:06:54 -0400
commite4821e2f5fd281eb6b88b642fa9beaf9c3a35070 (patch)
tree6712b6adcbdad468b86475eee0fe315440b57fbc /sim
parent328e805b5a7d4f27552a1062e25a89477bd89009 (diff)
downloadgdb-e4821e2f5fd281eb6b88b642fa9beaf9c3a35070.zip
gdb-e4821e2f5fd281eb6b88b642fa9beaf9c3a35070.tar.gz
gdb-e4821e2f5fd281eb6b88b642fa9beaf9c3a35070.tar.bz2
sim: options: fix --help output
The hash table rewrite broke --help output due to subtle behavior: calling dup_arg_p(NULL) will create & clear the table, not just create it. The --help output relies on this to clear the table before it shows things.
Diffstat (limited to 'sim')
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/sim-options.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 55d684b..7abaeb3 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,9 @@
2021-05-01 Mike Frysinger <vapier@gentoo.org>
+ * sim-options.c (dup_arg_p): Call htab_empty.
+
+2021-05-01 Mike Frysinger <vapier@gentoo.org>
+
* dv-sockser.c (dv_sockser_install): Rename to ...
(sim_install_dv_sockser): ... this.
* dv-sockser.h (dv_sockser_install): Delete.
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index a6da8ec..1522cac 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -437,6 +437,7 @@ dup_arg_p (const char *arg)
arg_table = htab_create_alloc (10, htab_hash_string,
compare_strings, NULL,
xcalloc, free);
+ htab_empty (arg_table);
return 0;
}