Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>
Subject: [patch] .gdb_index: Ignore higher versions
Date: Sun, 21 Nov 2010 20:27:00 -0000	[thread overview]
Message-ID: <20101121202702.GA18217@host0.dyn.jankratochvil.net> (raw)

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;


             reply	other threads:[~2010-11-21 20:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-21 20:27 Jan Kratochvil [this message]
2010-11-22 20:29 ` Tom Tromey
2010-11-22 20:35   ` Jan Kratochvil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101121202702.GA18217@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox