]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/value.c
gdb: store internalvars in an std::map
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 14 Feb 2023 19:23:27 +0000 (14:23 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Wed, 15 Feb 2023 16:58:24 +0000 (11:58 -0500)
commit11470e70ea0d692db00285422efa474224727487
treed73bbbff01e90fbb19384ff1aa70d50e6faa2888
parentdbca589b8d72316a5884321747b6ab92c6b34dbc
gdb: store internalvars in an std::map

In a test downstream in ROCgdb, we had a test case failing when
GDB_REVERSE_INIT_FUNCTIONS was set.  The test was assuming a particular
order in the output of "show convenience".  And the order changes when
running with GDB_REVERSE_INIT_FUNCTIONS.

I think that a nice way to fix it is to make the output of "show
convenience" sorted, and therefore stable.  Ideally, I think that the
the user-visible behavior of GDB should not change when using
GDB_REVERSE_INIT_FUNCTIONS.  Plus, it makes the output of "show
convenience" look nice, not that it's really important.

Implement this by storing the internal vars in an std::map, which is a
sorted container.

Change-Id: I1fca7e7877cc984a3a3432c7639d45e68d437241
Approved-By: Tom Tromey <tom@tromey.com>
gdb/value.c