projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* symtab.c (lookup_symtab_1): Use lbasename (NAME) instead of
[deliverable/binutils-gdb.git]
/
gdb
/
symtab.c
diff --git
a/gdb/symtab.c
b/gdb/symtab.c
index 6b35d57423ffc485c3cfc4cae3a604cb2e8c8b59..108ace764d61ac350ef87890f803759226df5aed 100644
(file)
--- a/
gdb/symtab.c
+++ b/
gdb/symtab.c
@@
-1,5
+1,6
@@
/* Symbol table lookup for the GNU debugger, GDB.
/* Symbol table lookup for the GNU debugger, GDB.
- Copyright 1986, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 1998
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GDB.
Free Software Foundation, Inc.
This file is part of GDB.
@@
-36,6
+37,7
@@
#include "demangle.h"
#include "inferior.h"
#include "linespec.h"
#include "demangle.h"
#include "inferior.h"
#include "linespec.h"
+#include "filenames.h" /* for FILENAME_CMP */
#include "obstack.h"
#include "obstack.h"
@@
-44,6
+46,7
@@
#include "gdb_string.h"
#include "gdb_stat.h"
#include <ctype.h>
#include "gdb_string.h"
#include "gdb_stat.h"
#include <ctype.h>
+#include "cp-abi.h"
/* Prototype for one function in parser-defs.h,
instead of including that entire file. */
/* Prototype for one function in parser-defs.h,
instead of including that entire file. */
@@
-139,7
+142,6
@@
lookup_symtab_1 (char *name)
{
register struct symtab *s;
register struct partial_symtab *ps;
{
register struct symtab *s;
register struct partial_symtab *ps;
- register char *slash;
register struct objfile *objfile;
got_symtab:
register struct objfile *objfile;
got_symtab:
@@
-147,23
+149,15
@@
got_symtab:
/* First, search for an exact match */
ALL_SYMTABS (objfile, s)
/* First, search for an exact match */
ALL_SYMTABS (objfile, s)
- if (STREQ (name, s->filename))
- return s;
-
- slash = strchr (name, '/');
+ if (FILENAME_CMP (name, s->filename) == 0)
+ return s;
/* Now, search for a matching tail (only if name doesn't have any dirs) */
/* Now, search for a matching tail (only if name doesn't have any dirs) */
- if (
!slash
)
+ if (
lbasename (name) == name
)
ALL_SYMTABS (objfile, s)
{
ALL_SYMTABS (objfile, s)
{
- char *p = s->filename;
- char *tail = strrchr (p, '/');
-
- if (tail)
- p = tail + 1;
-
- if (STREQ (p, name))
+ if (FILENAME_CMP (basename (s->filename), name) == 0)
return s;
}
return s;
}
@@
-242,7
+236,7
@@
lookup_partial_symtab (char *name)
ALL_PSYMTABS (objfile, pst)
{
ALL_PSYMTABS (objfile, pst)
{
- if (
STREQ (name, pst->filename)
)
+ if (
FILENAME_CMP (name, pst->filename) == 0
)
{
return (pst);
}
{
return (pst);
}
@@
-250,16
+244,10
@@
lookup_partial_symtab (char *name)
/* Now, search for a matching tail (only if name doesn't have any dirs) */
/* Now, search for a matching tail (only if name doesn't have any dirs) */
- if (
!strchr (name, '/')
)
+ if (
lbasename (name) == name
)
ALL_PSYMTABS (objfile, pst)
{
ALL_PSYMTABS (objfile, pst)
{
- char *p = pst->filename;
- char *tail = strrchr (p, '/');
-
- if (tail)
- p = tail + 1;
-
- if (STREQ (p, name))
+ if (FILENAME_CMP (basename (pst->filename), name) == 0)
return (pst);
}
return (pst);
}
@@
-287,20
+275,17
@@
gdb_mangle_name (struct type *type, int method_id, int signature_id)
int is_full_physname_constructor;
int is_constructor;
int is_full_physname_constructor;
int is_constructor;
- int is_destructor =
DESTRUCTOR_PREFIX_P
(physname);
+ int is_destructor =
is_destructor_name
(physname);
/* Need a new type prefix. */
char *const_prefix = method->is_const ? "C" : "";
char *volatile_prefix = method->is_volatile ? "V" : "";
char buf[20];
int len = (newname == NULL ? 0 : strlen (newname));
/* Need a new type prefix. */
char *const_prefix = method->is_const ? "C" : "";
char *volatile_prefix = method->is_volatile ? "V" : "";
char buf[20];
int len = (newname == NULL ? 0 : strlen (newname));
- if (
OPNAME_PREFIX_P
(field_name))
+ if (
is_operator_name
(field_name))
return xstrdup (physname);
return xstrdup (physname);
- is_full_physname_constructor =
- ((physname[0] == '_' && physname[1] == '_' &&
- (isdigit (physname[2]) || physname[2] == 'Q' || physname[2] == 't'))
- || (strncmp (physname, "__ct", 4) == 0));
+ is_full_physname_constructor = is_constructor_name (physname);
is_constructor =
is_full_physname_constructor || (newname && STREQ (field_name, newname));
is_constructor =
is_full_physname_constructor || (newname && STREQ (field_name, newname));
@@
-949,8
+934,8
@@
lookup_symbol_aux (const char *name, const struct block *block,
&& MSYMBOL_TYPE (msymbol) != mst_file_text
&& !STREQ (name, SYMBOL_NAME (msymbol)))
{
&& MSYMBOL_TYPE (msymbol) != mst_file_text
&& !STREQ (name, SYMBOL_NAME (msymbol)))
{
- return lookup_symbol (SYMBOL_NAME (msymbol), block,
- namespace, is_a_field_of_this, symtab);
+ return lookup_symbol
_aux
(SYMBOL_NAME (msymbol), block,
+
namespace, is_a_field_of_this, symtab);
}
}
}
}
}
}
@@
-998,7
+983,7
@@
lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
{
center = bottom + (top - bottom) / 2;
if (!(center < top))
{
center = bottom + (top - bottom) / 2;
if (!(center < top))
-
abort (
);
+
internal_error (__FILE__, __LINE__, "failed internal consistency check"
);
if (!do_linear_search
&& (SYMBOL_LANGUAGE (*center) == language_java))
{
if (!do_linear_search
&& (SYMBOL_LANGUAGE (*center) == language_java))
{
@@
-1014,7
+999,7
@@
lookup_partial_symbol (struct partial_symtab *pst, const char *name, int global,
}
}
if (!(top == bottom))
}
}
if (!(top == bottom))
-
abort (
);
+
internal_error (__FILE__, __LINE__, "failed internal consistency check"
);
/* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
we don't have to force a linear search on C++. Probably holds true
/* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
we don't have to force a linear search on C++. Probably holds true
@@
-1758,11
+1743,18
@@
find_pc_sect_line (CORE_ADDR pc, struct sec *section, int notcurrent)
{
best = prev;
best_symtab = s;
{
best = prev;
best_symtab = s;
- /* If another line is in the linetable, and its PC is closer
-
than the best_end we currently have, take it as best_end
. */
- if (
i < len && (best_end == 0 || best_end > item->pc)
)
- best_end =
item->pc
;
+
+
/* Discard BEST_END if it's before the PC of the current BEST
. */
+ if (
best_end <= best->pc
)
+ best_end =
0
;
}
}
+
+ /* If another line (denoted by ITEM) is in the linetable and its
+ PC is after BEST's PC, but before the current BEST_END, then
+ use ITEM's PC as the new best_end. */
+ if (best && i < len && item->pc > best->pc
+ && (best_end == 0 || best_end > item->pc))
+ best_end = item->pc;
}
if (!best_symtab)
}
if (!best_symtab)
@@
-2348,7
+2340,7
@@
search_symbols (char *regexp, namespace_enum kind, int nfiles, char *files[],
struct symbol_search *tail;
struct cleanup *old_chain = NULL;
struct symbol_search *tail;
struct cleanup *old_chain = NULL;
- if (kind <
LABEL
_NAMESPACE)
+ if (kind <
VARIABLES
_NAMESPACE)
error ("must search on specific namespace");
ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
error ("must search on specific namespace");
ourtype = types[(int) (kind - VARIABLES_NAMESPACE)];
@@
-2652,9
+2644,17
@@
print_symbol_info (namespace_enum kind, struct symtab *s, struct symbol *sym,
static void
print_msymbol_info (struct minimal_symbol *msymbol)
{
static void
print_msymbol_info (struct minimal_symbol *msymbol)
{
- printf_filtered (" %08lx %s\n",
- (unsigned long) SYMBOL_VALUE_ADDRESS (msymbol),
- SYMBOL_SOURCE_NAME (msymbol));
+ char *tmp;
+
+ if (TARGET_ADDR_BIT <= 32)
+ tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol)
+ & (CORE_ADDR) 0xffffffff,
+ "08l");
+ else
+ tmp = longest_local_hex_string_custom (SYMBOL_VALUE_ADDRESS (msymbol),
+ "016l");
+ printf_filtered ("%s %s\n",
+ tmp, SYMBOL_SOURCE_NAME (msymbol));
}
/* This is the guts of the commands "info functions", "info types", and
}
/* This is the guts of the commands "info functions", "info types", and
@@
-2836,17
+2836,6
@@
completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
return;
}
return;
}
- /* Clip any symbol names that we've already considered. (This is a
- time optimization) */
-
- for (i = 0; i < return_val_index; ++i)
- {
- if (STREQ (symname, return_val[i]))
- {
- return;
- }
- }
-
/* We have a match for a completion, so add SYMNAME to the current list
of matches. Note that the name is moved to freshly malloc'd space. */
/* We have a match for a completion, so add SYMNAME to the current list
of matches. Note that the name is moved to freshly malloc'd space. */
@@
-2872,19
+2861,6
@@
completion_list_add_name (char *symname, char *sym_text, int sym_text_len,
strcat (new, symname);
}
strcat (new, symname);
}
- /* Recheck for duplicates if we intend to add a modified symbol. */
- if (word != sym_text)
- {
- for (i = 0; i < return_val_index; ++i)
- {
- if (STREQ (new, return_val[i]))
- {
- xfree (new);
- return;
- }
- }
- }
-
if (return_val_index + 3 > return_val_size)
{
newsize = (return_val_size *= 2) * sizeof (char *);
if (return_val_index + 3 > return_val_size)
{
newsize = (return_val_size *= 2) * sizeof (char *);
This page took
0.026183 seconds
and
4
git commands to generate.