Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Tom Tromey <tromey@redhat.com>,
	       gdb-patches ml <gdb-patches@sourceware.org>,
	       Doug Evans <dje@google.com>
Subject: Re: [patch] Re: Advice on fixing gdb/12528
Date: Wed, 16 Mar 2011 08:20:00 -0000	[thread overview]
Message-ID: <20110316060658.GA10163@host1.jankratochvil.net> (raw)
In-Reply-To: <AANLkTik7JYPdOTgyGnQ4aLT_0BZf+1hCBVZnKc+tweZC@mail.gmail.com>

On Tue, 15 Mar 2011 22:45:02 +0100, Paul Pluzhnikov wrote:
> On Tue, Mar 15, 2011 at 2:24 PM, Jan Kratochvil <jan.kratochvil@redhat.com> wrote:
> >                      complaint (&symfile_complaints,
> >                                 _(".debug_line offset 0x%lx uses address 0 "
> >                                   "[in module %s]"),
> >                                 (long) (line_ptr
> >                                         - dwarf2_per_objfile->line.buffer),
> >                                 cu->objfile->name);
> >
> > (the offset is not right but better than nothing)
> 
> Maybe like this:
> 
> 		  if (address == 0 && !dwarf2_per_objfile->has_section_at_zero)
> 		    {
> 		      /* This line table is for a function which has been
> 			 GCd by the linker.  Ignore it.  PR gdb/12528 */
> 
> 		      long line_offset
> 			= line_ptr - bytes_read - dwarf2_per_objfile->line.buffer;
> 
> 		      complaint (&symfile_complaints,
> 				 _(".debug_line offset 0x%lx uses address 0 "
> 				   "[in module %s]"),
> 				 line_offset, cu->objfile->name);
> 		      p_record_line = noop_record_line;
> 		    }

BYTES_READ is here just for the ADDRESS size.  One can also subtract 1 for
EXTENDED_OP read in, subtract already overwritten BYTES_READ for EXTENDED_LEN
read in and subtract 1 for OP_CODE read in.  This way we get the offset where
this operation starts.

But neither binutils nor elfutils readelf display offsets of the .debug_line
operations so one cannot debug the resulting offset so much which is why
I thought some approx. offset is good enough.

I do not think the displayed offset is so importatnt but at least the module
gets shown.


Thanks,
Jan


  reply	other threads:[~2011-03-16  6:07 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-11 17:09 Paul Pluzhnikov
2011-03-11 18:27 ` Tom Tromey
2011-03-14 21:16   ` [patch] " Paul Pluzhnikov
2011-03-15  3:16     ` Jan Kratochvil
2011-03-15  5:26       ` Paul Pluzhnikov
2011-03-15 15:35         ` Tom Tromey
2011-03-15 15:45           ` Jan Kratochvil
2011-03-15 16:00             ` Paul Pluzhnikov
2011-03-15 18:50         ` Jan Kratochvil
2011-03-15 19:12           ` Paul Pluzhnikov
2011-03-15 19:18             ` Jan Kratochvil
2011-03-15 19:41               ` Paul Pluzhnikov
2011-03-15 23:26                 ` Jan Kratochvil
2011-03-16  0:13                   ` Paul Pluzhnikov
2011-03-16  8:20                     ` Jan Kratochvil [this message]
2011-03-16 17:43                       ` Paul Pluzhnikov
2011-03-16 17:52                         ` 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=20110316060658.GA10163@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.com \
    --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