This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] .gdb_index: Ignore higher versions


Hi,

currently introducing new .gdb_index version (latest is v3, so >=4) breaks all
existing GDBs as they try too interpret the index format the old way.

I have a reproducer here with some other patchset but I find it obvious.

Sending for a comment as we could also introduce some versioning features for
compatible/incompatible extensions.  I do not think it is worth it.


Thanks,
Jan


gdb/
2010-11-21  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* dwarf2read.c (dwarf2_read_index): Ignore higher .gdb_index versions.

--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -1941,6 +1941,10 @@ dwarf2_read_index (struct objfile *objfile)
      it seems better to just ignore such indices.  */
   if (version < 3)
     return 0;
+  /* Indexes with higher version than the one supported by GDB may be no
+     longer backward compatible.  */
+  if (version > 3)
+    return 0;
 
   map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index);
   map->total_size = dwarf2_per_objfile->gdb_index.size;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]