Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [commit]: Turn on initial Ada support
@ 2004-10-02 10:00 Paul Hilfinger
  2004-10-04 14:00 ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Hilfinger @ 2004-10-02 10:00 UTC (permalink / raw)
  To: gdb-patches


As promised, I have committed the approved patches to Makefile.in and 
symtab.c that turn on initial Ada support in GDB.  "Initial" here means
"quite limited for the moment", encompassing mostly expression evaluation.
Now that the process is finally started, we can hope to get the rest of
the AdaCore changes in somewhat more expeditiously.  

As indicated in previous mail, this checkin has the side-effect of
requiring flex to build.

Checkins of documentation and NEWS will be occur soon.

P. Hilfinger

2004-10-02  Paul N. Hilfinger  <Hilfinger@gnat.com>

        Turn on initial Ada support (mainly expression evaluation).
	
        * Makefile.in (SFILES): Remove ada-tasks.c.
	(HFILES_NO_SRCDIR): Add ada-lang.h.
	(COMMON_OBS): Add ada-lang.o, ada-typeprint.o, ada-valprint.o.
	(YYOBJ): Add ada-exp.o.
	(rule .l.c): Generalize to not mention ada.
	* symtab.c: Include ada-lang.h.
	(symbol_natural_name, symbol_demangled_name)
	(symbol_search_name): Add Ada case.

Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.635
diff -u -p -r1.635 Makefile.in
--- gdb/Makefile.in	1 Oct 2004 17:26:09 -0000	1.635
+++ gdb/Makefile.in	2 Oct 2004 09:12:24 -0000
@@ -510,7 +510,7 @@ TARGET_FLAGS_TO_PASS = \
 # Links made at configuration time should not be specified here, since
 # SFILES is used in building the distribution archive.
 
-SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
+SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c  \
 	ax-general.c ax-gdb.c \
 	bcache.c \
 	bfd-target.c \
@@ -848,7 +848,7 @@ HFILES_NO_SRCDIR = bcache.h buildsym.h c
 	symfile.h symfile-mem.h stabsread.h target.h terminal.h typeprint.h \
 	xcoffsolib.h \
 	macrotab.h macroexp.h macroscope.h \
-	c-lang.h f-lang.h \
+	ada-lang.h c-lang.h f-lang.h \
 	jv-lang.h \
 	m2-lang.h  p-lang.h \
 	complaints.h valprint.h \
@@ -910,7 +910,7 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
 	dbxread.o coffread.o coff-pe-read.o elfread.o \
 	dwarfread.o dwarf2read.o mipsread.o stabsread.o corefile.o \
 	dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
-	c-lang.o f-lang.o objc-lang.o \
+	ada-lang.o c-lang.o f-lang.o objc-lang.o \
 	ui-out.o cli-out.o \
 	varobj.o wrapper.o \
 	jv-lang.o jv-valprint.o jv-typeprint.o \
@@ -918,8 +918,8 @@ COMMON_OBS = $(DEPFILES) $(YYOBJ) \
 	scm-exp.o scm-lang.o scm-valprint.o \
 	sentinel-frame.o \
 	complaints.o typeprint.o \
-	c-typeprint.o f-typeprint.o m2-typeprint.o \
-	c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
+	ada-typeprint.o c-typeprint.o f-typeprint.o m2-typeprint.o \
+	ada-valprint.o c-valprint.o cp-valprint.o f-valprint.o m2-valprint.o \
 	nlmread.o serial.o mdebugread.o top.o utils.o \
 	ui-file.o \
 	user-regs.o \
@@ -943,6 +943,7 @@ YYFILES = c-exp.c \
 	f-exp.c m2-exp.c p-exp.c
 YYOBJ = c-exp.o \
 	objc-exp.o \
+	ada-exp.o \
 	jv-exp.o \
 	f-exp.o m2-exp.o p-exp.o
 
@@ -1585,7 +1586,7 @@ po/$(PACKAGE).pot: force
 	    echo $(FLEX) -Isit $< ">" $@; \
 	    $(FLEX) -Isit $< > $@; \
 	elif [ ! -f $@ -a ! -f $< ]; then \
-	    echo "ada-lex.c missing and flex not available."; \
+	    echo "$< missing and flex not available."; \
 	    false; \
 	elif [ ! -f $@ ]; then \
 	    echo "Warning: $*.c older than $*.l and flex not available."; \
Index: gdb/symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.139
diff -u -p -r1.139 symtab.c
--- gdb/symtab.c	20 Sep 2004 20:18:39 -0000	1.139
+++ gdb/symtab.c	2 Oct 2004 09:12:24 -0000
@@ -41,6 +41,7 @@
 #include "source.h"
 #include "filenames.h"		/* for FILENAME_CMP */
 #include "objc-lang.h"
+#include "ada-lang.h"
 
 #include "hashtab.h"
 
@@ -634,17 +635,24 @@ symbol_init_demangled_name (struct gener
 char *
 symbol_natural_name (const struct general_symbol_info *gsymbol)
 {
-  if ((gsymbol->language == language_cplus
-       || gsymbol->language == language_java
-       || gsymbol->language == language_objc)
-      && (gsymbol->language_specific.cplus_specific.demangled_name != NULL))
+  switch (gsymbol->language) 
     {
-      return gsymbol->language_specific.cplus_specific.demangled_name;
-    }
-  else
-    {
-      return gsymbol->name;
+    case language_cplus:
+    case language_java:
+    case language_objc:
+      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+	return gsymbol->language_specific.cplus_specific.demangled_name;
+      break;
+    case language_ada:
+      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+	return gsymbol->language_specific.cplus_specific.demangled_name;
+      else
+	return ada_decode_symbol (gsymbol);
+      break;
+    default:
+      break;
     }
+  return gsymbol->name;
 }
 
 /* Return the demangled name for a symbol based on the language for
@@ -652,13 +660,24 @@ symbol_natural_name (const struct genera
 char *
 symbol_demangled_name (struct general_symbol_info *gsymbol)
 {
-  if (gsymbol->language == language_cplus
-      || gsymbol->language == language_java
-      || gsymbol->language == language_objc)
-    return gsymbol->language_specific.cplus_specific.demangled_name;
-
-  else 
-    return NULL;
+  switch (gsymbol->language) 
+    {
+    case language_cplus:
+    case language_java:
+    case language_objc:
+      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+	return gsymbol->language_specific.cplus_specific.demangled_name;
+      break;
+    case language_ada:
+      if (gsymbol->language_specific.cplus_specific.demangled_name != NULL)
+	return gsymbol->language_specific.cplus_specific.demangled_name;
+      else
+	return ada_decode_symbol (gsymbol);
+      break;
+    default:
+      break;
+    }
+  return NULL;
 }
 
 /* Return the search name of a symbol---generally the demangled or
@@ -666,7 +685,10 @@ symbol_demangled_name (struct general_sy
    If there is no distinct demangled name, then returns the same value 
    (same pointer) as SYMBOL_LINKAGE_NAME. */
 char *symbol_search_name (const struct general_symbol_info *gsymbol) {
-  return symbol_natural_name (gsymbol);
+  if (gsymbol->language == language_ada)
+    return gsymbol->name;
+  else
+    return symbol_natural_name (gsymbol);
 }
 
 /* Initialize the structure fields to zero values.  */


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

* Re: [commit]: Turn on initial Ada support
  2004-10-02 10:00 [commit]: Turn on initial Ada support Paul Hilfinger
@ 2004-10-04 14:00 ` Mark Kettenis
  2004-10-04 16:26   ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Kettenis @ 2004-10-04 14:00 UTC (permalink / raw)
  To: hilfingr; +Cc: gdb-patches

Paul.

When compiling on sparc-sun-solaris2.9 (gcc 3.2.3, flex 2.5.4) I get:

/juw15_0/kettenis/sandbox/gdb/obj/gdb/../../src/gdb/ada-exp.y:636: warning: `string_to_operator' defined but not used
ada-lex.c:2529: warning: `yy_flex_realloc' defined but not used
ada-lex.c:2016: warning: `yyunput' defined but not used

Can you do something about that?  I'm using -Werror (as all GDB
developers really should) so this breaks the build.

Cheers,

Mark


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

* Re: [commit]: Turn on initial Ada support
  2004-10-04 14:00 ` Mark Kettenis
@ 2004-10-04 16:26   ` Joel Brobecker
  2004-10-04 18:30     ` Paul Hilfinger
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2004-10-04 16:26 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: hilfingr, gdb-patches

> /juw15_0/kettenis/sandbox/gdb/obj/gdb/../../src/gdb/ada-exp.y:636: warning: `string_to_operator' defined but not used
> ada-lex.c:2529: warning: `yy_flex_realloc' defined but not used
> ada-lex.c:2016: warning: `yyunput' defined but not used
> 
> Can you do something about that?  I'm using -Werror (as all GDB
> developers really should) so this breaks the build.

Since this is a generated file, should the warnings be fatal?
If yes, then I guess we could simply define a dummy function calling
these two ones.

-- 
Joel


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

* Re: [commit]: Turn on initial Ada support
  2004-10-04 16:26   ` Joel Brobecker
@ 2004-10-04 18:30     ` Paul Hilfinger
  2004-10-04 19:03       ` Mark Kettenis
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Hilfinger @ 2004-10-04 18:30 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Mark Kettenis, gdb-patches


> > /juw15_0/kettenis/sandbox/gdb/obj/gdb/../../src/gdb/ada-exp.y:636: warning: `string_to_operator' defined but not used
> > ada-lex.c:2529: warning: `yy_flex_realloc' defined but not used
> > ada-lex.c:2016: warning: `yyunput' defined but not used
> > 
> > Can you do something about that?  I'm using -Werror (as all GDB
> > developers really should) so this breaks the build.
> 
> Since this is a generated file, should the warnings be fatal?
> If yes, then I guess we could simply define a dummy function calling
> these two ones.

Probably the safest fix, although I believe recent versions of flex
have options specifically intended to suppress unused static
functions.

Paul


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

* Re: [commit]: Turn on initial Ada support
  2004-10-04 18:30     ` Paul Hilfinger
@ 2004-10-04 19:03       ` Mark Kettenis
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Kettenis @ 2004-10-04 19:03 UTC (permalink / raw)
  To: hilfingr; +Cc: brobecker, gdb-patches

   Date: Mon, 04 Oct 2004 11:30:17 -0700
   From: Paul Hilfinger <hilfingr@EECS.Berkeley.EDU>

   > > /juw15_0/kettenis/sandbox/gdb/obj/gdb/../../src/gdb/ada-exp.y:636: warning: `string_to_operator' defined but not used
   > > ada-lex.c:2529: warning: `yy_flex_realloc' defined but not used
   > > ada-lex.c:2016: warning: `yyunput' defined but not used
   > > 
   > > Can you do something about that?  I'm using -Werror (as all GDB
   > > developers really should) so this breaks the build.
   > 
   > Since this is a generated file, should the warnings be fatal?
   > If yes, then I guess we could simply define a dummy function calling
   > these two ones.

   Probably the safest fix, although I believe recent versions of flex
   have options specifically intended to suppress unused static
   functions.

Ah yes, but strong_to_operator isn't generated.

Mark


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

end of thread, other threads:[~2004-10-04 19:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-02 10:00 [commit]: Turn on initial Ada support Paul Hilfinger
2004-10-04 14:00 ` Mark Kettenis
2004-10-04 16:26   ` Joel Brobecker
2004-10-04 18:30     ` Paul Hilfinger
2004-10-04 19:03       ` Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox