public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc-4.5 + gdb dwarf problems
@ 2010-09-30 14:36 Reini Urban
  2010-09-30 15:13 ` Reini Urban
  0 siblings, 1 reply; 2+ messages in thread
From: Reini Urban @ 2010-09-30 14:36 UTC (permalink / raw)
  To: The Cygwin Mailing List

Hi
I think I've found an issue with the new gcc-4.5 with latest gdb.

I only experience these problems in the gdb debugger, when the
sourceline for the function is wrong,
but inspecting the dwarf output, esp the line info via objdump -Wl looks good.
objdump -Sgl also looks good.

objdump: The path of the source files resolves to something wrong in
objdump -Wl.

gdb: If linked with a library as dll  (cygperl.dll in my case) the
arguments are not displayed in the debugger,
if linked to a static .a or .o, the arguments are displayed okay.

E.g. debugging perl linked to the static libperl.a like
gcc-4 -DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -march=pentium4
-mfpmath=sse -mieee-fp -mmmx -msse -msse2 -DDEBUGGING
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/CORE -g3
ccode27_o2.c -o ccode27_o2    -Wl,--enable-auto-import
-Wl,--export-all-symbols -Wl,--stack,8388608
-Wl,--enable-auto-image-base -fstack-protector -L/usr/local/lib
/usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/auto/Win32CORE/Win32CORE.a
/usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/CORE/libperl.a
/usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/CORE/DynaLoader.a
-ldl -lcrypt
=>

objdump -WL -S -gl ccode27_o2.exe|less

CU: /usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/CORE/ccode27_o2.c:
but the /ccode27_o2.c is in ./, the line info is correct here. I can
debug into it fine.
next obj is
CU: /usr/include/sys/gv.c:
File name                            Line number    Starting address
gv.c                                          45            0x406f98

And this is in /usr/lib/perl5/5.13.5/i686-nothreads-debug-cygwin/CORE/
not in /usr/include/sys/

$ gdb ccode27_o2.exe
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin"...
(gdb) run
Starting program: /cygdrive/d/data/urbanr/My
Documents/Perl/B-C-work/ccode27_o2.exe
[New thread 1988.0x116c]
[New thread 1988.0x1358]
ok
Program received signal SIGSEGV, Segmentation fault.
0x0068391b in Perl_pad_undef (cv=0x24a3d60) at pad.c:138
138         PERL_ARGS_ASSERT_PAD_PEG;

If linked to the dll the cv argument is missing.

And the correct src line is pad.c:256, not pad.c:138
 objdump -S -gl ccode27_o2.exe|^egrep -7 ^Perl_pad_undef

00683785 <_Perl_pad_undef>:
Perl_pad_undef():
/usr/src/perl/blead/buildntdebug/pad.c:256
=cut
*/

void
Perl_pad_undef(pTHX_ CV* cv)
{


-- 
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: gcc-4.5 + gdb dwarf problems
  2010-09-30 14:36 gcc-4.5 + gdb dwarf problems Reini Urban
@ 2010-09-30 15:13 ` Reini Urban
  0 siblings, 0 replies; 2+ messages in thread
From: Reini Urban @ 2010-09-30 15:13 UTC (permalink / raw)
  To: The Cygwin Mailing List

2010/9/30 Reini Urban:
> I think I've found an issue with the new gcc-4.5 with latest gdb.

> Program received signal SIGSEGV, Segmentation fault.
> 0x0068391b in Perl_pad_undef (cv=0x24a3d60) at pad.c:138
> 138         PERL_ARGS_ASSERT_PAD_PEG;
>
> If linked to the dll the cv argument is missing.
>
> And the correct src line is pad.c:256, not pad.c:138
>  objdump -S -gl ccode27_o2.exe|^egrep -7 ^Perl_pad_undef

I've crosschecked with mingw gdb-7.1 and the linenumber
looks better there.

Just the arguments for functions inside the dll are also not displayed:

Program received signal SIGSEGV, Segmentation fault.
0x54a4d00b in Perl_pad_undef ()
   from D:\cygwin\usr\local\bin\cygperl5_13_5d-nt@1fdb04e0.dll

vs.
Program received signal SIGSEGV, Segmentation fault.
0x00552f6b in Perl_pad_undef (cv=0x2323d60) at pad.c:290
290                     && *SvPVX_const(namesv) == '&')

-- 
Reini Urban
http://phpwiki.org/           http://murbreak.at/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-30 14:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30 14:36 gcc-4.5 + gdb dwarf problems Reini Urban
2010-09-30 15:13 ` Reini Urban

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).