public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/25258]  New: [4.0 regression/hpux] gcc generates incorrect stabs debug output
@ 2005-12-05  0:02 tausq at debian dot org
  2005-12-06  5:38 ` [Bug debug/25258] " tausq at debian dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: tausq at debian dot org @ 2005-12-05  0:02 UTC (permalink / raw)
  To: gcc-bugs

Programs compiled with gcc-4.x on 32-bit hpux targets cannot be debugged. When
loaded into gdb, the programs behave as if no debugging information is present. 

For example, given:
int foo(int x)
{
        return x;
}

int main(int argc, char **argv)
{
        return foo(argc);
}

Placing a breakpoint on foo gives:

(gdb) b foo
During symbol reading, unknown symbol type 0x2e.
During symbol reading, block end address less than block start address in main
(patched it).
During symbol reading, inner block (0x2960-0x2960) not inside outer block
(0x2920-0x2920).
Breakpoint 1 at 0x292c

The "unknown symbol type" warning is for the new BNSYM stab entry that was
added to gcc but not yet updated in gdb.

this problem seems to only occur on the 32-bit HPUX port. On 64-bit HPUX and
32-bit Linux there does not appear to be any problems with slabs debugging.


-- 
           Summary: [4.0 regression/hpux] gcc generates incorrect stabs
                    debug output
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tausq at debian dot org
 GCC build triplet: hppa2.0w-hp-hpux11.11
  GCC host triplet: hppa2.0w-hp-hpux11.11
GCC target triplet: hppa2.0w-hp-hpux11.11


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug debug/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
@ 2005-12-06  5:38 ` tausq at debian dot org
  2005-12-06  5:47 ` tausq at debian dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tausq at debian dot org @ 2005-12-06  5:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tausq at debian dot org  2005-12-06 05:38 -------
The difference is that gcc-3.x creates:

.proc
.callinfo xxx
.entry
...
.exit
.procend
.space $TEXT$
.nsubspa $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
        .stabs "",100,0,0,L$text_end0000
L$text_end0000:

whereas gcc-4.x creates:

.proc
.callinfo xxx
.entry
...
.exit
.procend
.space $TEXT$
.subspa $CODE$
L$scope0001:
.space $TEXT$
.subspa $CODE$
        .stabs  "",100,0,0,L$etext0000
L$etext0000:

By using subspa, the L$etext0000 label is placed back at the beginning of the
original code section, so it does not properly indicate the end of the
compilation unit.


-- 

tausq at debian dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.0.2
      Known to work|                            |3.3.5
            Summary|[4.0 regression/hpux] gcc   |[4.0 regression/hpux] gcc
                   |generates incorrect stabs   |generates incorrect stabs
                   |debug output                |debug output


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug debug/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
  2005-12-06  5:38 ` [Bug debug/25258] " tausq at debian dot org
@ 2005-12-06  5:47 ` tausq at debian dot org
  2005-12-06 13:28 ` dave at hiauly1 dot hia dot nrc dot ca
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: tausq at debian dot org @ 2005-12-06  5:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tausq at debian dot org  2005-12-06 05:47 -------
I'm guessing this is the patch that introduced this regression:

2004-08-20  Zack Weinberg  <zack@codesourcery.com>
            John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

        * config/pa/pa-protos.h (readonly_data, one_only_readonly_data_section,
        one_only_data_section): Rename to som_readonly_data_section,
        som_one_only_readonly_data_section and som_one_only_data_section.
        * config/pa/pa.c (ONE_ONLY_TEXT_SECTION_ASM_OP,
        NEW_TEXT_SECTION_ASM_OP, DEFAULT_TEXT_SECTION_ASM_OP): Delete
        conditional defines.
        (som_text_section_asm_op): Replace ONE_ONLY_TEXT_SECTION_ASM_OP,
        NEW_TEXT_SECTION_ASM_OP and DEFAULT_TEXT_SECTION_ASM_OP with actual
        string values.
        (pa_select_section): Use renamed section functions.
        * config/pa/pa.h (EXTRA_SECTIONS, EXTRA_SECTION_FUNCTIONS,
        SOM_READONLY_DATA_SECTION_FUNCTION,
        SOM_ONE_ONLY_READONLY_DATA_SECTION_FUNCTION,
        SOM_ONE_ONLY_DATA_SECTION_FUNCTION, FORGET_SECTION_FUNCTION):
        Define here ...
        * config/pa/som.h: ... not here.
        (DEFAULT_TEXT_SECTION_ASM_OP, NEW_TEXT_SECTION_ASM_OP,
        ONE_ONLY_TEXT_SECTION_ASM_OP, READONLY_DATA_ASM_OP,
        ONE_ONLY_READONLY_DATA_SECTION_ASM_OP,
        ONE_ONLY_DATA_SECTION_ASM_OP): Delete.
        (READONLY_DATA_SECTION): Use som_readonly_data_section.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug debug/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
  2005-12-06  5:38 ` [Bug debug/25258] " tausq at debian dot org
  2005-12-06  5:47 ` tausq at debian dot org
@ 2005-12-06 13:28 ` dave at hiauly1 dot hia dot nrc dot ca
  2005-12-07  0:16 ` [Bug target/25258] " danglin at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2005-12-06 13:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dave at hiauly1 dot hia dot nrc dot ca  2005-12-06 13:27 -------
Subject: Re:  [4.0 regression/hpux] gcc generates incorrect stabs debug output

> By using subspa, the L$etext0000 label is placed back at the beginning of the
> original code section, so it does not properly indicate the end of the
> compilation unit.

Ah, thanks very much for tracking this down.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (2 preceding siblings ...)
  2005-12-06 13:28 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2005-12-07  0:16 ` danglin at gcc dot gnu dot org
  2005-12-10 15:45 ` danglin at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-07  0:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from danglin at gcc dot gnu dot org  2005-12-07 00:16 -------
Mine.


-- 

danglin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |danglin at gcc dot gnu dot
                   |dot org                     |org
          Component|debug                       |target
      Known to fail|4.0.2                       |3.4.4 4.0.2 4.1.0 4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (3 preceding siblings ...)
  2005-12-07  0:16 ` [Bug target/25258] " danglin at gcc dot gnu dot org
@ 2005-12-10 15:45 ` danglin at gcc dot gnu dot org
  2005-12-10 16:02 ` danglin at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-10 15:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from danglin at gcc dot gnu dot org  2005-12-10 15:45 -------
Subject: Bug 25258

Author: danglin
Date: Sat Dec 10 15:45:43 2005
New Revision: 108351

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108351
Log:
        PR target/25258
        * pa.c (som_text_section_asm_op): Use .NSUBSPA directive when changing
        to the text subspace to output debugging information.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/config/pa/pa.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (4 preceding siblings ...)
  2005-12-10 15:45 ` danglin at gcc dot gnu dot org
@ 2005-12-10 16:02 ` danglin at gcc dot gnu dot org
  2005-12-10 16:08 ` danglin at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-10 16:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from danglin at gcc dot gnu dot org  2005-12-10 16:02 -------
Subject: Bug 25258

Author: danglin
Date: Sat Dec 10 16:01:56 2005
New Revision: 108352

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108352
Log:
        PR target/25258
        * pa.c (som_text_section_asm_op): Use .NSUBSPA directive when changing
        to the text subspace to output debugging information.


Modified:
    branches/gcc-4_0-branch/gcc/ChangeLog
    branches/gcc-4_0-branch/gcc/config/pa/pa.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (5 preceding siblings ...)
  2005-12-10 16:02 ` danglin at gcc dot gnu dot org
@ 2005-12-10 16:08 ` danglin at gcc dot gnu dot org
  2005-12-12  9:03 ` michael dot haubenwallner at salomon dot at
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-10 16:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from danglin at gcc dot gnu dot org  2005-12-10 16:08 -------
Subject: Bug 25258

Author: danglin
Date: Sat Dec 10 16:08:24 2005
New Revision: 108353

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108353
Log:
        PR target/25258
        * pa.c (som_text_section_asm_op): Use .NSUBSPA directive when changing
        to the text subspace to output debugging information.


Modified:
    branches/gcc-3_4-branch/gcc/ChangeLog
    branches/gcc-3_4-branch/gcc/config/pa/pa.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (6 preceding siblings ...)
  2005-12-10 16:08 ` danglin at gcc dot gnu dot org
@ 2005-12-12  9:03 ` michael dot haubenwallner at salomon dot at
  2005-12-12 17:17 ` danglin at gcc dot gnu dot org
  2005-12-12 17:40 ` danglin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: michael dot haubenwallner at salomon dot at @ 2005-12-12  9:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from michael dot haubenwallner at salomon dot at  2005-12-12 09:03 -------
Strange:
any idea what i've missed to not encounter this problem with gcc-3.4.4 ?

Have built my gcc-3.4.4 with two patches (bug#22213 and bug#19933),
vanilla binutils-2.16.1, but native ld:

$ gcc -v
Reading specs from
/mnt/toolsjunk/snapshot/toolsbox-3.5.1.4rc.20051209/hppa2.0w-hp-hpux11.11/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.4/specs
Configured with:
/mnt/toolsjunk/snapshot/src/sasrvb/toolsbox-3.5.1.4rc.20051209/buildroot/gcc/gcc-3.4.4/configure
--with-gnu-as
--with-as=/tools/snapshot/toolsbox-3.5.1.4rc.20051209/hppa2.0w-hp-hpux11.11/hppa2.0w-hp-hpux11.11/bin/as
--without-gnu-ld --enable-threads=posix
--with-local-prefix=/tools/snapshot/toolsbox-3.5.1.4rc.20051209/hppa2.0w-hp-hpux11.11
--disable-nls
--prefix=/tools/snapshot/toolsbox-3.5.1.4rc.20051209/hppa2.0w-hp-hpux11.11
Thread model: posix
gcc version 3.4.4

$
/tools/snapshot/toolsbox-3.5.1.4rc.20051209/hppa2.0w-hp-hpux11.11/hppa2.0w-hp-hpux11.11/bin/as
--version
GNU assembler 2.16.1
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `hppa2.0w-hp-hpux11.11'.

$ gcc -g xx.c
$ gdb a.out
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "hppa2.0w-hp-hpux11.11"...
(gdb) b foo
Breakpoint 1 at 0x290c: file xx.c, line 3.
(gdb) r
Starting program: /mnt/big/logins/haubi/a.out 

Breakpoint 1, foo (x=1) at xx.c:3
3               return x;
(gdb) 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (7 preceding siblings ...)
  2005-12-12  9:03 ` michael dot haubenwallner at salomon dot at
@ 2005-12-12 17:17 ` danglin at gcc dot gnu dot org
  2005-12-12 17:40 ` danglin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-12 17:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from danglin at gcc dot gnu dot org  2005-12-12 17:17 -------
Subject: Bug 25258

Author: danglin
Date: Mon Dec 12 17:17:51 2005
New Revision: 108420

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108420
Log:
        PR target/25258
        * pa.c (pa_output_function_epilogue): Set cfun->machine->in_nsubspa to
        indicate function epilogue has been output.
        (pa_asm_output_mi_thunk): Likewise.
        (output_deferred_plabels): Put plabels in readonly data section when
        not generating PIC code.
        (som_output_text_section_asm_op): Use .NSUBSPA to output debug
        information.  Add assert.
        (som_output_comdat_data_section_asm_op): New function.
        (pa_som_asm_init_sections): Use som_output_comdat_data_section_asm_op
        instead of output_section_asm_op for COMDAT sections.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/pa/pa.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

* [Bug target/25258] [4.0 regression/hpux] gcc generates incorrect stabs debug output
  2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
                   ` (8 preceding siblings ...)
  2005-12-12 17:17 ` danglin at gcc dot gnu dot org
@ 2005-12-12 17:40 ` danglin at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: danglin at gcc dot gnu dot org @ 2005-12-12 17:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from danglin at gcc dot gnu dot org  2005-12-12 17:40 -------
There are also some assembler issues with repect to this report.  It
would be nice to be able to switch back to the last text subspace created
using .nsubspa.

I'd have to check, but I don't think 2.16.1 supports the COMDAT option
which introduced this problem.  This involved changes to both binutils
and GCC.  In any case, the problem is fixed by the applied GCC patches. 


-- 

danglin at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25258


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

end of thread, other threads:[~2005-12-12 17:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-05  0:02 [Bug debug/25258] New: [4.0 regression/hpux] gcc generates incorrect stabs debug output tausq at debian dot org
2005-12-06  5:38 ` [Bug debug/25258] " tausq at debian dot org
2005-12-06  5:47 ` tausq at debian dot org
2005-12-06 13:28 ` dave at hiauly1 dot hia dot nrc dot ca
2005-12-07  0:16 ` [Bug target/25258] " danglin at gcc dot gnu dot org
2005-12-10 15:45 ` danglin at gcc dot gnu dot org
2005-12-10 16:02 ` danglin at gcc dot gnu dot org
2005-12-10 16:08 ` danglin at gcc dot gnu dot org
2005-12-12  9:03 ` michael dot haubenwallner at salomon dot at
2005-12-12 17:17 ` danglin at gcc dot gnu dot org
2005-12-12 17:40 ` danglin at gcc dot gnu dot org

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).