summaryrefslogtreecommitdiff
path: root/gdb/jv-typeprint.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2010-03-31 00:48:28 +0000
committerKeith Seitz <keiths@redhat.com>2010-03-31 00:48:28 +0000
commitca7c2194b048f0a73a5b7a2ad4f8430922cdfe59 (patch)
treeddde6a302a8abd8d3f6fa35b0d674ea97ffb8d4a /gdb/jv-typeprint.c
parent704351e1a181751067c37f0d93d5f88d65f3afaa (diff)
downloadgdb-ca7c2194b048f0a73a5b7a2ad4f8430922cdfe59.tar.gz
* c-typeprint.c (c_type_print_args): Don't print "void"
for java, regardless of whether it is TYPE_PROTOTYPED. Use the passed-in language instead of current_language. (c_type_print_varspec_suffix): Use current_language instead of assuming language_c. * jv-typeprint.c (java_type_print_base): (bz 9320) Strip off any return type specifier from the physname.
Diffstat (limited to 'gdb/jv-typeprint.c')
-rw-r--r--gdb/jv-typeprint.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gdb/jv-typeprint.c b/gdb/jv-typeprint.c
index 03b6036f1a0..6132576a4fb 100644
--- a/gdb/jv-typeprint.c
+++ b/gdb/jv-typeprint.c
@@ -28,6 +28,7 @@
#include "typeprint.h"
#include "c-lang.h"
#include "cp-abi.h"
+#include "gdb_assert.h"
/* Local functions */
@@ -219,10 +220,19 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
for (j = 0; j < n_overloads; j++)
{
- char *physname;
+ char *real_physname, *physname, *p;
int is_full_physname_constructor;
- physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+ real_physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+
+ /* The physname will contain the return type
+ after the final closing parenthesis. Strip it off. */
+ p = strrchr (real_physname, ')');
+ gdb_assert (p != NULL);
+ ++p; /* Keep the trailing ')'. */
+ physname = alloca (p - real_physname + 1);
+ memcpy (physname, real_physname, p - real_physname);
+ physname[p - real_physname] = '\0';
is_full_physname_constructor
= (is_constructor_name (physname)
@@ -268,7 +278,7 @@ java_type_print_base (struct type *type, struct ui_file *stream, int show,
/* Build something we can demangle. */
mangled_name = gdb_mangle_name (type, i, j);
else
- mangled_name = TYPE_FN_FIELD_PHYSNAME (f, j);
+ mangled_name = physname;
demangled_name =
cplus_demangle (mangled_name,