diff options
author | Guinevere Larsen <guinevere@redhat.com> | 2025-02-17 16:43:04 -0300 |
---|---|---|
committer | Guinevere Larsen <guinevere@redhat.com> | 2025-02-20 10:44:32 -0300 |
commit | 67c2a95af353239e5771000c08126914349043f4 (patch) | |
tree | ae3daeca835fdaba7592122cea2105d52d8c7edd | |
parent | 46b9f07dfe79d8c6857dbfada485a3b9c0e3ffdb (diff) | |
download | binutils-67c2a95af353239e5771000c08126914349043f4.zip binutils-67c2a95af353239e5771000c08126914349043f4.tar.gz binutils-67c2a95af353239e5771000c08126914349043f4.tar.bz2 |
GDB: add stabs deprecation warning
Now that stabs is deprecated, we should probably warn our users of it
before removing support, so that they have time to react and either make
themselves heard, or fix things on their end so that they can still debug
their applications.
This commit adds a new function that emits a warning whenever GDB does
stabs reading. Since there are several places where stabs is
re-invented, this warning had to be added to many places, but I think I
managed to warn everywhere relevant without duplicating warnings.
Also, the test gdb.stabs/weird.exp explicitly checks for GDB warnings
when reading stabs, so it had to be updated to account for the
deprecation warning. It is done generically, since it will be removed in
the next release anyway.
Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r-- | gdb/coffread.c | 1 | ||||
-rw-r--r-- | gdb/dbxread.c | 1 | ||||
-rw-r--r-- | gdb/mdebugread.c | 5 | ||||
-rw-r--r-- | gdb/stabsread.c | 2 | ||||
-rw-r--r-- | gdb/stabsread.h | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.stabs/weird.exp | 2 | ||||
-rw-r--r-- | gdb/xcoffread.c | 1 |
7 files changed, 16 insertions, 2 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c index abe150d..c470668 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -234,6 +234,7 @@ coffstab_build_psymtabs (struct objfile *objfile, const char *name = bfd_get_filename (sym_bfd); unsigned int stabsize; + stabs_deprecated_warning (); /* Allocate struct to keep track of stab reading. */ dbx_objfile_data_key.emplace (objfile); dbx_symfile_info *key = dbx_objfile_data_key.get (objfile); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 4cd7210..86e59ab 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -110,6 +110,7 @@ dbx_new_init (struct objfile *ignore) { stabsread_new_init (); init_header_files (); + warning (_("The a.out file format is deprecated and will be removed soon.")); } diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index fbfe3a7..d5a0740 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -2671,7 +2671,10 @@ parse_partial_symbols (minimal_symbol_reader &reader, &sh); if (strcmp (debug_info->ss + fh->issBase + sh.iss, stabs_symbol) == 0) - processing_gcc_compilation = 2; + { + processing_gcc_compilation = 2; + stabs_deprecated_warning (); + } } if (processing_gcc_compilation != 0) diff --git a/gdb/stabsread.c b/gdb/stabsread.c index e479820..fcc226e 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -2226,6 +2226,8 @@ read_stabs_symtab (struct objfile *objfile, symfile_add_flags symfile_flags) sym_bfd = objfile->obfd.get (); + stabs_deprecated_warning (); + /* .o and .nlm files are relocatables with text, data and bss segs based at 0. This flag disables special (Solaris stabs-in-elf only) fixups for symbols with a value of 0. */ diff --git a/gdb/stabsread.h b/gdb/stabsread.h index a88b593..273ceaa 100644 --- a/gdb/stabsread.h +++ b/gdb/stabsread.h @@ -305,4 +305,10 @@ struct symloc int file_string_offset; enum language pst_language; }; + +static inline void +stabs_deprecated_warning () +{ + warning (_("Stabs support is deprecated and will be removed soon.")); +} #endif /* GDB_STABSREAD_H */ diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp index 70fffb2..4d1cd42 100644 --- a/gdb/testsuite/gdb.stabs/weird.exp +++ b/gdb/testsuite/gdb.stabs/weird.exp @@ -293,7 +293,7 @@ gdb_expect 60 { send_gdb "y\n" exp_continue } - -re "^Reading symbols from .*$binfile_re\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n$gdb_prompt $" { + -re "^Reading symbols from .*$binfile_re\\.\\.\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)\r\n(\[^\\n\]*\n)?$gdb_prompt $" { pass "weirdx.o read without error" } -re ".*$gdb_prompt $" { diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 639dd5b..2ff9d4a 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2807,6 +2807,7 @@ xcoff_initial_scan (struct objfile *objfile, symfile_add_flags symfile_flags) if (num_symbols > 0) { + stabs_deprecated_warning (); /* Read the string table. */ init_stringtab (abfd, stringtab_offset, objfile); |