Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb-patches@sources.redhat.com
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch] Workaround gcc bug 49906
Date: Fri, 28 Oct 2011 21:23:00 -0000	[thread overview]
Message-ID: <4EAB17C4.6030902@qnx.com> (raw)
In-Reply-To: <20111028205157.GA18860@host1.jankratochvil.net>




On 11-10-28 04:51 PM, Jan Kratochvil wrote:
> Hello Aleksandar,
>
> the problem is that for this testcase:
> /*1*/	static int i;
> /*2*/	static void
> /*3*/	f (int q)
> /*4*/	{
> /*5*/	  for (;; i--)
> /*6*/	    if (i++)
> /*7*/	      break;
> /*8*/	}
> /*9*/	int main (void) { f (5); return 0; }
>
> Built with:
> 	gcc -o f2 f2.c -Wall -g -Werror
> 	gcc (GCC) 4.6.3 20111028 (prerelease) -- the version should not matter
> 	x86_64
>
> it has a regression
> 	gdb ./f2 -ex 'b f' -ex r
> FSF GDB HEAD:
> 	Breakpoint 1, f (q=5) at f2.c:6
> 	                   ^
> 	6	    if (i++)
> with your patch:
> 	Breakpoint 1, f (q=0) at f2.c:4
> 	                   ^
> 	4	{
>

I think that if you dump line info for your test you will find that line 
info is broken as well. Correct line info would yield answer "line 5" 
after skipping prologue.

Your result looks slightly better because you did not put {..} for the 
'for' block, but it is not correct.

IMO, with the fix, the result is better (beginning of the function block 
is better IMO than first statement inside 'for' block).


> For reader's convenience attaching objdump at the bottom of this mail.

Could you do

objdump -W

and post the output?



---
Aleksandar


  reply	other threads:[~2011-10-28 21:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25 18:12 Aleksandar Ristovski
2011-10-28 21:00 ` Jan Kratochvil
2011-10-28 21:23   ` Aleksandar Ristovski [this message]
2011-10-28 22:15     ` Jan Kratochvil
2011-10-29  0:10       ` Aleksandar Ristovski
2011-10-29  9:21         ` Jan Kratochvil
2011-10-29  1:31       ` Aleksandar Ristovski

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=4EAB17C4.6030902@qnx.com \
    --to=aristovski@qnx.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jan.kratochvil@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