* 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-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>
* jv-lang.c: White space.
struct value *arg1;
struct value *arg2;
struct type *type;
+
switch (op)
{
case UNOP_HIGH:
if (m2_is_unbounded_array (type))
{
struct value *temp = arg1;
+
type = TYPE_FIELD_TYPE (type, 1);
/* i18n: Do not translate the "_m2_high" part! */
arg1 = value_struct_elt (&temp, NULL, "_m2_high", NULL,
{
struct value *temp = arg1;
type = TYPE_FIELD_TYPE (type, 0);
- 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);
- }
+ 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);
+ }
/* i18n: Do not translate the "_m2_contents" part! */
arg1 = value_struct_elt (&temp, NULL, "_m2_contents", NULL,
_("unbounded structure "
{
struct value *deref_val =
value_at (TYPE_TARGET_TYPE (type), unpack_pointer (type, valaddr));
+
common_val_print (deref_val, stream, recurse, options, current_language);
}
else
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (type, valaddr + embedded_offset));
+
common_val_print (deref_val, stream, recurse, options,
current_language);
}
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
if (options->format || options->output_format)
{
struct value_print_options opts = *options;
+
opts.format = (options->format ? options->format
: options->output_format);
print_scalar_formatted (valaddr + embedded_offset, type,
{
int element = value_bit_index (type, valaddr + embedded_offset,
i);
+
if (element < 0)
{
i = element;
++i))
{
int j = i;
+
fputs_filtered ("..", stream);
while (i + 1 <= high_bound
&& value_bit_index (type,
struct macro_scope *ms = NULL;
char *expanded = NULL;
struct cleanup *cleanup_chain = make_cleanup (free_current_contents, &ms);
+
make_cleanup (free_current_contents, &expanded);
/* You know, when the user doesn't specify any expression, it would be
{
int i;
struct macro_definition *loc = (struct macro_definition *) ptr;
+
for (i = 0; i < loc->argc; ++i)
xfree ((char *) loc->argv[i]);
xfree ((char *) loc->argv);
if (macro->kind == macro_function_like)
{
int i;
+
fprintf_filtered (gdb_stdout, "(");
for (i = 0; i < macro->argc; ++i)
fprintf_filtered (gdb_stdout, "%s%s", (i > 0) ? ", " : "",
{
/* How many characters did we consume, including whitespace? */
int consumed = p - src->text + tok->len;
+
src->text += consumed;
src->len -= consumed;
return 1;
paren. */
{
struct macro_buffer temp;
+
init_shared_buffer (&temp, src->text, src->len);
if (! get_token (&tok, &temp)
{
int arg = find_parameter (&tok, is_varargs, va_arg_name,
def->argc, def->argv);
+
if (arg != -1)
appendmem (dest, argv[arg].text, argv[arg].len);
else
{
int arg = find_parameter (&tok, is_varargs, va_arg_name,
def->argc, def->argv);
+
if (arg != -1)
appendmem (dest, argv[arg].text, argv[arg].len);
else
else
{
int len = strlen (def->argv[def->argc - 1]);
+
if (len > 3
&& strcmp (def->argv[def->argc - 1] + len - 3, "...") == 0)
{
lookup function expects. */
char *id = xmalloc (src_first->len + 1);
struct cleanup *back_to = make_cleanup (xfree, id);
+
memcpy (id, src_first->text, src_first->len);
id[src_first->len] = 0;
user_macro_scope (void)
{
struct macro_scope *ms;
+
ms = XNEW (struct macro_scope);
ms->file = macro_main (macro_user_macros);
ms->line = -1;
else
{
void *copy = xmalloc (len);
+
memcpy (copy, addr, len);
return copy;
}
const char *name, struct macro_source_file *file, int line)
{
int names = strcmp (key->name, name);
+
if (names)
return names;
if (n)
{
struct macro_key *key = (struct macro_key *) n->key;
+
*definition_line = key->start_line;
return key->start_file;
}
struct macro_for_each_data *datum = (struct macro_for_each_data *) arg;
struct macro_key *key = (struct macro_key *) node->key;
struct macro_definition *def = (struct macro_definition *) node->value;
+
(*datum->fn) (key->name, def, datum->user_data);
return 0;
}
void *user_data)
{
struct macro_for_each_data datum;
+
datum.fn = fn;
datum.user_data = user_data;
datum.file = NULL;
macro_callback_fn fn, void *user_data)
{
struct macro_for_each_data datum;
+
datum.fn = fn;
datum.user_data = user_data;
datum.file = file;
if (*dir)
{
char *canon_sysroot = lrealpath (dir);
+
if (canon_sysroot)
{
xfree (dir);
{
/* Find it. */
struct interp *interp = interp_lookup (interpreter_p);
+
if (interp == NULL)
error (_("Interpreter `%s' unrecognized"), interpreter_p);
/* Install it. */
{
struct gdbarch *gdbarch = gdbarch_from_bfd (abfd);
int addr_size = gdbarch_addr_bit (gdbarch) / 8;
+
maint_print_section_info (name, flags,
obj_section_addr (asect),
obj_section_endaddr (asect),
{
struct cleanup *cleanups;
struct ui_file *file = gdb_fopen (args, "w");
+
if (file == NULL)
perror_with_name (_("maintenance print architecture"));
cleanups = make_cleanup_ui_file_delete (file);
static void
maintenance_do_deprecate (char *text, int deprecate)
{
-
struct cmd_list_element *alias = NULL;
struct cmd_list_element *prefix_cmd = NULL;
struct cmd_list_element *cmd = NULL;
memory. */
if (alias)
{
-
if (alias->flags & MALLOCED_REPLACEMENT)
xfree (alias->replacement);
else
{
extern void _mcleanup (void);
+
_mcleanup ();
}
}
static void
mdebug_psymtab_to_symtab (struct partial_symtab *pst)
{
-
if (!pst)
return;
if (sh->st == stProc)
{
struct blockvector *bv = BLOCKVECTOR (top_stack->cur_st);
+
/* The next test should normally be true, but provides a
hook for nested functions (which we don't want to make
global). */
for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); i++)
{
struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i);
+
if (BLOCK_SUPERBLOCK (b_bad) == b
&& BLOCK_START (b_bad) == top_stack->procadr
&& BLOCK_END (b_bad) == top_stack->procadr)
if (nparams > 0)
{
struct dict_iterator iter;
+
TYPE_NFIELDS (ftype) = nparams;
TYPE_FIELDS (ftype) = (struct field *)
TYPE_ALLOC (ftype, nparams * sizeof (struct field));
if (t->fBitfield)
{
int width = AUX_GET_WIDTH (bigend, ax);
+
/* Inhibit core dumps if TIR is corrupted. */
if (bs == (int *) NULL)
{
}
else
{
-
/* Usually, TYPE_CODE(tp) is already type_code. The main
exception is if we guessed wrong re struct/union/enum.
But for struct vs. union a wrong guess is harmless, so
the same name exists, lookup_symbol will eventually read in the symtab
for the global function and clobber cur_fdr. */
FDR *save_cur_fdr = cur_fdr;
+
s = lookup_symbol (sh_name, NULL, VAR_DOMAIN, 0);
cur_fdr = save_cur_fdr;
#else
fdr_to_pst++;
{
struct partial_symtab *pst = new_psymtab ("", objfile);
+
fdr_to_pst[-1].pst = pst;
FDR_IDX (pst) = -1;
}
{
char *stabstring = debug_info->ss + fh->issBase + sh.iss;
int len = strlen (stabstring);
+
while (stabstring[len - 1] == '\\')
{
SYMR sh2;
switch (type_code)
{
char *p;
+
/*
* Standard, external, non-debugger, symbols
*/
past_first_source_file = 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;
if (pst)
case N_SOL:
{
enum language tmp_language;
+
/* Mark down an include file in the current psymtab */
/* SET_NAMESTRING ();*/
in a binary tree, if profiling shows this is a major hog). */
if (pst && strcmp (namestring, pst->filename) == 0)
continue;
+
{
int i;
+
for (i = 0; i < includes_used; i++)
if (strcmp (namestring,
psymtab_include_list[i]) == 0)
{
int name_len = p - namestring;
char *name = xmalloc (name_len + 1);
+
memcpy (name, namestring, name_len);
name[name_len] = '\0';
function_outside_compilation_unit_complaint (name);
{
int name_len = p - namestring;
char *name = xmalloc (name_len + 1);
+
memcpy (name, namestring, name_len);
name[name_len] = '\0';
function_outside_compilation_unit_complaint (name);
/* Make up special symbol to contain
procedure specific info */
struct mdebug_extra_func_info *e =
- ((struct mdebug_extra_func_info *)
- obstack_alloc (¤t_objfile->objfile_obstack,
- sizeof (struct mdebug_extra_func_info)));
+ ((struct mdebug_extra_func_info *)
+ obstack_alloc (¤t_objfile->objfile_obstack,
+ sizeof (struct mdebug_extra_func_info)));
struct symbol *s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
memset (e, 0, sizeof (struct mdebug_extra_func_info));
static struct linetable *
shrink_linetable (struct linetable *lt)
{
-
return (struct linetable *) xrealloc ((void *) lt,
(sizeof (struct linetable)
+ ((lt->nitems - 1)
for (ix = 0; VEC_iterate (mem_region_s, mem_region_list, ix, m); ix++)
{
char *tmp;
+
printf_filtered ("%-3d %-3c\t",
m->number,
m->enabled_p ? 'y' : 'n');
if (gdbarch_addr_bit (target_gdbarch) <= 32)
{
- if (m->hi == 0)
- tmp = "0x100000000";
- else
- tmp = hex_string_custom ((unsigned long) m->hi, 8);
+ if (m->hi == 0)
+ tmp = "0x100000000";
+ else
+ tmp = hex_string_custom ((unsigned long) m->hi, 8);
}
else
{
- if (m->hi == 0)
- tmp = "0x10000000000000000";
- else
- tmp = hex_string_custom ((unsigned long) m->hi, 16);
+ if (m->hi == 0)
+ tmp = "0x10000000000000000";
+ else
+ tmp = hex_string_custom ((unsigned long) m->hi, 16);
}
printf_filtered ("%s ", tmp);
msymbol_hash_iw (const char *string)
{
unsigned int hash = 0;
+
while (*string && *string != '(')
{
while (isspace (*string))
msymbol_hash (const char *string)
{
unsigned int hash = 0;
+
for (; *string; ++string)
hash = hash * 67 + *string - 113;
return hash;
{
unsigned int hash
= msymbol_hash (SYMBOL_LINKAGE_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
+
sym->hash_next = table[hash];
table[hash] = sym;
}
{
unsigned int hash
= msymbol_hash_iw (SYMBOL_SEARCH_NAME (sym)) % MINIMAL_SYMBOL_HASH_SIZE;
+
sym->demangled_hash_next = table[hash];
table[hash] = sym;
}
if (sfile != NULL)
{
char *p = strrchr (sfile, '/');
+
if (p != NULL)
sfile = p + 1;
}
if (current_language->la_language == language_cplus)
{
char *cname = cp_canonicalize_string (name);
+
if (cname)
{
modified_name = cname;
mixing ABIs then the user will need to "set cp-abi"
manually. */
const char *name = SYMBOL_LINKAGE_NAME (&objfile->msymbols[i]);
+
if (name[0] == '_' && name[1] == 'Z'
&& SYMBOL_DEMANGLED_NAME (&objfile->msymbols[i]) != NULL)
{
SYMBOL_LINKAGE_NAME (tsymbol)) == 0)
{
CORE_ADDR func;
+
func = gdbarch_convert_from_func_ptr_addr
(get_objfile_arch (objfile),
SYMBOL_VALUE_ADDRESS (msymbol),
if (monitor_debug_p)
{
va_list args;
+
va_start (args, fmt);
vfprintf_filtered (gdb_stdlog, fmt, args);
va_end (args);
{
int real_len = (len == 0 && string != (char *) 0) ? strlen (string) : len;
char *safe_string = alloca ((real_len * 4) + 1);
+
monitor_printable_string (safe_string, string, real_len);
if (final_char)
if (monitor_debug_p)
{
char *safe_string = (char *) alloca ((strlen (sndbuf) * 4) + 1);
+
monitor_printable_string (safe_string, sndbuf, 0);
fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string);
}
if (monitor_debug_p)
{
char *safe_string = (char *) alloca ((len * 4) + 1);
+
monitor_printable_string (safe_string, sndbuf, 0);
fprintf_unfiltered (gdb_stdlog, "sent[%s]\n", safe_string);
}
if (monitor_debug_p || remote_debug)
{
char buf[2];
+
buf[0] = c;
buf[1] = '\0';
puts_debug ("read -->", buf, "<--");
{
char *mybuf;
char *p;
+
monitor_debug ("MON Expecting regexp\n");
if (buf)
mybuf = buf;
{
int regnamelen, vallen;
char *regname, *val;
+
/* Element 0 points to start of register name, and element 1
points to the start of the register value. */
struct re_registers register_strings;
struct target_waitstatus *status)
{
int resp_len;
+
do
{
resp_len = monitor_expect_prompt (buf, bufmax);
if (current_monitor->flags & MO_HEX_PREFIX)
{
int c;
+
c = readchar (timeout);
while (c == ' ')
c = readchar (timeout);
for (i = 0; i < register_size (get_regcache_arch (regcache), regno) * 2; i++)
{
int c;
+
c = readchar (timeout);
while (c == ' ')
c = readchar (timeout);
{
char buf[TARGET_BUF_SIZE];
int resp_len;
+
monitor_printf (block_cmd);
resp_len = monitor_expect_prompt (buf, sizeof (buf));
parse_register_dump (regcache, buf, resp_len);
{
char buf[TARGET_BUF_SIZE];
int resp_len;
+
if (current_monitor->dumpregs)
(*(current_monitor->dumpregs)) (regcache); /* call supplied function */
else if (current_monitor->dump_registers) /* default version */
monitor_printf_noecho (cmd, memaddr, val);
else if (current_monitor->flags & MO_SETMEM_INTERACTIVE)
{
-
monitor_printf_noecho (cmd, memaddr);
if (current_monitor->setmem.resp_delim)
monitor_printf ("%x\r", val);
}
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);
/* Drop through to expecting a prompt */
}
{
unsigned char val;
int written = 0;
+
if (len == 0)
return 0;
/* Enter the sub mode */
{
int i, j;
unsigned char x;
+
i = 0;
j = 7;
while (i < 4)
unsigned char *scan, *limit; /* loop controls */
unsigned char c, nib;
int leadzero = 1;
+
scan = disbuf;
limit = scan + 8;
{
unsigned long long *dp;
+
dp = (unsigned long long *) scan;
*dp = value;
}
long long *llptr;
long long value;
int written = 0;
+
llptr = (unsigned long long *) myaddr;
if (len == 0)
return 0;
monitor_write_memory_block (CORE_ADDR memaddr, char *myaddr, int len)
{
int written;
+
written = 0;
/* FIXME: This would be a good place to put the zero test */
#if 1
{
int i;
+
for (i = 0; i < len * 2; i++)
{
int c;
{
int retval, tmp;
struct re_registers resp_strings;
+
monitor_debug ("MON getmem.resp_delim %s\n", current_monitor->getmem.resp_delim);
memset (&resp_strings, 0, sizeof (struct re_registers));