]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: add stabs deprecation warning
authorGuinevere Larsen <guinevere@redhat.com>
Mon, 17 Feb 2025 19:43:04 +0000 (16:43 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Thu, 20 Feb 2025 13:44:32 +0000 (10:44 -0300)
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>
gdb/coffread.c
gdb/dbxread.c
gdb/mdebugread.c
gdb/stabsread.c
gdb/stabsread.h
gdb/testsuite/gdb.stabs/weird.exp
gdb/xcoffread.c

index abe150de6093ff45ad27184e240360fb406be403..c470668f6f64aabe1b8c5f2b82d217c8dbbb5722 100644 (file)
@@ -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);
index 4cd721057bc7ad3069ed47ef950791300be7cd77..86e59abaed6e4d36b86b80d2fcfa6738ed83be35 100644 (file)
@@ -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."));
 }
 
 
index fbfe3a70e30d9bbd633cfc3d870b145ac7cd7385..d5a07406ecb0844209916acf3d3ac8427b658513 100644 (file)
@@ -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)
index e4798203fbbe4884a2067e01852393b0bd333633..fcc226ebd1f354ebba0c38778d9b53a4fbca5923 100644 (file)
@@ -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.  */
index a88b593b4436f94e423d2b324c0c11ec44189721..273ceaa753136a64b5fddfb71c54b0a641c37190 100644 (file)
@@ -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 */
index 70fffb2e862740b64e3e41dc01666b377fecea60..4d1cd427fd0c74d44689e1bd75b442d098db9205 100644 (file)
@@ -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 $" {
index 639dd5b8adc16f6c7b8c7dd4b48c7424a888bf4d..2ff9d4a177573f57b52b08495bd8947ed6c5eb4e 100644 (file)
@@ -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);