public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/26330]  New: gcc generates code that does not allow retrieval of struct arguments with debugger
@ 2006-02-17  0:21 tausq at debian dot org
  2006-02-22  3:11 ` [Bug debug/26330] " wilson at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tausq at debian dot org @ 2006-02-17  0:21 UTC (permalink / raw)
  To: gcc-bugs

Given the following code from gdb's funcargs test:

typedef struct s
{
  short s;
  int i;
  long l;
} SVAL;

void recurse (SVAL a, int depth)
{
  a.s = a.i = a.l = --depth;
  if (depth == 0)
    hitbottom ();
  else
    recurse (a, depth);
}

compiled with -g

gcc-4.0 does not emit a dwarf location for the 'a' argument:

$ readelf -wi funcargs
[....]
 <2><1921>: Abbrev Number: 11 (DW_TAG_formal_parameter)
     DW_AT_name        : a
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 612
     DW_AT_type        : <18e0>

in gcc-3.x, you will get one more dwarf attribute:
     DW_AT_location    : 3 byte block: 91 18 6  (DW_OP_fbreg: 24; DW_OP_deref)

The difference is that in gcc 3.x, the first argument is first copied from the
incoming argument register to the stack. In gcc-4.x the generated code does not
do this stack save and uses the incoming register directly (actually it first
copies it to a scratch register).


-- 
           Summary: gcc generates code that does not allow retrieval of
                    struct arguments with debugger
           Product: gcc
           Version: 4.0.3
            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: hppa-unknown-linux
  GCC host triplet: hppa-unknown-linux
GCC target triplet: hppa-unknown-linux


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


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

* [Bug debug/26330] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
@ 2006-02-22  3:11 ` wilson at gcc dot gnu dot org
  2006-03-02 12:37 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: wilson at gcc dot gnu dot org @ 2006-02-22  3:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from wilson at gcc dot gnu dot org  2006-02-22 03:11 -------
This argument is passed by pointer, converted into a DECL_VALUE_EXPR, and the
DECL_VALUE_EXPR DECL_RTL references a virtual register, which prevents us from
emitting debug info for it.

This looks like the same problem as PR 25562, which is already fixed in gcc-4.1
and mainline.  This patch adds virtual register instantiation support for
DECL_VALUE_EXPR.


-- 

wilson at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilson at gcc dot gnu dot
                   |                            |org


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


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

* [Bug debug/26330] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
  2006-02-22  3:11 ` [Bug debug/26330] " wilson at gcc dot gnu dot org
@ 2006-03-02 12:37 ` pinskia at gcc dot gnu dot org
  2006-03-02 14:27 ` randolph at tausq dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-02 12:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-02 12:37 -------
According to known to fail, it fails in 4.1.0 but Jim's comment suggest
otherwise, hmm.


-- 


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


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

* [Bug debug/26330] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
  2006-02-22  3:11 ` [Bug debug/26330] " wilson at gcc dot gnu dot org
  2006-03-02 12:37 ` pinskia at gcc dot gnu dot org
@ 2006-03-02 14:27 ` randolph at tausq dot org
  2006-03-02 14:27 ` [Bug debug/26330] [4.0 only] " pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: randolph at tausq dot org @ 2006-03-02 14:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from randolph at tausq dot org  2006-03-02 14:27 -------
Subject: Re:  gcc generates code that does not allow retrieval
 of struct arguments with debugger

pinskia at gcc dot gnu dot org wrote:
> ------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-02 12:37 -------
> According to known to fail, it fails in 4.1.0 but Jim's comment suggest
> otherwise, hmm.
> 

Yes, with latest gcc-4.1 the problem is gone. Can the relevant patch be 
backported to gcc-4.0?

thanks,
randolph


-- 


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


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

* [Bug debug/26330] [4.0 only] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
                   ` (2 preceding siblings ...)
  2006-03-02 14:27 ` randolph at tausq dot org
@ 2006-03-02 14:27 ` pinskia at gcc dot gnu dot org
  2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
  2007-02-03 16:17 ` [Bug debug/26330] [4.0 regression] " gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-02 14:27 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-debug
      Known to fail|4.0.3 4.1.0                 |4.0.3
            Summary|gcc generates code that does|[4.0 only] gcc generates
                   |not allow retrieval of      |code that does not allow
                   |struct arguments with       |retrieval of struct
                   |debugger                    |arguments with debugger
   Target Milestone|---                         |4.0.3


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


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

* [Bug debug/26330] [4.0 only] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
                   ` (3 preceding siblings ...)
  2006-03-02 14:27 ` [Bug debug/26330] [4.0 only] " pinskia at gcc dot gnu dot org
@ 2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
  2007-02-03 16:17 ` [Bug debug/26330] [4.0 regression] " gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-03-11  3:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.0.3                       |4.0.4


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


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

* [Bug debug/26330] [4.0 regression] gcc generates code that does not allow retrieval of struct arguments with debugger
  2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
                   ` (4 preceding siblings ...)
  2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
@ 2007-02-03 16:17 ` gdr at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 16:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from gdr at gcc dot gnu dot org  2007-02-03 16:17 -------
Won't fix in GCC-4.0.x.  Closing.


-- 

gdr at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-02-03 16:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-17  0:21 [Bug debug/26330] New: gcc generates code that does not allow retrieval of struct arguments with debugger tausq at debian dot org
2006-02-22  3:11 ` [Bug debug/26330] " wilson at gcc dot gnu dot org
2006-03-02 12:37 ` pinskia at gcc dot gnu dot org
2006-03-02 14:27 ` randolph at tausq dot org
2006-03-02 14:27 ` [Bug debug/26330] [4.0 only] " pinskia at gcc dot gnu dot org
2006-03-11  3:20 ` mmitchel at gcc dot gnu dot org
2007-02-03 16:17 ` [Bug debug/26330] [4.0 regression] " gdr 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).