Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Jan Kratochvil <lace@jankratochvil.net>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] Fix gdb crash on some missing ELF debug info
Date: Wed, 12 Jul 2006 21:15:00 -0000	[thread overview]
Message-ID: <20060712211533.GU24622@nevyn.them.org> (raw)
In-Reply-To: <20060623130732.GA28950@host0.dyn.jankratochvil.net>

On Fri, Jun 23, 2006 at 03:07:32PM +0200, Jan Kratochvil wrote:
> 2006-06-23  Jan Kratochvil  <lace@jankratochvil.net>
> 
> 	* dwarf2read.c (dwarf2_symbol_mark_computed): Fixed later crash
> 	on location list reference if the ".debug_loc" section is missing.

I've committed this very similar patch (clearer comment).  Thanks!

-- 
Daniel Jacobowitz
CodeSourcery

2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>

	* dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted
	or missing location list information.  Suggested by Jan
	Kratochvil <lace@jankratochvil.net>.

Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.199
diff -u -p -r1.199 dwarf2read.c
--- dwarf2read.c	14 Jun 2006 15:06:35 -0000	1.199
+++ dwarf2read.c	12 Jul 2006 21:13:13 -0000
@@ -9324,7 +9324,11 @@ static void
 dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
 			     struct dwarf2_cu *cu)
 {
-  if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+  if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8)
+      /* ".debug_loc" may not exist at all, or the offset may be outside
+	 the section.  If so, fall through to the complaint in the
+	 other branch.  */
+      && DW_UNSND (attr) < dwarf2_per_objfile->loc_size)
     {
       struct dwarf2_loclist_baton *baton;
 


  parent reply	other threads:[~2006-07-12 21:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-23 10:37 Jan Kratochvil
2006-06-23 12:39 ` Daniel Jacobowitz
2006-06-23 13:08   ` Jan Kratochvil
2006-06-23 13:13     ` Daniel Jacobowitz
2006-07-12 21:15     ` Daniel Jacobowitz [this message]
2006-07-20 16:17       ` Joel Brobecker
2006-08-28 20:48       ` [patch] Testcase for missing ELF debug info [Re: [patch] Fix gdb crash on some missing ELF debug info] 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=20060712211533.GU24622@nevyn.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=lace@jankratochvil.net \
    /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