This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
dwarf/dwarf2 support for java
- To: gdb-patches@sourceware.cygnus.com
- Subject: dwarf/dwarf2 support for java
- From: Anthony Green <green@cygnus.com>
- Date: Sat, 5 Jun 1999 13:40:14 -0700
Sat Jun 5 13:04:36 1999 Anthony Green <green@cygnus.com>
* dwarf2read.c (set_cu_language): Recognize dwarf2 java debug
info.
* dwarfread.c (set_cu_language): Recognize dwarf java debug info.
Sat Jun 5 13:04:35 1999 Stu Grossman <grossman@cygnus.com>
* dwarf2read.c (add_partial_symbol): Treat java like c++.
(read_subroutine_type): Ditto.
(new_symbol): Ditto.
Index: gdb/dwarf2read.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dwarf2read.c,v
retrieving revision 1.1.1.2
diff -u -p -u -r1.1.1.2 dwarf2read.c
--- dwarf2read.c 1999/04/26 18:24:03 1.1.1.2
+++ dwarf2read.c 1999/06/05 20:36:23
@@ -1244,9 +1244,11 @@ add_partial_symbol (pdi, objfile)
&objfile->static_psymbols,
0, (CORE_ADDR) 0, cu_language, objfile);
- if (cu_language == language_cplus)
+ if (cu_language == language_cplus
+ || cu_language == language_java)
{
- /* For C++, these implicitly act as typedefs as well. */
+ /* For C++ and Java, these implicitly act as typedefs as
+ well. */
add_psymbol_to_list (pdi->name, strlen (pdi->name),
VAR_NAMESPACE, LOC_TYPEDEF,
&objfile->static_psymbols,
@@ -2827,10 +2829,11 @@ read_subroutine_type (die, objfile)
type = die_type (die, objfile);
ftype = lookup_function_type (type);
- /* All functions in C++ have prototypes. */
+ /* All functions in C++ and Java have prototypes. */
attr = dwarf_attr (die, DW_AT_prototyped);
if ((attr && (DW_UNSND (attr) != 0))
- || cu_language == language_cplus)
+ || cu_language == language_cplus
+ || cu_language == language_java)
TYPE_FLAGS (ftype) |= TYPE_FLAG_PROTOTYPED;
if (die->has_children)
@@ -3730,6 +3733,9 @@ set_cu_language (lang)
case DW_LANG_Mips_Assembler:
cu_language = language_asm;
break;
+ case DW_LANG_Java:
+ cu_language = language_java;
+ break;
case DW_LANG_Ada83:
case DW_LANG_Cobol74:
case DW_LANG_Cobol85:
@@ -4303,8 +4309,9 @@ new_symbol (die, type, objfile)
/* The semantics of C++ state that "struct foo { ... }" also
defines a typedef for "foo". Synthesize a typedef symbol so
- that "ptype foo" works as expected. */
- if (cu_language == language_cplus)
+ that "ptype foo" works as expected. Similarly for Java. */
+ if (cu_language == language_cplus
+ || cu_language == language_java)
{
struct symbol *typedef_sym = (struct symbol *)
obstack_alloc (&objfile->symbol_obstack,
Index: gdb/dwarfread.c
===================================================================
RCS file: /cvs/gdb/gdb/gdb/dwarfread.c,v
retrieving revision 1.1.1.1
diff -u -p -u -r1.1.1.1 dwarfread.c
--- dwarfread.c 1999/04/16 01:34:00 1.1.1.1
+++ dwarfread.c 1999/06/05 20:36:23
@@ -678,6 +678,9 @@ set_cu_language (dip)
case LANG_FORTRAN90:
cu_language = language_fortran;
break;
+ case LANG_JAVA:
+ cu_language = language_java;
+ break;
case LANG_ADA83:
case LANG_COBOL74:
case LANG_COBOL85:
--
Anthony Green Cygnus Solutions
Sunnyvale, California