2010-05-15 Michael Snyder <msnyder@vmware.com>

* m2-lang.c: White space.
	* m2-valprint.c: White space.
	* macrocmd.c: White space.
	* macroexp.c: White space.
	* macroscope.c: White space.
	* macrotab.c: White space.
	* main.c: White space.
	* maint.c: White space.
	* mdebugread.c: White space.
	* memattr.c: White space.
	* minsyms.c: White space.
	* monitor.c: White space.
This commit is contained in:
Michael Snyder 2010-05-16 00:18:02 +00:00
parent 54534c15fe
commit b8d56208c5
13 changed files with 106 additions and 23 deletions

View File

@ -1,3 +1,18 @@
2010-05-15 Michael Snyder <msnyder@vmware.com>
* m2-lang.c: White space.
* m2-valprint.c: White space.
* macrocmd.c: White space.
* macroexp.c: White space.
* macroscope.c: White space.
* macrotab.c: White space.
* main.c: White space.
* maint.c: White space.
* mdebugread.c: White space.
* memattr.c: White space.
* minsyms.c: White space.
* monitor.c: White space.
2010-05-14 Michael Snyder <msnyder@vmware.com> 2010-05-14 Michael Snyder <msnyder@vmware.com>
* jv-lang.c: White space. * jv-lang.c: White space.

View File

@ -194,6 +194,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
struct value *arg1; struct value *arg1;
struct value *arg2; struct value *arg2;
struct type *type; struct type *type;
switch (op) switch (op)
{ {
case UNOP_HIGH: case UNOP_HIGH:
@ -210,6 +211,7 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
if (m2_is_unbounded_array (type)) if (m2_is_unbounded_array (type))
{ {
struct value *temp = arg1; struct value *temp = arg1;
type = TYPE_FIELD_TYPE (type, 1); type = TYPE_FIELD_TYPE (type, 1);
/* i18n: Do not translate the "_m2_high" part! */ /* i18n: Do not translate the "_m2_high" part! */
arg1 = value_struct_elt (&temp, NULL, "_m2_high", NULL, arg1 = value_struct_elt (&temp, NULL, "_m2_high", NULL,
@ -239,10 +241,11 @@ evaluate_subexp_modula2 (struct type *expect_type, struct expression *exp,
{ {
struct value *temp = arg1; struct value *temp = arg1;
type = TYPE_FIELD_TYPE (type, 0); type = TYPE_FIELD_TYPE (type, 0);
if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR)) { if (type == NULL || (TYPE_CODE (type) != TYPE_CODE_PTR))
warning (_("internal error: unbounded array structure is unknown")); {
return evaluate_subexp_standard (expect_type, exp, pos, noside); warning (_("internal error: unbounded array structure is unknown"));
} return evaluate_subexp_standard (expect_type, exp, pos, noside);
}
/* i18n: Do not translate the "_m2_contents" part! */ /* i18n: Do not translate the "_m2_contents" part! */
arg1 = value_struct_elt (&temp, NULL, "_m2_contents", NULL, arg1 = value_struct_elt (&temp, NULL, "_m2_contents", NULL,
_("unbounded structure " _("unbounded structure "

View File

@ -259,6 +259,7 @@ print_variable_at_address (struct type *type,
{ {
struct value *deref_val = struct value *deref_val =
value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr)); value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr));
common_val_print (deref_val, stream, recurse, options, current_language); common_val_print (deref_val, stream, recurse, options, current_language);
} }
else else
@ -395,6 +396,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{ {
CORE_ADDR addr CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type); = extract_typed_address (valaddr + embedded_offset, type);
fprintf_filtered (stream, "@"); fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, addr), stream); fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref) if (options->deref_ref)
@ -409,6 +411,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
value_at value_at
(TYPE_TARGET_TYPE (type), (TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset)); unpack_pointer (type, valaddr + embedded_offset));
common_val_print (deref_val, stream, recurse, options, common_val_print (deref_val, stream, recurse, options,
current_language); current_language);
} }
@ -483,6 +486,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (options->format || options->output_format) if (options->format || options->output_format)
{ {
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type, print_scalar_formatted (valaddr + embedded_offset, type,
@ -520,6 +524,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (options->format || options->output_format) if (options->format || options->output_format)
{ {
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type, print_scalar_formatted (valaddr + embedded_offset, type,
@ -533,6 +538,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
if (options->format || options->output_format) if (options->format || options->output_format)
{ {
struct value_print_options opts = *options; struct value_print_options opts = *options;
opts.format = (options->format ? options->format opts.format = (options->format ? options->format
: options->output_format); : options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type, print_scalar_formatted (valaddr + embedded_offset, type,
@ -596,6 +602,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
{ {
int element = value_bit_index (type, valaddr + embedded_offset, int element = value_bit_index (type, valaddr + embedded_offset,
i); i);
if (element < 0) if (element < 0)
{ {
i = element; i = element;
@ -615,6 +622,7 @@ m2_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
++i)) ++i))
{ {
int j = i; int j = i;
fputs_filtered ("..", stream); fputs_filtered ("..", stream);
while (i + 1 <= high_bound while (i + 1 <= high_bound
&& value_bit_index (type, && value_bit_index (type,

View File

@ -50,6 +50,7 @@ macro_expand_command (char *exp, int from_tty)
struct macro_scope *ms = NULL; struct macro_scope *ms = NULL;
char *expanded = NULL; char *expanded = NULL;
struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms); struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms);
make_cleanup (free_current_contents, &expanded); make_cleanup (free_current_contents, &expanded);
/* You know, when the user doesn't specify any expression, it would be /* You know, when the user doesn't specify any expression, it would be
@ -249,6 +250,7 @@ free_macro_definition_ptr (void *ptr)
{ {
int i; int i;
struct macro_definition *loc = (struct macro_definition *) ptr; struct macro_definition *loc = (struct macro_definition *) ptr;
for (i = 0; i < loc->argc; ++i) for (i = 0; i < loc->argc; ++i)
xfree ((char *) loc->argv[i]); xfree ((char *) loc->argv[i]);
xfree ((char *) loc->argv); xfree ((char *) loc->argv);
@ -362,6 +364,7 @@ print_one_macro (const char *name, const struct macro_definition *macro,
if (macro->kind == macro_function_like) if (macro->kind == macro_function_like)
{ {
int i; int i;
fprintf_filtered (gdb_stdout, "("); fprintf_filtered (gdb_stdout, "(");
for (i = 0; i < macro->argc; ++i) for (i = 0; i < macro->argc; ++i)
fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "", fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "",

View File

@ -525,6 +525,7 @@ get_token (struct macro_buffer *tok,
{ {
/* How many characters did we consume, including whitespace? */ /* How many characters did we consume, including whitespace? */
int consumed = p - src->text + tok->len; int consumed = p - src->text + tok->len;
src->text += consumed; src->text += consumed;
src->len -= consumed; src->len -= consumed;
return 1; return 1;
@ -767,6 +768,7 @@ gather_arguments (const char *name, struct macro_buffer *src,
paren. */ paren. */
{ {
struct macro_buffer temp; struct macro_buffer temp;
init_shared_buffer (&temp, src->text, src->len); init_shared_buffer (&temp, src->text, src->len);
if (! get_token (&tok, &temp) if (! get_token (&tok, &temp)
@ -1016,6 +1018,7 @@ substitute_args (struct macro_buffer *dest,
{ {
int arg = find_parameter (&tok, is_varargs, va_arg_name, int arg = find_parameter (&tok, is_varargs, va_arg_name,
def->argc, def->argv); def->argc, def->argv);
if (arg != -1) if (arg != -1)
appendmem (dest, argv[arg].text, argv[arg].len); appendmem (dest, argv[arg].text, argv[arg].len);
else else
@ -1055,6 +1058,7 @@ substitute_args (struct macro_buffer *dest,
{ {
int arg = find_parameter (&tok, is_varargs, va_arg_name, int arg = find_parameter (&tok, is_varargs, va_arg_name,
def->argc, def->argv); def->argc, def->argv);
if (arg != -1) if (arg != -1)
appendmem (dest, argv[arg].text, argv[arg].len); appendmem (dest, argv[arg].text, argv[arg].len);
else else
@ -1193,6 +1197,7 @@ expand (const char *id,
else else
{ {
int len = strlen (def->argv[def->argc - 1]); int len = strlen (def->argv[def->argc - 1]);
if (len > 3 if (len > 3
&& strcmp (def->argv[def->argc - 1] + len - 3, "...") == 0) && strcmp (def->argv[def->argc - 1] + len - 3, "...") == 0)
{ {
@ -1297,6 +1302,7 @@ maybe_expand (struct macro_buffer *dest,
lookup function expects. */ lookup function expects. */
char *id = xmalloc (src_first->len + 1); char *id = xmalloc (src_first->len + 1);
struct cleanup *back_to = make_cleanup (xfree, id); struct cleanup *back_to = make_cleanup (xfree, id);
memcpy (id, src_first->text, src_first->len); memcpy (id, src_first->text, src_first->len);
id[src_first->len] = 0; id[src_first->len] = 0;

View File

@ -88,6 +88,7 @@ struct macro_scope *
user_macro_scope (void) user_macro_scope (void)
{ {
struct macro_scope *ms; struct macro_scope *ms;
ms = XNEW (struct macro_scope); ms = XNEW (struct macro_scope);
ms->file = macro_main (macro_user_macros); ms->file = macro_main (macro_user_macros);
ms->line = -1; ms->line = -1;

View File

@ -113,6 +113,7 @@ macro_bcache (struct macro_table *t, const void *addr, int len)
else else
{ {
void *copy = xmalloc (len); void *copy = xmalloc (len);
memcpy (copy, addr, len); memcpy (copy, addr, len);
return copy; return copy;
} }
@ -316,6 +317,7 @@ key_compare (struct macro_key *key,
const char *name, struct macro_source_file *file, int line) const char *name, struct macro_source_file *file, int line)
{ {
int names = strcmp (key->name, name); int names = strcmp (key->name, name);
if (names) if (names)
return names; return names;
@ -879,6 +881,7 @@ macro_definition_location (struct macro_source_file *source,
if (n) if (n)
{ {
struct macro_key *key = (struct macro_key *) n->key; struct macro_key *key = (struct macro_key *) n->key;
*definition_line = key->start_line; *definition_line = key->start_line;
return key->start_file; return key->start_file;
} }
@ -905,6 +908,7 @@ foreach_macro (splay_tree_node node, void *arg)
struct macro_for_each_data *datum = (struct macro_for_each_data *) arg; struct macro_for_each_data *datum = (struct macro_for_each_data *) arg;
struct macro_key *key = (struct macro_key *) node->key; struct macro_key *key = (struct macro_key *) node->key;
struct macro_definition *def = (struct macro_definition *) node->value; struct macro_definition *def = (struct macro_definition *) node->value;
(*datum->fn) (key->name, def, datum->user_data); (*datum->fn) (key->name, def, datum->user_data);
return 0; return 0;
} }
@ -915,6 +919,7 @@ macro_for_each (struct macro_table *table, macro_callback_fn fn,
void *user_data) void *user_data)
{ {
struct macro_for_each_data datum; struct macro_for_each_data datum;
datum.fn = fn; datum.fn = fn;
datum.user_data = user_data; datum.user_data = user_data;
datum.file = NULL; datum.file = NULL;
@ -946,6 +951,7 @@ macro_for_each_in_scope (struct macro_source_file *file, int line,
macro_callback_fn fn, void *user_data) macro_callback_fn fn, void *user_data)
{ {
struct macro_for_each_data datum; struct macro_for_each_data datum;
datum.fn = fn; datum.fn = fn;
datum.user_data = user_data; datum.user_data = user_data;
datum.file = file; datum.file = file;

View File

@ -143,6 +143,7 @@ relocate_directory (const char *progname, const char *initial, int flag)
if (*dir) if (*dir)
{ {
char *canon_sysroot = lrealpath (dir); char *canon_sysroot = lrealpath (dir);
if (canon_sysroot) if (canon_sysroot)
{ {
xfree (dir); xfree (dir);
@ -742,6 +743,7 @@ Excess command line arguments ignored. (%s%s)\n"),
{ {
/* Find it. */ /* Find it. */
struct interp *interp = interp_lookup (interpreter_p); struct interp *interp = interp_lookup (interpreter_p);
if (interp == NULL) if (interp == NULL)
error (_("Interpreter `%s' unrecognized"), interpreter_p); error (_("Interpreter `%s' unrecognized"), interpreter_p);
/* Install it. */ /* Install it. */

View File

@ -354,6 +354,7 @@ print_objfile_section_info (bfd *abfd,
{ {
struct gdbarch *gdbarch = gdbarch_from_bfd (abfd); struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
int addr_size = gdbarch_addr_bit (gdbarch) / 8; int addr_size = gdbarch_addr_bit (gdbarch) / 8;
maint_print_section_info (name, flags, maint_print_section_info (name, flags,
obj_section_addr (asect), obj_section_addr (asect),
obj_section_endaddr (asect), obj_section_endaddr (asect),
@ -425,6 +426,7 @@ maintenance_print_architecture (char *args, int from_tty)
{ {
struct cleanup *cleanups; struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w"); struct ui_file *file = gdb_fopen (args, "w");
if (file == NULL) if (file == NULL)
perror_with_name (_("maintenance print architecture")); perror_with_name (_("maintenance print architecture"));
cleanups = make_cleanup_ui_file_delete (file); cleanups = make_cleanup_ui_file_delete (file);
@ -571,7 +573,6 @@ the command you want to undeprecate.\n"));
static void static void
maintenance_do_deprecate (char *text, int deprecate) maintenance_do_deprecate (char *text, int deprecate)
{ {
struct cmd_list_element *alias = NULL; struct cmd_list_element *alias = NULL;
struct cmd_list_element *prefix_cmd = NULL; struct cmd_list_element *prefix_cmd = NULL;
struct cmd_list_element *cmd = NULL; struct cmd_list_element *cmd = NULL;
@ -618,7 +619,6 @@ maintenance_do_deprecate (char *text, int deprecate)
memory. */ memory. */
if (alias) if (alias)
{ {
if (alias->flags & MALLOCED_REPLACEMENT) if (alias->flags & MALLOCED_REPLACEMENT)
xfree (alias->replacement); xfree (alias->replacement);
@ -722,6 +722,7 @@ maintenance_set_profile_cmd (char *args, int from_tty, struct cmd_list_element *
else else
{ {
extern void _mcleanup (void); extern void _mcleanup (void);
_mcleanup (); _mcleanup ();
} }
} }

View File

@ -271,7 +271,6 @@ static char *mdebug_next_symbol_text (struct objfile *);
static void static void
mdebug_psymtab_to_symtab (struct partial_symtab *pst) mdebug_psymtab_to_symtab (struct partial_symtab *pst)
{ {
if (!pst) if (!pst)
return; return;
@ -753,6 +752,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (sh->st == stProc) if (sh->st == stProc)
{ {
struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st); struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
/* The next test should normally be true, but provides a /* The next test should normally be true, but provides a
hook for nested functions (which we don't want to make hook for nested functions (which we don't want to make
global). */ global). */
@ -1154,6 +1154,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i++) for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i++)
{ {
struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i); struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i);
if (BLOCK_SUPERBLOCK (b_bad) == b if (BLOCK_SUPERBLOCK (b_bad) == b
&& BLOCK_START (b_bad) == top_stack->procadr && BLOCK_START (b_bad) == top_stack->procadr
&& BLOCK_END (b_bad) == top_stack->procadr) && BLOCK_END (b_bad) == top_stack->procadr)
@ -1174,6 +1175,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
if (nparams > 0) if (nparams > 0)
{ {
struct dict_iterator iter; struct dict_iterator iter;
TYPE_NFIELDS (ftype) = nparams; TYPE_NFIELDS (ftype) = nparams;
TYPE_FIELDS (ftype) = (struct field *) TYPE_FIELDS (ftype) = (struct field *)
TYPE_ALLOC (ftype, nparams * sizeof (struct field)); TYPE_ALLOC (ftype, nparams * sizeof (struct field));
@ -1576,6 +1578,7 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
if (t->fBitfield) if (t->fBitfield)
{ {
int width = AUX_GET_WIDTH (bigend, ax); int width = AUX_GET_WIDTH (bigend, ax);
/* Inhibit core dumps if TIR is corrupted. */ /* Inhibit core dumps if TIR is corrupted. */
if (bs == (int *) NULL) if (bs == (int *) NULL)
{ {
@ -1663,7 +1666,6 @@ parse_type (int fd, union aux_ext *ax, unsigned int aux_index, int *bs,
} }
else else
{ {
/* Usually, TYPE_CODE(tp) is already type_code. The main /* Usually, TYPE_CODE(tp) is already type_code. The main
exception is if we guessed wrong re struct/union/enum. exception is if we guessed wrong re struct/union/enum.
But for struct vs. union a wrong guess is harmless, so But for struct vs. union a wrong guess is harmless, so
@ -1968,6 +1970,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
the same name exists, lookup_symbol will eventually read in the symtab the same name exists, lookup_symbol will eventually read in the symtab
for the global function and clobber cur_fdr. */ for the global function and clobber cur_fdr. */
FDR *save_cur_fdr = cur_fdr; FDR *save_cur_fdr = cur_fdr;
s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0); s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0);
cur_fdr = save_cur_fdr; cur_fdr = save_cur_fdr;
#else #else
@ -2401,6 +2404,7 @@ parse_partial_symbols (struct objfile *objfile)
fdr_to_pst++; fdr_to_pst++;
{ {
struct partial_symtab *pst = new_psymtab ("", objfile); struct partial_symtab *pst = new_psymtab ("", objfile);
fdr_to_pst[-1].pst = pst; fdr_to_pst[-1].pst = pst;
FDR_IDX (pst) = -1; FDR_IDX (pst) = -1;
} }
@ -2809,6 +2813,7 @@ parse_partial_symbols (struct objfile *objfile)
{ {
char *stabstring = debug_info->ss + fh->issBase + sh.iss; char *stabstring = debug_info->ss + fh->issBase + sh.iss;
int len = strlen (stabstring); int len = strlen (stabstring);
while (stabstring[len - 1] == '\\') while (stabstring[len - 1] == '\\')
{ {
SYMR sh2; SYMR sh2;
@ -2845,6 +2850,7 @@ parse_partial_symbols (struct objfile *objfile)
switch (type_code) switch (type_code)
{ {
char *p; char *p;
/* /*
* Standard, external, non-debugger, symbols * Standard, external, non-debugger, symbols
*/ */
@ -2951,7 +2957,7 @@ parse_partial_symbols (struct objfile *objfile)
past_first_source_file = 1; past_first_source_file = 1;
if (prev_so_symnum != symnum - 1) if (prev_so_symnum != symnum - 1)
{ /* Here if prev stab wasn't N_SO */ { /* Here if prev stab wasn't N_SO */
first_so_symnum = symnum; first_so_symnum = symnum;
if (pst) if (pst)
@ -2997,6 +3003,7 @@ parse_partial_symbols (struct objfile *objfile)
case N_SOL: case N_SOL:
{ {
enum language tmp_language; enum language tmp_language;
/* Mark down an include file in the current psymtab */ /* Mark down an include file in the current psymtab */
/* SET_NAMESTRING ();*/ /* SET_NAMESTRING ();*/
@ -3025,8 +3032,10 @@ parse_partial_symbols (struct objfile *objfile)
in a binary tree, if profiling shows this is a major hog). */ in a binary tree, if profiling shows this is a major hog). */
if (pst && strcmp (namestring, pst->filename) == 0) if (pst && strcmp (namestring, pst->filename) == 0)
continue; continue;
{ {
int i; int i;
for (i = 0; i < includes_used; i++) for (i = 0; i < includes_used; i++)
if (strcmp (namestring, if (strcmp (namestring,
psymtab_include_list[i]) == 0) psymtab_include_list[i]) == 0)
@ -3232,6 +3241,7 @@ parse_partial_symbols (struct objfile *objfile)
{ {
int name_len = p - namestring; int name_len = p - namestring;
char *name = xmalloc (name_len + 1); char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len); memcpy (name, namestring, name_len);
name[name_len] = '\0'; name[name_len] = '\0';
function_outside_compilation_unit_complaint (name); function_outside_compilation_unit_complaint (name);
@ -3253,6 +3263,7 @@ parse_partial_symbols (struct objfile *objfile)
{ {
int name_len = p - namestring; int name_len = p - namestring;
char *name = xmalloc (name_len + 1); char *name = xmalloc (name_len + 1);
memcpy (name, namestring, name_len); memcpy (name, namestring, name_len);
name[name_len] = '\0'; name[name_len] = '\0';
function_outside_compilation_unit_complaint (name); function_outside_compilation_unit_complaint (name);
@ -4031,9 +4042,9 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
/* Make up special symbol to contain /* Make up special symbol to contain
procedure specific info */ procedure specific info */
struct mdebug_extra_func_info *e = struct mdebug_extra_func_info *e =
((struct mdebug_extra_func_info *) ((struct mdebug_extra_func_info *)
obstack_alloc (&current_objfile->objfile_obstack, obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct mdebug_extra_func_info))); sizeof (struct mdebug_extra_func_info)));
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME); struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
memset (e, 0, sizeof (struct mdebug_extra_func_info)); memset (e, 0, sizeof (struct mdebug_extra_func_info));
@ -4730,7 +4741,6 @@ new_linetable (int size)
static struct linetable * static struct linetable *
shrink_linetable (struct linetable *lt) shrink_linetable (struct linetable *lt)
{ {
return (struct linetable *) xrealloc ((void *) lt, return (struct linetable *) xrealloc ((void *) lt,
(sizeof (struct linetable) (sizeof (struct linetable)
+ ((lt->nitems - 1) + ((lt->nitems - 1)

View File

@ -440,6 +440,7 @@ mem_info_command (char *args, int from_tty)
for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++) for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
{ {
char *tmp; char *tmp;
printf_filtered ("%-3d %-3c\t", printf_filtered ("%-3d %-3c\t",
m->number, m->number,
m->enabled_p ? 'y' : 'n'); m->enabled_p ? 'y' : 'n');
@ -452,17 +453,17 @@ mem_info_command (char *args, int from_tty)
if (gdbarch_addr_bit (target_gdbarch) <= 32) if (gdbarch_addr_bit (target_gdbarch) <= 32)
{ {
if (m->hi == 0) if (m->hi == 0)
tmp = "0x100000000"; tmp = "0x100000000";
else else
tmp = hex_string_custom ((unsigned long) m->hi, 8); tmp = hex_string_custom ((unsigned long) m->hi, 8);
} }
else else
{ {
if (m->hi == 0) if (m->hi == 0)
tmp = "0x10000000000000000"; tmp = "0x10000000000000000";
else else
tmp = hex_string_custom ((unsigned long) m->hi, 16); tmp = hex_string_custom ((unsigned long) m->hi, 16);
} }
printf_filtered ("%s ", tmp); printf_filtered ("%s ", tmp);

View File

@ -82,6 +82,7 @@ unsigned int
msymbol_hash_iw (const char *string) msymbol_hash_iw (const char *string)
{ {
unsigned int hash = 0; unsigned int hash = 0;
while (*string && *string != '(') while (*string && *string != '(')
{ {
while (isspace (*string)) while (isspace (*string))
@ -101,6 +102,7 @@ unsigned int
msymbol_hash (const char *string) msymbol_hash (const char *string)
{ {
unsigned int hash = 0; unsigned int hash = 0;
for (; *string; ++string) for (; *string; ++string)
hash = hash * 67 + *string - 113; hash = hash * 67 + *string - 113;
return hash; return hash;
@ -115,6 +117,7 @@ add_minsym_to_hash_table (struct minimal_symbol *sym,
{ {
unsigned int hash unsigned int hash
= msymbol_hash (SYMBOL_LINKAGE_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE; = msymbol_hash (SYMBOL_LINKAGE_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
sym->hash_next = table[hash]; sym->hash_next = table[hash];
table[hash] = sym; table[hash] = sym;
} }
@ -130,6 +133,7 @@ add_minsym_to_demangled_hash_table (struct minimal_symbol *sym,
{ {
unsigned int hash unsigned int hash
= msymbol_hash_iw (SYMBOL_SEARCH_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE; = msymbol_hash_iw (SYMBOL_SEARCH_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
sym->demangled_hash_next = table[hash]; sym->demangled_hash_next = table[hash];
table[hash] = sym; table[hash] = sym;
} }
@ -195,6 +199,7 @@ lookup_minimal_symbol (const char *name, const char *sfile,
if (sfile != NULL) if (sfile != NULL)
{ {
char *p = strrchr (sfile, '/'); char *p = strrchr (sfile, '/');
if (p != NULL) if (p != NULL)
sfile = p + 1; sfile = p + 1;
} }
@ -204,6 +209,7 @@ lookup_minimal_symbol (const char *name, const char *sfile,
if (current_language->la_language == language_cplus) if (current_language->la_language == language_cplus)
{ {
char *cname = cp_canonicalize_string (name); char *cname = cp_canonicalize_string (name);
if (cname) if (cname)
{ {
modified_name = cname; modified_name = cname;
@ -1161,6 +1167,7 @@ install_minimal_symbols (struct objfile *objfile)
mixing ABIs then the user will need to "set cp-abi" mixing ABIs then the user will need to "set cp-abi"
manually. */ manually. */
const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]); const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
if (name[0] == '_' && name[1] == 'Z' if (name[0] == '_' && name[1] == 'Z'
&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL) && SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
{ {
@ -1239,6 +1246,7 @@ find_solib_trampoline_target (struct frame_info *frame, CORE_ADDR pc)
SYMBOL_LINKAGE_NAME (tsymbol)) == 0) SYMBOL_LINKAGE_NAME (tsymbol)) == 0)
{ {
CORE_ADDR func; CORE_ADDR func;
func = gdbarch_convert_from_func_ptr_addr func = gdbarch_convert_from_func_ptr_addr
(get_objfile_arch (objfile), (get_objfile_arch (objfile),
SYMBOL_VALUE_ADDRESS (msymbol), SYMBOL_VALUE_ADDRESS (msymbol),

View File

@ -133,6 +133,7 @@ monitor_debug (const char *fmt, ...)
if (monitor_debug_p) if (monitor_debug_p)
{ {
va_list args; va_list args;
va_start (args, fmt); va_start (args, fmt);
vfprintf_filtered (gdb_stdlog, fmt, args); vfprintf_filtered (gdb_stdlog, fmt, args);
va_end (args); va_end (args);
@ -212,6 +213,7 @@ monitor_error (char *function, char *message,
{ {
int real_len = (len == 0 && string != (char *) 0) ? strlen (string) : len; int real_len = (len == 0 && string != (char *) 0) ? strlen (string) : len;
char *safe_string = alloca ((real_len * 4) + 1); char *safe_string = alloca ((real_len * 4) + 1);
monitor_printable_string (safe_string, string, real_len); monitor_printable_string (safe_string, string, real_len);
if (final_char) if (final_char)
@ -326,6 +328,7 @@ monitor_printf_noecho (char *pattern,...)
if (monitor_debug_p) if (monitor_debug_p)
{ {
char *safe_string = (char *) alloca ((strlen (sndbuf) * 4) + 1); char *safe_string = (char *) alloca ((strlen (sndbuf) * 4) + 1);
monitor_printable_string (safe_string, sndbuf, 0); monitor_printable_string (safe_string, sndbuf, 0);
fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string); fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string);
} }
@ -354,6 +357,7 @@ monitor_printf (char *pattern,...)
if (monitor_debug_p) if (monitor_debug_p)
{ {
char *safe_string = (char *) alloca ((len * 4) + 1); char *safe_string = (char *) alloca ((len * 4) + 1);
monitor_printable_string (safe_string, sndbuf, 0); monitor_printable_string (safe_string, sndbuf, 0);
fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string); fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string);
} }
@ -437,6 +441,7 @@ readchar (int timeout)
if (monitor_debug_p || remote_debug) if (monitor_debug_p || remote_debug)
{ {
char buf[2]; char buf[2];
buf[0] = c; buf[0] = c;
buf[1] = '\0'; buf[1] = '\0';
puts_debug ("read -->", buf, "<--"); puts_debug ("read -->", buf, "<--");
@ -594,6 +599,7 @@ monitor_expect_regexp (struct re_pattern_buffer *pat, char *buf, int buflen)
{ {
char *mybuf; char *mybuf;
char *p; char *p;
monitor_debug ("MON Expecting regexp\n"); monitor_debug ("MON Expecting regexp\n");
if (buf) if (buf)
mybuf = buf; mybuf = buf;
@ -960,6 +966,7 @@ parse_register_dump (struct regcache *regcache, char *buf, int len)
{ {
int regnamelen, vallen; int regnamelen, vallen;
char *regname, *val; char *regname, *val;
/* Element 0 points to start of register name, and element 1 /* Element 0 points to start of register name, and element 1
points to the start of the register value. */ points to the start of the register value. */
struct re_registers register_strings; struct re_registers register_strings;
@ -1044,6 +1051,7 @@ monitor_wait_filter (char *buf,
struct target_waitstatus *status) struct target_waitstatus *status)
{ {
int resp_len; int resp_len;
do do
{ {
resp_len = monitor_expect_prompt (buf, bufmax); resp_len = monitor_expect_prompt (buf, bufmax);
@ -1206,6 +1214,7 @@ monitor_fetch_register (struct regcache *regcache, int regno)
if (current_monitor->flags & MO_HEX_PREFIX) if (current_monitor->flags & MO_HEX_PREFIX)
{ {
int c; int c;
c = readchar (timeout); c = readchar (timeout);
while (c == ' ') while (c == ' ')
c = readchar (timeout); c = readchar (timeout);
@ -1223,6 +1232,7 @@ monitor_fetch_register (struct regcache *regcache, int regno)
for (i = 0; i < register_size (get_regcache_arch (regcache), regno) * 2; i++) for (i = 0; i < register_size (get_regcache_arch (regcache), regno) * 2; i++)
{ {
int c; int c;
c = readchar (timeout); c = readchar (timeout);
while (c == ' ') while (c == ' ')
c = readchar (timeout); c = readchar (timeout);
@ -1268,6 +1278,7 @@ monitor_dump_reg_block (struct regcache *regcache, char *block_cmd)
{ {
char buf[TARGET_BUF_SIZE]; char buf[TARGET_BUF_SIZE];
int resp_len; int resp_len;
monitor_printf (block_cmd); monitor_printf (block_cmd);
resp_len = monitor_expect_prompt (buf, sizeof (buf)); resp_len = monitor_expect_prompt (buf, sizeof (buf));
parse_register_dump (regcache, buf, resp_len); parse_register_dump (regcache, buf, resp_len);
@ -1283,6 +1294,7 @@ monitor_dump_regs (struct regcache *regcache)
{ {
char buf[TARGET_BUF_SIZE]; char buf[TARGET_BUF_SIZE];
int resp_len; int resp_len;
if (current_monitor->dumpregs) if (current_monitor->dumpregs)
(*(current_monitor->dumpregs)) (regcache); /* call supplied function */ (*(current_monitor->dumpregs)) (regcache); /* call supplied function */
else if (current_monitor->dump_registers) /* default version */ else if (current_monitor->dump_registers) /* default version */
@ -1483,7 +1495,6 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
monitor_printf_noecho (cmd, memaddr, val); monitor_printf_noecho (cmd, memaddr, val);
else if (current_monitor->flags & MO_SETMEM_INTERACTIVE) else if (current_monitor->flags & MO_SETMEM_INTERACTIVE)
{ {
monitor_printf_noecho (cmd, memaddr); monitor_printf_noecho (cmd, memaddr);
if (current_monitor->setmem.resp_delim) if (current_monitor->setmem.resp_delim)
@ -1499,7 +1510,7 @@ monitor_write_memory (CORE_ADDR memaddr, char *myaddr, int len)
monitor_printf ("%x\r", val); monitor_printf ("%x\r", val);
} }
if (current_monitor->setmem.term_cmd) if (current_monitor->setmem.term_cmd)
{ /* Emit this to get out of the memory editing state */ { /* Emit this to get out of the memory editing state */
monitor_printf ("%s", current_monitor->setmem.term_cmd); monitor_printf ("%s", current_monitor->setmem.term_cmd);
/* Drop through to expecting a prompt */ /* Drop through to expecting a prompt */
} }
@ -1518,6 +1529,7 @@ monitor_write_memory_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{ {
unsigned char val; unsigned char val;
int written = 0; int written = 0;
if (len == 0) if (len == 0)
return 0; return 0;
/* Enter the sub mode */ /* Enter the sub mode */
@ -1546,6 +1558,7 @@ longlongendswap (unsigned char *a)
{ {
int i, j; int i, j;
unsigned char x; unsigned char x;
i = 0; i = 0;
j = 7; j = 7;
while (i < 4) while (i < 4)
@ -1573,10 +1586,12 @@ longlong_hexchars (unsigned long long value,
unsigned char *scan, *limit; /* loop controls */ unsigned char *scan, *limit; /* loop controls */
unsigned char c, nib; unsigned char c, nib;
int leadzero = 1; int leadzero = 1;
scan = disbuf; scan = disbuf;
limit = scan + 8; limit = scan + 8;
{ {
unsigned long long *dp; unsigned long long *dp;
dp = (unsigned long long *) scan; dp = (unsigned long long *) scan;
*dp = value; *dp = value;
} }
@ -1613,6 +1628,7 @@ monitor_write_memory_longlongs (CORE_ADDR memaddr, char *myaddr, int len)
long long *llptr; long long *llptr;
long long value; long long value;
int written = 0; int written = 0;
llptr = (unsigned long long *) myaddr; llptr = (unsigned long long *) myaddr;
if (len == 0) if (len == 0)
return 0; return 0;
@ -1657,6 +1673,7 @@ static int
monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len) monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
{ {
int written; int written;
written = 0; written = 0;
/* FIXME: This would be a good place to put the zero test */ /* FIXME: This would be a good place to put the zero test */
#if 1 #if 1
@ -1744,6 +1761,7 @@ monitor_read_memory_single (CORE_ADDR memaddr, char *myaddr, int len)
{ {
int i; int i;
for (i = 0; i < len * 2; i++) for (i = 0; i < len * 2; i++)
{ {
int c; int c;
@ -1883,6 +1901,7 @@ monitor_read_memory (CORE_ADDR memaddr, char *myaddr, int len)
{ {
int retval, tmp; int retval, tmp;
struct re_registers resp_strings; struct re_registers resp_strings;
monitor_debug ("MON getmem.resp_delim %s\n", current_monitor->getmem.resp_delim); monitor_debug ("MON getmem.resp_delim %s\n", current_monitor->getmem.resp_delim);
memset (&resp_strings, 0, sizeof (struct re_registers)); memset (&resp_strings, 0, sizeof (struct re_registers));