gdb/gdb-gdbindex-v4-2of3.patch

54 lines
2.2 KiB
Diff

http://sourceware.org/ml/gdb-cvs/2011-01/msg00169.html
### src/gdb/ChangeLog 2011/01/25 17:00:23 1.12503
### src/gdb/ChangeLog 2011/01/25 17:25:10 1.12504
## -1,3 +1,8 @@
+2011-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * dwarf2read.c (dwarf2_read_index, write_psymtabs_to_index)
+ (save_gdb_index_command): Switch to .gdb_index version 4.
+
2011-01-25 Pedro Alves <pedro@codesourcery.com>
* mi/mi-main.c (get_register): Use get_frame_register_value rather
Index: gdb-7.2/gdb/dwarf2read.c
===================================================================
--- gdb-7.2.orig/gdb/dwarf2read.c 2011-01-25 18:56:43.000000000 +0100
+++ gdb-7.2/gdb/dwarf2read.c 2011-01-25 18:57:45.000000000 +0100
@@ -1905,9 +1905,14 @@ dwarf2_read_index (struct objfile *objfi
/* Version check. */
version = MAYBE_SWAP (*(offset_type *) addr);
/* Versions earlier than 3 emitted every copy of a psymbol. This
- causes the index to behave very poorly for certain requests. So,
- it seems better to just ignore such indices. */
- if (version < 3)
+ causes the index to behave very poorly for certain requests. Version 4
+ contained incomplete addrmap. So, it seems better to just ignore such
+ indices. */
+ if (version < 4)
+ return 0;
+ /* Indexes with higher version than the one supported by GDB may be no
+ longer backward compatible. */
+ if (version > 4)
return 0;
map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index);
@@ -15029,7 +15034,7 @@ write_psymtabs_to_index (struct objfile
total_len = size_of_contents;
/* The version number. */
- val = MAYBE_SWAP (3);
+ val = MAYBE_SWAP (4);
obstack_grow (&contents, &val, sizeof (val));
/* The offset of the CU list from the start of the file. */
@@ -15087,7 +15092,7 @@ write_psymtabs_to_index (struct objfile
1. The file header. This is a sequence of values, of offset_type
unless otherwise noted:
- [0] The version number, currently 3. Versions 1 and 2 are
+ [0] The version number, currently 4. Versions 1, 2 and 3 are
obsolete.
[1] The offset, from the start of the file, of the CU list.
[2] The offset, from the start of the file, of the types CU list.