projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* language.c (local_hex_string_custom): Simplify. Do not depend
[deliverable/binutils-gdb.git]
/
gdb
/
buildsym.c
diff --git
a/gdb/buildsym.c
b/gdb/buildsym.c
index 860f4aaa075704a43ee5829e9139364b3daf2a99..d7e99c054e1c3afded4b5ded4d072eec0ddc7b4d 100644
(file)
--- a/
gdb/buildsym.c
+++ b/
gdb/buildsym.c
@@
-1,5
+1,6
@@
/* Support routines for building symbol tables in GDB's internal format.
/* Support routines for building symbol tables in GDB's internal format.
- Copyright 1986-1999 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-34,7
+35,10
@@
#include "gdbtypes.h"
#include "complaints.h"
#include "gdb_string.h"
#include "gdbtypes.h"
#include "complaints.h"
#include "gdb_string.h"
-
+#include "expression.h" /* For "enum exp_opcode" used by... */
+#include "language.h" /* For "local_hex_string" */
+#include "bcache.h"
+#include "filenames.h" /* For DOSish file names */
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
/* Ask buildsym.h to define the vars it normally declares `extern'. */
#define EXTERN
/**/
@@
-81,10
+85,24
@@
struct complaint innerblock_anon_complaint =
{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0};
struct complaint blockvector_complaint =
{"inner block (0x%lx-0x%lx) not inside outer block (0x%lx-0x%lx)", 0, 0};
struct complaint blockvector_complaint =
-{"block at
0x%lx
out of order", 0, 0};
+{"block at
%s
out of order", 0, 0};
\f
/* maintain the lists of symbols and blocks */
\f
/* maintain the lists of symbols and blocks */
+/* Add a pending list to free_pendings. */
+void
+add_free_pendings (struct pending *list)
+{
+ register struct pending *link = list;
+
+ if (list)
+ {
+ while (link->next) link = link->next;
+ link->next = free_pendings;
+ free_pendings = list;
+ }
+}
+
/* Add a symbol to one of the lists of symbols. */
void
/* Add a symbol to one of the lists of symbols. */
void
@@
-148,14
+166,14
@@
find_symbol_in_list (struct pending *list, char *name, int length)
/* ARGSUSED */
void
/* ARGSUSED */
void
-really_free_pendings (
int foo
)
+really_free_pendings (
PTR dummy
)
{
struct pending *next, *next1;
for (next = free_pendings; next; next = next1)
{
next1 = next->next;
{
struct pending *next, *next1;
for (next = free_pendings; next; next = next1)
{
next1 = next->next;
- free ((void *) next);
+
x
free ((void *) next);
}
free_pendings = NULL;
}
free_pendings = NULL;
@@
-164,14
+182,14
@@
really_free_pendings (int foo)
for (next = file_symbols; next != NULL; next = next1)
{
next1 = next->next;
for (next = file_symbols; next != NULL; next = next1)
{
next1 = next->next;
- free ((void *) next);
+
x
free ((void *) next);
}
file_symbols = NULL;
for (next = global_symbols; next != NULL; next = next1)
{
next1 = next->next;
}
file_symbols = NULL;
for (next = global_symbols; next != NULL; next = next1)
{
next1 = next->next;
- free ((void *) next);
+
x
free ((void *) next);
}
global_symbols = NULL;
}
}
global_symbols = NULL;
}
@@
-189,7
+207,7
@@
free_pending_blocks (void)
for (bnext = pending_blocks; bnext; bnext = bnext1)
{
bnext1 = bnext->next;
for (bnext = pending_blocks; bnext; bnext = bnext1)
{
bnext1 = bnext->next;
- free ((void *) bnext);
+
x
free ((void *) bnext);
}
#endif
pending_blocks = NULL;
}
#endif
pending_blocks = NULL;
@@
-257,9
+275,8
@@
finish_block (struct symbol *symbol, struct pending **listhead,
parameter symbols. */
int nparams = 0, iparams;
struct symbol *sym;
parameter symbols. */
int nparams = 0, iparams;
struct symbol *sym;
-
for (i = 0; i < BLOCK_NSYMS (block); i++
)
+
ALL_BLOCK_SYMBOLS (block, i, sym
)
{
{
- sym = BLOCK_SYM (block, i);
switch (SYMBOL_CLASS (sym))
{
case LOC_ARG:
switch (SYMBOL_CLASS (sym))
{
case LOC_ARG:
@@
-305,6
+322,7
@@
finish_block (struct symbol *symbol, struct pending **listhead,
case LOC_BASEREG_ARG:
case LOC_LOCAL_ARG:
TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym);
case LOC_BASEREG_ARG:
case LOC_LOCAL_ARG:
TYPE_FIELD_TYPE (ftype, iparams) = SYMBOL_TYPE (sym);
+ TYPE_FIELD_ARTIFICIAL (ftype, iparams) = 0;
iparams++;
break;
case LOC_UNDEF:
iparams++;
break;
case LOC_UNDEF:
@@
-470,7
+488,7
@@
make_blockvector (struct objfile *objfile)
for (next = pending_blocks; next; next = next1)
{
next1 = next->next;
for (next = pending_blocks; next; next = next1)
{
next1 = next->next;
- free (next);
+
x
free (next);
}
#endif
pending_blocks = NULL;
}
#endif
pending_blocks = NULL;
@@
-487,17
+505,11
@@
make_blockvector (struct objfile *objfile)
if (BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i - 1))
> BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)))
{
if (BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i - 1))
> BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)))
{
-
- /* FIXME-32x64: loses if CORE_ADDR doesn't fit in a
- long. Possible solutions include a version of
- complain which takes a callback, a
- sprintf_address_numeric to match
- print_address_numeric, or a way to set up a GDB_FILE
- which causes sprintf rather than fprintf to be
- called. */
+ CORE_ADDR start
+ = BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i));
complain (&blockvector_complaint,
complain (&blockvector_complaint,
-
(unsigned long) BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)
));
+
local_hex_string ((LONGEST) start
));
}
}
}
}
}
}
@@
-521,7
+533,7
@@
start_subfile (char *name, char *dirname)
for (subfile = subfiles; subfile; subfile = subfile->next)
{
for (subfile = subfiles; subfile; subfile = subfile->next)
{
- if (
STREQ (subfile->name, name)
)
+ if (
FILENAME_CMP (subfile->name, name) == 0
)
{
current_subfile = subfile;
return;
{
current_subfile = subfile;
return;
@@
-533,6
+545,7
@@
start_subfile (char *name, char *dirname)
source file. */
subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
source file. */
subfile = (struct subfile *) xmalloc (sizeof (struct subfile));
+ memset ((char *) subfile, 0, sizeof (struct subfile));
subfile->next = subfiles;
subfiles = subfile;
current_subfile = subfile;
subfile->next = subfiles;
subfiles = subfile;
current_subfile = subfile;
@@
-656,7
+669,7
@@
push_subfile (void)
subfile_stack = tem;
if (current_subfile == NULL || current_subfile->name == NULL)
{
subfile_stack = tem;
if (current_subfile == NULL || current_subfile->name == NULL)
{
-
abort (
);
+
internal_error (__FILE__, __LINE__, "failed internal consistency check"
);
}
tem->name = current_subfile->name;
}
}
tem->name = current_subfile->name;
}
@@
-669,11
+682,11
@@
pop_subfile (void)
if (link == NULL)
{
if (link == NULL)
{
-
abort (
);
+
internal_error (__FILE__, __LINE__, "failed internal consistency check"
);
}
name = link->name;
subfile_stack = link->next;
}
name = link->name;
subfile_stack = link->next;
- free ((void *) link);
+
x
free ((void *) link);
return (name);
}
\f
return (name);
}
\f
@@
-714,7
+727,7
@@
record_line (register struct subfile *subfile, int line, CORE_ADDR pc)
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
e = subfile->line_vector->item + subfile->line_vector->nitems++;
e->line = line;
- e->pc =
pc
;
+ e->pc =
ADDR_BITS_REMOVE(pc)
;
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
}
/* Needed in order to sort line tables from IBM xcoff files. Sigh! */
@@
-982,23
+995,23
@@
end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
}
if (subfile->name != NULL)
{
}
if (subfile->name != NULL)
{
- free ((void *) subfile->name);
+
x
free ((void *) subfile->name);
}
if (subfile->dirname != NULL)
{
}
if (subfile->dirname != NULL)
{
- free ((void *) subfile->dirname);
+
x
free ((void *) subfile->dirname);
}
if (subfile->line_vector != NULL)
{
}
if (subfile->line_vector != NULL)
{
- free ((void *) subfile->line_vector);
+
x
free ((void *) subfile->line_vector);
}
if (subfile->debugformat != NULL)
{
}
if (subfile->debugformat != NULL)
{
- free ((void *) subfile->debugformat);
+
x
free ((void *) subfile->debugformat);
}
nextsub = subfile->next;
}
nextsub = subfile->next;
- free ((void *) subfile);
+
x
free ((void *) subfile);
}
/* Set this for the main source file. */
}
/* Set this for the main source file. */
@@
-1044,33
+1057,13
@@
push_context (int desc, CORE_ADDR valu)
return new;
}
\f
return new;
}
\f
+
/* Compute a small integer hash code for the given name. */
int
hashname (char *name)
{
/* Compute a small integer hash code for the given name. */
int
hashname (char *name)
{
- register char *p = name;
- register int total = p[0];
- register int c;
-
- c = p[1];
- total += c << 2;
- if (c)
- {
- c = p[2];
- total += c << 4;
- if (c)
- {
- total += p[3] << 6;
- }
- }
-
- /* Ensure result is positive. */
- if (total < 0)
- {
- total += (1000 << 6);
- }
- return (total % HASHSIZE);
+ return (hash(name,strlen(name)) % HASHSIZE);
}
\f
}
\f
@@
-1113,7
+1106,7
@@
merge_symbol_lists (struct pending **srclist, struct pending **targetlist)
corresponding to a psymtab. */
void
corresponding to a psymtab. */
void
-buildsym_init ()
+buildsym_init (
void
)
{
free_pendings = NULL;
file_symbols = NULL;
{
free_pendings = NULL;
file_symbols = NULL;
@@
-1126,7
+1119,7
@@
buildsym_init ()
file, e.g. a shared library). */
void
file, e.g. a shared library). */
void
-buildsym_new_init ()
+buildsym_new_init (
void
)
{
buildsym_init ();
}
{
buildsym_init ();
}
This page took
0.027023 seconds
and
4
git commands to generate.