Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA]: Turn on initial Ada support in GDB (symtab portion)
@ 2004-09-29  8:01 Paul Hilfinger
  2004-09-29 22:33 ` Jim Blandy
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Hilfinger @ 2004-09-29  8:01 UTC (permalink / raw)
  To: gdb-patches


This is the symtab.c portion of our Ada-support patch.  Andrew requested
that I break it out and post it separately.  My recollection was that 
it was approved some time ago, but no harm in making sure.   See also 
my 9/27 posting.

Still OK?

Paul Hilfinger



2004-09-27  Paul N. Hilfinger  <Hilfinger@gnat.com>

	* symtab.c: Add dependency on ada-lang.h.
	(symbol_natural_name, symbol_demangled_name)
	(symbol_search_name): Add Ada case.

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	27 Sep 2004 10:18:47 -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] 2+ messages in thread

end of thread, other threads:[~2004-09-29 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-29  8:01 [RFA]: Turn on initial Ada support in GDB (symtab portion) Paul Hilfinger
2004-09-29 22:33 ` Jim Blandy

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