From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Paul Pluzhnikov <ppluzhnikov@google.com>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch] Fix for PR gdb/12573
Date: Fri, 18 Mar 2011 18:28:00 -0000 [thread overview]
Message-ID: <20110318171246.GA13366@host1.jankratochvil.net> (raw)
In-Reply-To: <AANLkTikd4z=B3VeU1f_gqXxKOL9VLAdv7Ba5HQtu5uZ4@mail.gmail.com>
On Fri, 18 Mar 2011 18:01:50 +0100, Paul Pluzhnikov wrote:
> On Fri, Mar 18, 2011 at 9:29 AM, Tom Tromey <tromey@redhat.com> wrote:
> >>>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
> >
> > Paul> Attached patch fixes http://sourceware.org/bugzilla/show_bug.cgi?id=12573
> > Paul> by removing (I believe incorrect) assertion.
> >
> > See also:
> >
> > https://bugzilla.redhat.com/show_bug.cgi?id=612253
> >
> > And Jan's patch:
> >
> > http://sourceware.org/ml/gdb-patches/2010-07/msg00533.html
> >
> > I can't say I fully understand Jan's.
>
> The patch looks good to me (and I *think* I understand it).
I have to review it again but for example it would hide another bug but I do
not have a fix for it, it should be pretty straightforward if anyone would
like to write it:
https://bugzilla.redhat.com/show_bug.cgi?id=612253#c6
One of the problems is that GDB tries to skip prologue even for -O2 -g code.
There is no such reason as with -O2 -g the debug info is correct for each
instructions. With -O0 -g there are frame-related absolute addresses of
autovariables which is the reason GDB needs to skip the prologue to have valid
location of such -O0 -g autovariables.
-O2 -g code can be detected for a Compilation Unit if there is referenced any
location list from that CU (suggested by GCC hackers). In such case skipping
prologues should be disabled.
Compilation Unit @ offset 0x90398e:
<0><903999>: Abbrev Number: 1 (DW_TAG_compile_unit)
<90399f> DW_AT_name : ../../gcc/gcc/tree-into-ssa.c
<9039a3> DW_AT_comp_dir : /user/inria/fsf/160832/bld-2/gcc
<1><91073a>: Abbrev Number: 69 (DW_TAG_subprogram)
<91073b> DW_AT_name : add_new_name_mapping
<2><910751>: Abbrev Number: 75 (DW_TAG_formal_parameter)
<910752> DW_AT_name : new_tree
<910759> DW_AT_type : <0x903ea5>
<91075d> DW_AT_location : 0x59d960 (location list)
^^^^^^^^^^^^^^^
(gdb) break add_new_name_mapping
->
(gdb) p/x original_pc
$1 = 0x85be0bd
085be0b0 <add_new_name_mapping>:
85be0b0: 55 push %ebp
85be0b1: 89 e5 mov %esp,%ebp
85be0b3: 57 push %edi
85be0b4: 56 push %esi
85be0b5: 89 c6 mov %eax,%esi
85be0b7: 53 push %ebx
85be0b8: 89 d3 mov %edx,%ebx
85be0ba: 83 ec 4c sub $0x4c,%esp
85be0bd: 80 3d a0 8c ca 08 00 cmpb $0x0,0x8ca8ca0
^^^^^^^
There are other problems but this is the first step which should make the
problems at least no longer affecting this specific case.
Thanks,
Jan
next prev parent reply other threads:[~2011-03-18 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 6:43 Paul Pluzhnikov
2011-03-18 17:13 ` Tom Tromey
2011-03-18 18:28 ` Paul Pluzhnikov
2011-03-18 18:28 ` Jan Kratochvil [this message]
2011-03-28 17:11 ` [patch] Do not skip prologue for -O2 -g with GCC VTA " Jan Kratochvil
2011-04-11 18:26 ` Paul Pluzhnikov
2011-04-15 20:19 ` obsolete: " 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=20110318171246.GA13366@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.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