Stabs Errors Compiling Java Classes

Ranjit Mathew rmathew@hotmail.com
Thu Nov 28 02:06:00 GMT 2002


Ranjit Mathew wrote:
> These assembler warnings are caused by lines
> in the generated assembler source file like these:
> ---------------------------- 8< ------------------------
> .stabs "_ZN1TC1Ev:F(0,25)",36,0,65537,__ZN1TC1Ev
> ---------------------------- 8< ------------------------
>> The stabs "value" field in the line above is "65537",
> which seemingly should be less than 65536 and causes
> these warnings.
>> The "value" field is used by GCC to record
> the address of a symbol within the output assembler file.
> The line is emitted by the dbxout_symbol( ) function in
> "gcc/dbxout.c".

Sorry, I was thrown off-track by incorrect documentation
comment in dbxout.c (at the beginning of the file)! :-(
(There're *five*, not four, operands for a stabs symbol entry.)
The five operands for a stabs symbol entry like the one
given above are:
1. key name for symbol-lookup
2. type of symbol (36/0x24 = N_FUN, in the example above - see
 "gcc/stab.def" for other definitions)
3. "other" info (usually set to 0)
4. description - can be any *16-bit, unsigned value*.
 (Used for storing line numbers when using GNU debug
 extensions. Hence a limit of 65535 lines for the
 source code if stabs debug info is to be used.)
5. value of the symbol (e.g. address of the function).
The "description" field is set to zero by the
dbxout_finish_symbol( ) function in "gcc/dbxout.c" if
GNU debug extensions are not enabled, otherwise to
"DECL_SOURCE_LINE (sym)".
I have seen the same bogus values in the description
field on GCJ 3.2 on Solaris as well, so I'm almost
sure that anyone with a new binutils (2.13.x) should
also get the same warning messages.
That's why this looks like some SNAFU in the Java
front-end. Taking a *very wild shot* (which I will
try to verify soon), the method_header( ) function
in "gcc/java/parse.y" should, I guess, be patched
thus:
------------------------ 8< -------------------------
--- parse.y Thu Nov 28 14:41:31 2002
+++ parse.y Thu Nov 28 14:43:15 2002
@@ -4747,4 +4747,6 @@
 if (flag_emit_xref)
 DECL_SOURCE_LINE (meth) = EXPR_WFL_LINECOL (id);
+ else
+ DECL_SOURCE_LINE (meth) = EXPR_WFL_LINENO (id);
 return meth;
------------------------ 8< -------------------------
Per/Andrew - comments?
Sincerely Yours,
Ranjit.
-- 
Ranjit Mathew Email: rmathew AT hotmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /