This is the mail archive of the
mailing list for the GDB project.
[patch] .gdb_index: Ignore higher versions
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Sun, 21 Nov 2010 21:27:02 +0100
- Subject: [patch] .gdb_index: Ignore higher versions
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.
2010-11-21 Jan Kratochvil <email@example.com>
* dwarf2read.c (dwarf2_read_index): Ignore higher .gdb_index versions.
@@ -1941,6 +1941,10 @@ dwarf2_read_index (struct objfile *objfile)
it seems better to just ignore such indices. */
if (version < 3)
+ /* 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;