summaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 46325db11b7..94b60814eb3 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -69,7 +69,7 @@ static void variables_info (char *, int);
static void sources_info (char *, int);
-static void output_source_filename (char *, int *);
+static void output_source_filename (const char *, int *);
static int find_line_common (struct linetable *, int, int *);
@@ -272,8 +272,7 @@ lookup_partial_symtab (const char *name)
this symtab and use its absolute path. */
if (full_path != NULL)
{
- if (pst->fullname == NULL)
- source_full_path_of (pst->filename, &pst->fullname);
+ psymtab_to_fullname (pst);
if (pst->fullname != NULL
&& FILENAME_CMP (full_path, pst->fullname) == 0)
{
@@ -284,8 +283,7 @@ lookup_partial_symtab (const char *name)
if (real_path != NULL)
{
char *rp = NULL;
- if (pst->fullname == NULL)
- source_full_path_of (pst->filename, &pst->fullname);
+ psymtab_to_fullname (pst);
if (pst->fullname != NULL)
{
rp = gdb_realpath (pst->fullname);
@@ -1000,7 +998,7 @@ lookup_symbol (const char *name, const struct block *block,
modified_name = name;
- /* If we are using C++ language, demangle the name before doing a lookup, so
+ /* If we are using C++ or Java, demangle the name before doing a lookup, so
we can always binary search. */
if (current_language->la_language == language_cplus)
{
@@ -1012,6 +1010,17 @@ lookup_symbol (const char *name, const struct block *block,
needtofreename = 1;
}
}
+ else if (current_language->la_language == language_java)
+ {
+ demangled_name = cplus_demangle (name,
+ DMGL_ANSI | DMGL_PARAMS | DMGL_JAVA);
+ if (demangled_name)
+ {
+ mangled_name = name;
+ modified_name = demangled_name;
+ needtofreename = 1;
+ }
+ }
if (case_sensitivity == case_sensitive_off)
{
@@ -2622,7 +2631,7 @@ filename_seen (const char *file, int add, int *first)
NAME is the name to print and *FIRST is nonzero if this is the first
name printed. Set *FIRST to zero. */
static void
-output_source_filename (char *name, int *first)
+output_source_filename (const char *name, int *first)
{
/* Since a single source file can result in several partial symbol
tables, we need to avoid printing it more than once. Note: if
@@ -2671,7 +2680,8 @@ sources_info (char *ignore, int from_tty)
first = 1;
ALL_SYMTABS (objfile, s)
{
- output_source_filename (s->filename, &first);
+ const char *fullname = symtab_to_fullname (s);
+ output_source_filename (fullname ? fullname : s->filename, &first);
}
printf_filtered ("\n\n");
@@ -2682,7 +2692,8 @@ sources_info (char *ignore, int from_tty)
{
if (!ps->readin)
{
- output_source_filename (ps->filename, &first);
+ const char *fullname = psymtab_to_fullname (ps);
+ output_source_filename (fullname ? fullname : ps->filename, &first);
}
}
printf_filtered ("\n");