[00/19] Convert std::unordered_{set,map} to gdb implementations

Message ID 20250317-replace-std-stuff-v1-0-7ba4ee88e218@tromey.com
Headers
Series Convert std::unordered_{set,map} to gdb implementations |

Message

Tom Tromey March 18, 2025, 2:14 a.m. UTC
  This changes a number of uses of std::unordered_{set,map} to the gdb::
equivalents.

Not every spot is converted.  I only changed the ones that I felt I
could reasonably test; or in one or two cases, I left one alone since
it will be addressed some other way.

I've also got some similar patches to reduce the use of htab_t.  I'll
send that as a separate series sometime later.

Regression tested on x86-64 Fedora 40.

Signed-off-by: Tom Tromey <tom@tromey.com>
---
Tom Tromey (19):
      Use gdb unordered set and map in corelow.c
      Use gdb unordered set in breakpoint.c
      Use gdb unordered map in dictionary.c
      Use gdb unordered map in gdb_bfd.c
      Use gdb unordered set in symtab.c
      Use gdb unordered map in ada-exp.y
      Use gdb unordered map in inferior.h
      Use gdb unordered map in stap-probe.c
      Use gdb unordered map for complaints
      Use gdb unordered map in linux-nat.c
      Use gdb unordered set in linux-procfs.c
      Use gdb unordered set and map in Python layer
      Use gdb unordered map in ravenscar.c
      Use gdb unordered map in target.c
      Use gdb unordered set and map in unit tests
      Use gdb unordered map in xml-tdesc.c
      Use gdb unordered set and map in cp-namespace.c
      Use gdb unordered map in tui-io.c
      Use gdb unordered map in regcache.c

 gdb/ada-exp.y                            |  4 ++--
 gdb/breakpoint.c                         |  3 +--
 gdb/complaints.c                         |  6 +++---
 gdb/complaints.h                         |  4 ++--
 gdb/corelow.c                            | 16 +++++++-------
 gdb/cp-namespace.c                       | 10 +++++----
 gdb/dictionary.c                         | 12 +++++------
 gdb/gdb_bfd.c                            |  4 ++--
 gdb/gdbarch-selftests.c                  |  5 ++---
 gdb/inferior.h                           |  4 ++--
 gdb/linux-tdep.c                         |  4 ++--
 gdb/nat/linux-procfs.c                   | 15 ++-----------
 gdb/python/py-inferior.c                 |  4 ++--
 gdb/python/py-registers.c                |  4 ++--
 gdb/ravenscar-thread.c                   |  4 ++--
 gdb/regcache.c                           |  5 +++--
 gdb/stap-probe.c                         |  4 ++--
 gdb/symtab.c                             |  4 ++--
 gdb/target.c                             |  4 ++--
 gdb/tui/tui-io.c                         | 37 +++++++++++++++++++++++++++-----
 gdb/ui-style.h                           | 18 ++++------------
 gdb/unittests/command-def-selftests.c    |  5 ++---
 gdb/unittests/intrusive_list-selftests.c |  4 ++--
 gdb/xml-tdesc.c                          |  4 ++--
 24 files changed, 95 insertions(+), 89 deletions(-)
---
base-commit: 71f193a5c1cb02dcde6ac160cdab88e9725862bb
change-id: 20250317-replace-std-stuff-f467fbc2194f

Best regards,
  

Comments

Simon Marchi March 18, 2025, 3:27 a.m. UTC | #1
On 2025-03-17 22:14, Tom Tromey wrote:
> This changes a number of uses of std::unordered_{set,map} to the gdb::
> equivalents.
> 
> Not every spot is converted.  I only changed the ones that I felt I
> could reasonably test; or in one or two cases, I left one alone since
> it will be addressed some other way.
> 
> I've also got some similar patches to reduce the use of htab_t.  I'll
> send that as a separate series sometime later.
> 
> Regression tested on x86-64 Fedora 40.
> 
> Signed-off-by: Tom Tromey <tom@tromey.com>

Modulo the minor questions/comments I sent, this LGTM.  Most of it is
1:1 replacement, so it's relatively trivial.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Thanks,

Simon
  
Tom Tromey March 18, 2025, 11:43 a.m. UTC | #2
Simon> Modulo the minor questions/comments I sent, this LGTM.  Most of it is
Simon> 1:1 replacement, so it's relatively trivial.

Simon> Approved-By: Simon Marchi <simon.marchi@efficios.com>

Rather than send a v2 just for the hash change, I'm just going to check
it in, since as you say it's largely trivial.

thanks,
Tom