This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [patch by Michael Matz] Re: archer gdb and gcc 4.1 globalnamespace DIE
On Thu, 14 May 2009, Sami Wagiaalla wrote:
>
> > Pure paranoia that the compiler might not optimize this to the separate
> > instructions (and in that case I would feel the call overhead in this
> > presumably not-too-cold code path to be too large). I have that paranoia
> > even though I'm a compiler engineer. Or maybe because of it :)
>
> Totally understandable. I dont trust debuggers the way I used to :)
>
> > It's probably better to use strcmp anyway, right ;)
>
> Okay I have used strcmp and pulled the patch into my branch:
>
> 1c9be9e4055903bca3fc335189139b67ddb3cdd8
>
> I will will test it with gcc 44 just to be sure. Then I will cherry it to
> archer-jankratochvil-fedora-merge.
>
> Thanks for the patch. Please let us know of bugs you find. I am personally
> interested in these expression evaluation bugs.
One more issue is that with g++ 4.1
#include <stdio.h>
const char foo_c[] = "here is foo_c";
int main()
{
puts(foo_c);
return 0;
}
foo_c at main is printed as
(gdb) p foo_c
$1 = '\0' <repeats 13 times>
(gdb) ptype foo_c
type = char [14]
it works if I remove the puts call. It also works with g++ 4.2 and
newer. I wonder if gdb is confused by g++ 4.1 using DW_AT_const_value
for the string ...
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 - GF: Markus Rex