[PATCH 0/5] Disentangle dbxread from other file format readers

Guinevere Larsen blarsen@redhat.com
Tue Sep 17 15:40:13 GMT 2024


This patch series starts the process of disentangling the many file
format readers from one another by making dbxread.c - the one
responsible for reading aout files. dbxread had several function that
were used by elf, coff and mdebug when those files handle stabs debug
information.

Almost all of this series is just code motion from dbxread.c to (mostly)
stabsread.c; it shouldn't be too difficult to review, apart from the
first patch where several global variables were moved to inside the
objfile structure.

This is the first step in my larger goal of being able to selectively
disable support for certain outdated, or otherwise unexpetced, file
formats in an effort to reduce GDB's attack surface.

Guinevere Larsen (5):
  gdb: Make dbxread rely less on global variables
  gdb: Move process_one_symbol to stabsread.c
  gdb: Move dbx_end_psymtab to stabsread, and rename to
    stabs_end_psymtab
  gdb: Move read_dbx_symtab to stabsread, and rename to
    read_stabs_symtab
  gdb: fully separate coff and elf reading from dbx

 gdb/coffread.c   |   93 ++
 gdb/dbxread.c    | 2896 +---------------------------------------------
 gdb/elfread.c    |  129 +++
 gdb/gdb-stabs.h  |   98 ++
 gdb/mdebugread.c |   16 +-
 gdb/stabsread.c  | 2485 +++++++++++++++++++++++++++++++++++++++
 gdb/stabsread.h  |   99 +-
 gdb/symtab.h     |    2 +-
 8 files changed, 2914 insertions(+), 2904 deletions(-)

-- 
2.46.0



More information about the Gdb-patches mailing list