Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Detect dwarf address size mismatch
Date: Tue, 17 Jul 2007 13:55:00 -0000	[thread overview]
Message-ID: <20070717132109.GA19362@caradoc.them.org> (raw)
In-Reply-To: <200707171301.l6HD146D020081@brahms.sibelius.xs4all.nl>

On Tue, Jul 17, 2007 at 03:01:04PM +0200, Mark Kettenis wrote:
> 
> > @@ -6792,6 +6793,15 @@ dwarf_decode_lines (struct line_header *
> >  			     _("mangled .debug_line section"));
> >  		  return;
> >  		}
> > +	      /* Make sure that we parsed the extended op correctly.  If e.g.
> > +		 we expected a different address size than the producer used,
> > +		 we may have read the wrong number of bytes.  */
> > +	      if (line_ptr != extended_end)
> > +		{
> > +		  complaint (&symfile_complaints,
> > +			     _("mangled .debug_line section"));
> > +		  return;
> > +		}
> >  	      break;
> >  	    case DW_LNS_copy:
> >  	      if (lh->num_file_names < file)
> 
> The complaint "mangled .debug_line section" seems a bit unhelpful to
> me, especially since there are now two identical messages for what
> appears to be somewhat different conditions.  Any chance of changing
> it something more distinguishable?

It was my mistake, not yours, that you didn't notice it before.  It
used to say "bad address size", but Jim suggested I check all extended
ops instead of just DW_LNE_set_address.  So the more specific complaint
is no longer accurate.

How about changing the first one to "unrecognized extended opcode in
.debug_line", and the second one to "mangled extended opcode in
.debug_line"?

I thought about making the unrecognized opcode case more lenient, and
using break instead of return, since we can advance line_ptr the right
amount.  But I think we can't skip unrecognized line opcodes the way
we can skip unrecognized attributes; if the opcode changes the PC,
then the next advance_pc opcode will start from the wrong place, et cetera.

-- 
Daniel Jacobowitz
CodeSourcery


      reply	other threads:[~2007-07-17 13:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11 14:19 Daniel Jacobowitz
2007-07-11 19:23 ` Eli Zaretskii
2007-07-11 19:27 ` Jim Blandy
2007-07-11 19:41   ` Daniel Jacobowitz
2007-07-11 20:30     ` Jim Blandy
2007-07-17 12:52       ` Daniel Jacobowitz
2007-07-17 13:21         ` Mark Kettenis
2007-07-17 13:55           ` Daniel Jacobowitz [this message]

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=20070717132109.GA19362@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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