mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-13 19:06:54 +08:00
2010-12-29 Michael Snyder <msnyder@vmware.com>
* bcache.c: Comment clean-up. * block.c: Ditto. * blockframe.c: Ditto. * breakpoint.c: Ditto. * bsd-kvm.c: Ditto. * buildsym.c: Ditto.
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
2010-12-29 Michael Snyder <msnyder@vmware.com>
|
||||
|
||||
* bcache.c: Comment clean-up.
|
||||
* block.c: Ditto.
|
||||
* blockframe.c: Ditto.
|
||||
* breakpoint.c: Ditto.
|
||||
* bsd-kvm.c: Ditto.
|
||||
* buildsym.c: Ditto.
|
||||
|
||||
2010-12-29 Jie Zhang <jie.zhang@analog.com>
|
||||
|
||||
* configure.tgt (bfin-*-*): Set build_gdbserver to yes.
|
||||
|
28
gdb/bcache.c
28
gdb/bcache.c
@ -97,9 +97,8 @@ struct bcache
|
||||
int (*compare_function)(const void *, const void *, int length);
|
||||
};
|
||||
|
||||
/* The old hash function was stolen from SDBM. This is what DB 3.0 uses now,
|
||||
* and is better than the old one.
|
||||
*/
|
||||
/* The old hash function was stolen from SDBM. This is what DB 3.0
|
||||
uses now, and is better than the old one. */
|
||||
|
||||
unsigned long
|
||||
hash(const void *addr, int length)
|
||||
@ -305,12 +304,14 @@ bcache_compare (const void *addr1, const void *addr2, int length)
|
||||
|
||||
/* Allocated a bcache. HASH_FUNCTION and COMPARE_FUNCTION can be used
|
||||
to pass in custom hash, and compare functions to be used by this
|
||||
bcache. If HASH_FUNCTION is NULL hash() is used and if COMPARE_FUNCTION
|
||||
is NULL memcmp() is used. */
|
||||
bcache. If HASH_FUNCTION is NULL hash() is used and if
|
||||
COMPARE_FUNCTION is NULL memcmp() is used. */
|
||||
|
||||
struct bcache *
|
||||
bcache_xmalloc (unsigned long (*hash_function)(const void *, int length),
|
||||
int (*compare_function)(const void *, const void *, int length))
|
||||
int (*compare_function)(const void *,
|
||||
const void *,
|
||||
int length))
|
||||
{
|
||||
/* Allocate the bcache pre-zeroed. */
|
||||
struct bcache *b = XCALLOC (1, struct bcache);
|
||||
@ -348,7 +349,7 @@ static void
|
||||
print_percentage (int portion, int total)
|
||||
{
|
||||
if (total == 0)
|
||||
/* i18n: Like "Percentage of duplicates, by count: (not applicable)" */
|
||||
/* i18n: Like "Percentage of duplicates, by count: (not applicable)". */
|
||||
printf_filtered (_("(not applicable)\n"));
|
||||
else
|
||||
printf_filtered ("%3d%%\n", (int) (portion * 100.0 / total));
|
||||
@ -399,7 +400,8 @@ print_bcache_statistics (struct bcache *c, char *type)
|
||||
}
|
||||
}
|
||||
|
||||
/* To compute the median, we need the set of chain lengths sorted. */
|
||||
/* To compute the median, we need the set of chain lengths
|
||||
sorted. */
|
||||
qsort (chain_length, c->num_buckets, sizeof (chain_length[0]),
|
||||
compare_positive_ints);
|
||||
qsort (entry_size, c->unique_count, sizeof (entry_size[0]),
|
||||
@ -448,7 +450,7 @@ print_bcache_statistics (struct bcache *c, char *type)
|
||||
if (c->unique_count > 0)
|
||||
printf_filtered ("%ld\n", c->unique_size / c->unique_count);
|
||||
else
|
||||
/* i18n: "Average entry size: (not applicable)" */
|
||||
/* i18n: "Average entry size: (not applicable)". */
|
||||
printf_filtered (_("(not applicable)\n"));
|
||||
printf_filtered (_(" Median entry size: %d\n"), median_entry_size);
|
||||
printf_filtered ("\n");
|
||||
@ -461,7 +463,8 @@ print_bcache_statistics (struct bcache *c, char *type)
|
||||
print_percentage (c->total_size - c->structure_size, c->total_size);
|
||||
printf_filtered ("\n");
|
||||
|
||||
printf_filtered (_(" Hash table size: %3d\n"), c->num_buckets);
|
||||
printf_filtered (_(" Hash table size: %3d\n"),
|
||||
c->num_buckets);
|
||||
printf_filtered (_(" Hash table expands: %lu\n"),
|
||||
c->expand_count);
|
||||
printf_filtered (_(" Hash table hashes: %lu\n"),
|
||||
@ -476,9 +479,10 @@ print_bcache_statistics (struct bcache *c, char *type)
|
||||
if (c->num_buckets > 0)
|
||||
printf_filtered ("%3lu\n", c->unique_count / c->num_buckets);
|
||||
else
|
||||
/* i18n: "Average hash chain length: (not applicable)" */
|
||||
/* i18n: "Average hash chain length: (not applicable)". */
|
||||
printf_filtered (_("(not applicable)\n"));
|
||||
printf_filtered (_(" Maximum hash chain length: %3d\n"), max_chain_length);
|
||||
printf_filtered (_(" Maximum hash chain length: %3d\n"),
|
||||
max_chain_length);
|
||||
printf_filtered ("\n");
|
||||
}
|
||||
|
||||
|
@ -39,8 +39,8 @@
|
||||
#include "inline-frame.h"
|
||||
#include "psymtab.h"
|
||||
|
||||
/* Return the innermost lexical block in execution
|
||||
in a specified stack frame. The frame address is assumed valid.
|
||||
/* Return the innermost lexical block in execution in a specified
|
||||
stack frame. The frame address is assumed valid.
|
||||
|
||||
If ADDR_IN_BLOCK is non-zero, set *ADDR_IN_BLOCK to the exact code
|
||||
address we used to choose the block. We use this to find a source
|
||||
@ -144,7 +144,8 @@ find_pc_sect_function (CORE_ADDR pc, struct obj_section *section)
|
||||
}
|
||||
|
||||
/* Return the function containing pc value PC.
|
||||
Returns 0 if function is not known. Backward compatibility, no section */
|
||||
Returns 0 if function is not known.
|
||||
Backward compatibility, no section */
|
||||
|
||||
struct symbol *
|
||||
find_pc_function (CORE_ADDR pc)
|
||||
@ -153,7 +154,7 @@ find_pc_function (CORE_ADDR pc)
|
||||
}
|
||||
|
||||
/* These variables are used to cache the most recent result
|
||||
* of find_pc_partial_function. */
|
||||
of find_pc_partial_function. */
|
||||
|
||||
static CORE_ADDR cache_pc_function_low = 0;
|
||||
static CORE_ADDR cache_pc_function_high = 0;
|
||||
@ -240,10 +241,10 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
|
||||
}
|
||||
}
|
||||
|
||||
/* Not in the normal symbol tables, see if the pc is in a known section.
|
||||
If it's not, then give up. This ensures that anything beyond the end
|
||||
of the text seg doesn't appear to be part of the last function in the
|
||||
text segment. */
|
||||
/* Not in the normal symbol tables, see if the pc is in a known
|
||||
section. If it's not, then give up. This ensures that anything
|
||||
beyond the end of the text seg doesn't appear to be part of the
|
||||
last function in the text segment. */
|
||||
|
||||
if (!section)
|
||||
msymbol = NULL;
|
||||
@ -326,8 +327,8 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Return the innermost stack frame executing inside of BLOCK,
|
||||
or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */
|
||||
/* Return the innermost stack frame executing inside of BLOCK, or NULL
|
||||
if there is no such frame. If BLOCK is NULL, just return NULL. */
|
||||
|
||||
struct frame_info *
|
||||
block_innermost_frame (struct block *block)
|
||||
|
1003
gdb/breakpoint.c
1003
gdb/breakpoint.c
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,7 @@
|
||||
#include "gdb_string.h"
|
||||
#include "expression.h" /* For "enum exp_opcode" used by... */
|
||||
#include "bcache.h"
|
||||
#include "filenames.h" /* For DOSish file names */
|
||||
#include "filenames.h" /* For DOSish file names. */
|
||||
#include "macrotab.h"
|
||||
#include "demangle.h" /* Needed by SYMBOL_INIT_DEMANGLED_NAME. */
|
||||
#include "block.h"
|
||||
@ -48,7 +48,7 @@
|
||||
/* Ask buildsym.h to define the vars it normally declares `extern'. */
|
||||
#define EXTERN
|
||||
/**/
|
||||
#include "buildsym.h" /* Our own declarations */
|
||||
#include "buildsym.h" /* Our own declarations. */
|
||||
#undef EXTERN
|
||||
|
||||
/* For cleanup_undefined_types and finish_global_stabs (somewhat
|
||||
@ -97,7 +97,7 @@ static int compare_line_numbers (const void *ln1p, const void *ln2p);
|
||||
#define INITIAL_LINE_VECTOR_LENGTH 1000
|
||||
|
||||
|
||||
/* maintain the lists of symbols and blocks */
|
||||
/* Maintain the lists of symbols and blocks. */
|
||||
|
||||
/* Add a pending list to free_pendings. */
|
||||
void
|
||||
@ -256,7 +256,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
|
||||
|
||||
BLOCK_START (block) = start;
|
||||
BLOCK_END (block) = end;
|
||||
/* Superblock filled in when containing block is made */
|
||||
/* Superblock filled in when containing block is made. */
|
||||
BLOCK_SUPERBLOCK (block) = NULL;
|
||||
BLOCK_NAMESPACE (block) = NULL;
|
||||
|
||||
@ -319,7 +319,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
|
||||
*listhead = NULL;
|
||||
|
||||
/* Check to be sure that the blocks have an end address that is
|
||||
greater than starting address */
|
||||
greater than starting address. */
|
||||
|
||||
if (BLOCK_END (block) < BLOCK_START (block))
|
||||
{
|
||||
@ -336,7 +336,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
|
||||
paddress (gdbarch, BLOCK_END (block)),
|
||||
paddress (gdbarch, BLOCK_START (block)));
|
||||
}
|
||||
/* Better than nothing */
|
||||
/* Better than nothing. */
|
||||
BLOCK_END (block) = BLOCK_START (block);
|
||||
}
|
||||
|
||||
@ -520,7 +520,8 @@ make_blockvector (struct objfile *objfile)
|
||||
/* Start recording information about source code that came from an
|
||||
included (or otherwise merged-in) source file with a different
|
||||
name. NAME is the name of the file (cannot be NULL), DIRNAME is
|
||||
the directory in which the file was compiled (or NULL if not known). */
|
||||
the directory in which the file was compiled (or NULL if not
|
||||
known). */
|
||||
|
||||
void
|
||||
start_subfile (const char *name, const char *dirname)
|
||||
@ -565,7 +566,7 @@ start_subfile (const char *name, const char *dirname)
|
||||
subfiles = subfile;
|
||||
current_subfile = subfile;
|
||||
|
||||
/* Save its name and compilation directory name */
|
||||
/* Save its name and compilation directory name. */
|
||||
subfile->name = (name == NULL) ? NULL : xstrdup (name);
|
||||
subfile->dirname = (dirname == NULL) ? NULL : xstrdup (dirname);
|
||||
|
||||
@ -680,7 +681,8 @@ push_subfile (void)
|
||||
subfile_stack = tem;
|
||||
if (current_subfile == NULL || current_subfile->name == NULL)
|
||||
{
|
||||
internal_error (__FILE__, __LINE__, _("failed internal consistency check"));
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("failed internal consistency check"));
|
||||
}
|
||||
tem->name = current_subfile->name;
|
||||
}
|
||||
@ -825,14 +827,14 @@ start_symtab (char *name, char *dirname, CORE_ADDR start_addr)
|
||||
start_subfile (name, dirname);
|
||||
}
|
||||
|
||||
/* Subroutine of end_symtab to simplify it.
|
||||
Look for a subfile that matches the main source file's basename.
|
||||
If there is only one, and if the main source file doesn't have any
|
||||
symbol or line number information, then copy this file's symtab and
|
||||
line_vector to the main source file's subfile and discard the other subfile.
|
||||
This can happen because of a compiler bug or from the user playing games
|
||||
with #line or from things like a distributed build system that manipulates
|
||||
the debug info. */
|
||||
/* Subroutine of end_symtab to simplify it. Look for a subfile that
|
||||
matches the main source file's basename. If there is only one, and
|
||||
if the main source file doesn't have any symbol or line number
|
||||
information, then copy this file's symtab and line_vector to the
|
||||
main source file's subfile and discard the other subfile. This can
|
||||
happen because of a compiler bug or from the user playing games
|
||||
with #line or from things like a distributed build system that
|
||||
manipulates the debug info. */
|
||||
|
||||
static void
|
||||
watch_main_source_file_lossage (void)
|
||||
@ -849,10 +851,12 @@ watch_main_source_file_lossage (void)
|
||||
mainsub = subfile;
|
||||
}
|
||||
|
||||
/* If the main source file doesn't have any line number or symbol info,
|
||||
look for an alias in another subfile.
|
||||
We have to watch for mainsub == NULL here. It's a quirk of end_symtab,
|
||||
it can return NULL so there may not be a main subfile. */
|
||||
/* If the main source file doesn't have any line number or symbol
|
||||
info, look for an alias in another subfile.
|
||||
|
||||
We have to watch for mainsub == NULL here. It's a quirk of
|
||||
end_symtab, it can return NULL so there may not be a main
|
||||
subfile. */
|
||||
|
||||
if (mainsub
|
||||
&& mainsub->line_vector == NULL
|
||||
@ -1017,10 +1021,10 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
|
||||
{
|
||||
/* Define the STATIC_BLOCK & GLOBAL_BLOCK, and build the
|
||||
blockvector. */
|
||||
finish_block (0, &file_symbols, 0, last_source_start_addr, end_addr,
|
||||
objfile);
|
||||
finish_block (0, &global_symbols, 0, last_source_start_addr, end_addr,
|
||||
objfile);
|
||||
finish_block (0, &file_symbols, 0, last_source_start_addr,
|
||||
end_addr, objfile);
|
||||
finish_block (0, &global_symbols, 0, last_source_start_addr,
|
||||
end_addr, objfile);
|
||||
blockvector = make_blockvector (objfile);
|
||||
}
|
||||
|
||||
@ -1070,7 +1074,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
|
||||
symtab->macro_table = pending_macros;
|
||||
if (subfile->line_vector)
|
||||
{
|
||||
/* Reallocate the line table on the symbol obstack */
|
||||
/* Reallocate the line table on the symbol obstack. */
|
||||
symtab->linetable = (struct linetable *)
|
||||
obstack_alloc (&objfile->objfile_obstack, linetablesize);
|
||||
memcpy (symtab->linetable, subfile->line_vector, linetablesize);
|
||||
@ -1082,7 +1086,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
|
||||
symtab->block_line_section = section;
|
||||
if (subfile->dirname)
|
||||
{
|
||||
/* Reallocate the dirname on the symbol obstack */
|
||||
/* Reallocate the dirname on the symbol obstack. */
|
||||
symtab->dirname = (char *)
|
||||
obstack_alloc (&objfile->objfile_obstack,
|
||||
strlen (subfile->dirname) + 1);
|
||||
@ -1103,7 +1107,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
|
||||
the symbols. */
|
||||
symtab->language = subfile->language;
|
||||
|
||||
/* Save the debug format string (if any) in the symtab */
|
||||
/* Save the debug format string (if any) in the symtab. */
|
||||
if (subfile->debugformat != NULL)
|
||||
{
|
||||
symtab->debugformat = obsavestring (subfile->debugformat,
|
||||
@ -1190,8 +1194,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
|
||||
struct symbol *sym;
|
||||
struct dict_iterator iter;
|
||||
|
||||
/* Inlined functions may have symbols not in the global or static
|
||||
symbol lists. */
|
||||
/* Inlined functions may have symbols not in the global or
|
||||
static symbol lists. */
|
||||
if (BLOCK_FUNCTION (block) != NULL)
|
||||
if (SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) == NULL)
|
||||
SYMBOL_SYMTAB (BLOCK_FUNCTION (block)) = symtab;
|
||||
|
Reference in New Issue
Block a user