public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1427: gcj should generate N_MAIN stab
@ 2000-12-20 12:26 tromey
0 siblings, 0 replies; only message in thread
From: tromey @ 2000-12-20 12:26 UTC (permalink / raw)
To: java-gnats
>Number: 1427
>Category: java
>Synopsis: gcj should generate N_MAIN stab
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: apbianco
>State: analyzed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:19:44 PST 2000
>Closed-Date:
>Last-Modified: Thu Apr 27 15:40:00 PDT 2000
>Originator: Tom Tromey
>Release: current cvs
>Organization:
>Environment:
>Description:
gcj should generate an N_MAIN stab which names
the "real" main function. This will let gdb
present this to the user in an intelligent way,
so that users won't see the jvgenmain-generated
main() but will instead start the debug session
in their own code.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gcj/49
State-Changed-From-To: open->analyzed
State-Changed-By: green
State-Changed-When: Sun Mar 5 09:39:50 2000
State-Changed-Why:
I've submitted a patch for the GDB side of things.
http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00527.html
On the gcj side, all we really need to do is hack jvgenmain
to emit:
asm ( ".stabs \"myClass.main\", 0x2a, 0, 0, 0 " );
...at the top of the "main" source file.
We should probably only do this on stabs systems.
We will have to invent a DWARF2 way of doing this. I
don't think DWARF2 has anything like N_MAIN yet.
From: green@cygnus.com
To: apbianco@cygnus.com, java-gnats@sourceware.cygnus.com, jimb@cygnus.com,
tromey@cygnus.com
Cc:
Subject: Re: gcj/49
Date: 5 Mar 2000 17:39:50 -0000
Synopsis: gcj should generate N_MAIN stab
State-Changed-From-To: open->analyzed
State-Changed-By: green
State-Changed-When: Sun Mar 5 09:39:50 2000
State-Changed-Why:
I've submitted a patch for the GDB side of things.
http://sourceware.cygnus.com/ml/gdb-patches/2000-q1/msg00527.html
On the gcj side, all we really need to do is hack jvgenmain
to emit:
asm ( ".stabs \"myClass.main\", 0x2a, 0, 0, 0 " );
...at the top of the "main" source file.
We should probably only do this on stabs systems.
We will have to invent a DWARF2 way of doing this. I
don't think DWARF2 has anything like N_MAIN yet.
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=49&database=java
From: Anthony Green <green@cygnus.com>
To: java-gnats@sourceware.cygnus.com, jimb@cygnus.com, apbianco@cygnus.com,
tromey@cygnus.com
Cc:
Subject: Re: gcj/49
Date: Sun, 23 Apr 2000 09:52:00 -0700
I don't have a full patch for this yet. but this is very close. All
that's missing is a check to see whether or not we should actually
emit it. I think the compiler driver should pass this info down to
jvgenmain. Do any of you understand specs will enough to do this?
Index: gcc/java/jvgenmain.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jvgenmain.c,v
retrieving revision 1.15
diff -c -r1.15 jvgenmain.c
*** jvgenmain.c 2000/01/21 20:57:00 1.15
--- jvgenmain.c 2000/04/23 16:45:03
***************
*** 155,160 ****
--- 155,165 ----
}
fprintf (stream, " 0\n};\n\n");
+ /* Emit the N_MAIN stab. */
+ fprintf (stream, "asm ( \"/* Emit the N_MAIN stab identifying the
program's `main'\n");
+ fprintf (stream, "asm ( \".stabs \\\"%s.main\\\", 0x2a, 0, 0, 0 \"
);\n\n",
+ classname);
+
fprintf (stream, "extern struct Class %s%s;\n",
class_mangling_prefix, mangled_classname);
fprintf (stream, "int main (int argc, const char **argv)\n");
http://sourceware.cygnus.com/cgi-bin/gnatsweb.pl?cmd=view&pr=49&database=java
From: Tom Tromey <tromey@cygnus.com>
To: green@cygnus.com
Cc: java-gnats@sourceware.cygnus.com, jimb@cygnus.com, apbianco@cygnus.com,
tromey@cygnus.com
Subject: Re: gcj/49
Date: Sun, 23 Apr 2000 09:58:31 -0700 (PDT)
Anthony> I don't have a full patch for this yet. but this is very
Anthony> close. All that's missing is a check to see whether or not
Anthony> we should actually emit it. I think the compiler driver
Anthony> should pass this info down to jvgenmain. Do any of you
Anthony> understand specs will enough to do this?
I could figure it out if I knew how to determine whether we need to
emit this. For instance, how do I know when the platform does not
support stabs? And how do I know whether or not it is needed? Do I
just check for -g? (And how are we going to make this work with
Dwarf?)
Tom
From: Anthony Green <green@cygnus.com>
To: tromey@cygnus.com
Cc: java-gnats@sourceware.cygnus.com, jimb@cygnus.com, apbianco@cygnus.com,
tromey@cygnus.com
Subject: Re: gcj/49
Date: Sun, 23 Apr 2000 10:09:14 -0700
Tom wrote:
> I could figure it out if I knew how to determine whether we need to
> emit this.
I think we only want to do it when `write_symbols == DBX_DEBUG' in
toplev.c. This probably doesn't help because we need to know in
gcc.c.
Jim - can gdb handle programs with both DWARF2 and STABS? I think
maybe it can.
In that case, maybe we just always emit it when any `-g' flag appears
on the command line.
> (And how are we going to make this work with Dwarf?)
There's not dwarf way of doing it. I think mixed stabs/dwarf will
work for now.
AG
--
Anthony Green Red Hat
Sunnyvale, California
From: Jim Blandy <jimb@zwingli.cygnus.com>
To: green@cygnus.com
Cc: tromey@cygnus.com, java-gnats@sourceware.cygnus.com, apbianco@cygnus.com
Subject: Re: gcj/49
Date: 27 Apr 2000 17:37:21 -0500
> Jim - can gdb handle programs with both DWARF2 and STABS? I think
> maybe it can.
Yes, it can.
> In that case, maybe we just always emit it when any `-g' flag appears
> on the command line.
Hmm. Can every assembler handle the .stab pseudo-ops?
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-12-20 12:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:26 java/1427: gcj should generate N_MAIN stab tromey
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).