Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] .gdb_index: Ignore higher versions
@ 2010-11-21 20:27 Jan Kratochvil
  2010-11-22 20:29 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kratochvil @ 2010-11-21 20:27 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-11-22 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-21 20:27 [patch] .gdb_index: Ignore higher versions Jan Kratochvil
2010-11-22 20:29 ` Tom Tromey
2010-11-22 20:35   ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox