* parse.c: White space.
* p-lang.c: White space.
* posix-hdep.c: White space.
* printcmd.c: White space.
* progspace.c: White space.
* prologue-value.c: White space.
* psymtab.c: White space.
* p-typeprint.c: White space.
* p-valprint.c: White space.
2010-05-15 Michael Snyder <msnyder@vmware.com>
+ * parse.c: White space.
+ * p-lang.c: White space.
+ * posix-hdep.c: White space.
+ * printcmd.c: White space.
+ * progspace.c: White space.
+ * prologue-value.c: White space.
+ * psymtab.c: White space.
+ * p-typeprint.c: White space.
+ * p-valprint.c: White space.
+
* objc-lang.c: White space.
* objfiles.c: White space.
* observer.c: White space.
if (char_type)
{
*char_type = TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (type, 2));
+
if (TYPE_CODE (*char_type) == TYPE_CODE_ARRAY)
*char_type = TYPE_TARGET_TYPE (*char_type);
}
static void
pascal_one_char (int c, struct ui_file *stream, int *in_quotes)
{
-
if (c == '\'' || ((unsigned int) c <= 0xff && (PRINT_LITERAL_FORM (c))))
{
if (!(*in_quotes))
pascal_emit_char (int c, struct type *type, struct ui_file *stream, int quoter)
{
int in_quotes = 0;
+
pascal_one_char (c, stream, &in_quotes);
if (in_quotes)
fputs_filtered ("'", stream);
pascal_printchar (int c, struct type *type, struct ui_file *stream)
{
int in_quotes = 0;
+
pascal_one_char (c, stream, &in_quotes);
if (in_quotes)
fputs_filtered ("'", stream);
struct language_arch_info *lai)
{
const struct builtin_type *builtin = builtin_type (gdbarch);
+
lai->string_char_type = builtin->builtin_char;
lai->primitive_type_vector
= GDBARCH_OBSTACK_CALLOC (gdbarch, nr_pascal_primitive_types + 1,
pascal_print_func_args (struct type *type, struct ui_file *stream)
{
int i, len = TYPE_NFIELDS (type);
+
if (len)
{
fprintf_filtered (stream, "(");
s_none, s_public, s_private, s_protected
}
section_type;
- QUIT;
+ QUIT;
wrap_here (" ");
if (type == NULL)
{
case TYPE_CODE_RANGE:
{
struct type *target = TYPE_TARGET_TYPE (type);
+
print_type_scalar (target, TYPE_LOW_BOUND (type), stream);
fputs_filtered ("..", stream);
print_type_scalar (target, TYPE_HIGH_BOUND (type), stream);
{
ULONGEST string_length;
void *buffer;
+
buffer = xmalloc (length_size);
read_memory (addr + length_pos, buffer, length_size);
string_length = extract_unsigned_integer (buffer, length_size,
{
/* print vtbl's nicely */
CORE_ADDR vt_address = unpack_pointer (type, valaddr + embedded_offset);
-
struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (vt_address);
+ lookup_minimal_symbol_by_pc (vt_address);
+
if ((msymbol != NULL)
&& (vt_address == SYMBOL_VALUE_ADDRESS (msymbol)))
{
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (type, valaddr + embedded_offset));
+ value_at
+ (TYPE_TARGET_TYPE (type),
+ unpack_pointer (type, valaddr + embedded_offset));
+
common_val_print (deref_val, stream, recurse + 1, 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,
for (i = low_bound; i <= high_bound; i++)
{
int element = value_bit_index (type, valaddr + embedded_offset, i);
+
if (element < 0)
{
i = element;
if (i + 1 <= high_bound && value_bit_index (type, valaddr + embedded_offset, ++i))
{
int j = i;
+
fputs_filtered ("..", stream);
while (i + 1 <= high_bound
&& value_bit_index (type, valaddr + embedded_offset, ++i))
else
{
struct value_print_options opts = *options;
+
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
{
/* struct value *v = value_static_field (type, i); v4.17 specific */
struct value *v;
+
v = value_from_longest (TYPE_FIELD_TYPE (type, i),
unpack_field_as_long (type, valaddr, i));
else
{
struct value_print_options opts = *options;
+
opts.deref_ref = 0;
/* val_print (TYPE_FIELD_TYPE (type, i),
valaddr + TYPE_FIELD_BITPOS (type, i) / 8,
struct type **dont_print_vb)
{
struct type **last_dont_print
- = (struct type **) obstack_next_free (&dont_print_vb_obstack);
+ = (struct type **) obstack_next_free (&dont_print_vb_obstack);
struct obstack tmp_obstack = dont_print_vb_obstack;
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
if (BASETYPE_VIA_VIRTUAL (type, i))
{
struct type **first_dont_print
- = (struct type **) obstack_base (&dont_print_vb_obstack);
+ = (struct type **) obstack_base (&dont_print_vb_obstack);
int j = (struct type **) obstack_next_free (&dont_print_vb_obstack)
- - first_dont_print;
+ - first_dont_print;
while (--j >= 0)
if (baseclass == first_dont_print[j])
{
/* FIXME (alloc): not safe is baseclass is really really big. */
gdb_byte *buf = alloca (TYPE_LENGTH (baseclass));
+
base_valaddr = buf;
if (target_read_memory (address + boffset, buf,
TYPE_LENGTH (baseclass)) != 0)
{
int val = arglist_len;
struct funcall *call = funcall_chain;
+
funcall_chain = call->next;
arglist_len = call->arglist_len;
xfree (call);
write_exp_elt_opcode (enum exp_opcode expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.opcode = expelt;
-
write_exp_elt (tmp);
}
write_exp_elt_sym (struct symbol *expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.symbol = expelt;
-
write_exp_elt (tmp);
}
write_exp_elt_block (struct block *b)
{
union exp_element tmp;
+
memset (&tmp, 0, sizeof (union exp_element));
tmp.block = b;
write_exp_elt (tmp);
write_exp_elt_objfile (struct objfile *objfile)
{
union exp_element tmp;
+
memset (&tmp, 0, sizeof (union exp_element));
tmp.objfile = objfile;
write_exp_elt (tmp);
write_exp_elt_longcst (LONGEST expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.longconst = expelt;
-
write_exp_elt (tmp);
}
write_exp_elt_dblcst (DOUBLEST expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.doubleconst = expelt;
-
write_exp_elt (tmp);
}
write_exp_elt_type (struct type *expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.type = expelt;
-
write_exp_elt (tmp);
}
write_exp_elt_intern (struct internalvar *expelt)
{
union exp_element tmp;
- memset (&tmp, 0, sizeof (union exp_element));
+ memset (&tmp, 0, sizeof (union exp_element));
tmp.internalvar = expelt;
-
write_exp_elt (tmp);
}
for (i = 0; i < args; i++)
{
int r;
+
oplen = arglens[i];
inend += oplen;
r = prefixify_subexp (inexpr, outexpr, inend, outbeg);
parse_expression (char *string)
{
struct expression *exp;
+
exp = parse_exp_1 (&string, 0, 0);
if (*string)
error (_("Junk after end of expression."));
parser_fprintf (FILE *x, const char *y, ...)
{
va_list args;
+
va_start (args, y);
if (x == stderr)
vfprintf_unfiltered (gdb_stderr, y, args);
if (msg == NULL)
{
static char buf[32];
+
xsnprintf (buf, sizeof buf, "(undocumented errno %d)", errnum);
msg = buf;
}
case 's':
{
struct type *elttype = value_type (val);
+
next_address = (value_address (val)
+ val_print_string (elttype,
value_address (val), -1,
case 'a':
{
CORE_ADDR addr = unpack_pointer (type, valaddr);
+
print_address (gdbarch, addr, stream);
}
break;
case 'c':
{
struct value_print_options opts = *options;
- opts.format = 0;
+ opts.format = 0;
if (TYPE_UNSIGNED (type))
type = builtin_type (gdbarch)->builtin_true_unsigned_char;
else
struct ui_file *stream, int do_demangle)
{
struct value_print_options opts;
+
get_user_print_options (&opts);
if (addr == 0)
{
if (format == 's')
{
struct type *char_type = NULL;
+
/* Search for "char16_t" or "char32_t" types or fall back to 8-bit char
if type is not found. */
if (size == 'h')
struct expression *expr = parse_expression (exp);
struct cleanup *old_chain =
make_cleanup (free_current_contents, &expr);
+
evaluate_expression (expr);
do_cleanups (old_chain);
}
if (d->exp == NULL)
{
volatile struct gdb_exception ex;
+
TRY_CATCH (ex, RETURN_MASK_ALL)
{
innermost_block = NULL;
/* Windows' printf does support long long, but not the usual way.
Convert %lld to %I64d. */
int length_before_ll = f - last_arg - 1 - lcount;
+
strncpy (current_substring, last_arg, length_before_ll);
strcpy (current_substring + length_before_ll, "I64");
current_substring[length_before_ll + 3] =
{
/* Convert %ls or %lc to %s. */
int length_before_ls = f - last_arg - 2;
+
strncpy (current_substring, last_arg, length_before_ls);
strcpy (current_substring + length_before_ls, "s");
current_substring += length_before_ls + 2;
while (*s != '\0')
{
char *s1;
+
if (nargs == allocated_args)
val_args = (struct value **) xrealloc ((char *) val_args,
(allocated_args *= 2)
gdb_byte *str;
CORE_ADDR tem;
int j;
+
tem = value_as_address (val_args[i]);
/* This is a %s argument. Find the length of the string. */
for (j = 0;; j++)
{
gdb_byte c;
+
QUIT;
read_memory (tem + j, &c, 1);
if (c == 0)
#if defined (CC_HAS_LONG_LONG) && defined (PRINTF_HAS_LONG_LONG)
{
long long val = value_as_long (val_args[i]);
+
printf_filtered (current_substring, val);
break;
}
case int_arg:
{
int val = value_as_long (val_args[i]);
+
printf_filtered (current_substring, val);
break;
}
case long_arg:
{
long val = value_as_long (val_args[i]);
+
printf_filtered (current_substring, val);
break;
}
case decfloat_arg:
{
const gdb_byte *param_ptr = value_contents (val_args[i]);
+
#if defined (PRINTF_HAS_DECFLOAT)
/* If we have native support for Decimal floating
printing, handle it here. */
while (*p)
{
int is_percent = (*p == '%');
+
*fmt_p++ = *p++;
if (is_percent)
{
restore_program_space (void *arg)
{
struct program_space *saved_pspace = arg;
+
set_current_program_space (saved_pspace);
}
{
struct cleanup *old_chain = make_cleanup (restore_program_space,
current_program_space);
+
return old_chain;
}
if (shared_aspace)
{
struct address_space *aspace = new_address_space ();
+
free_address_space (current_program_space->aspace);
ALL_PSPACES (pspace)
pspace->aspace = aspace;
do
{
struct area_entry *next = e->next;
+
xfree (e);
e = next;
}
while (e && overlaps (area, e, offset, size))
{
struct area_entry *next = (e->next == e) ? 0 : e->next;
+
e->prev->next = e->next;
e->next->prev = e->prev;
{
CORE_ADDR offset = addr.k;
struct area_entry *e = (struct area_entry *) xmalloc (sizeof (*e));
+
e->offset = offset;
e->size = size;
e->value = value;
if (overlay_debugging && msymbol && section)
{
struct partial_symbol *p;
+
/* NOTE: This assumes that every psymbol has a
corresponding msymbol, which is not necessarily
true; the debug info might be much richer than the
if (!pst->readin)
{
struct cleanup *back_to = increment_reading_symtab ();
+
(*pst->read_symtab) (pst);
do_cleanups (back_to);
}
{
const char *name = ps->filename;
int len = strlen (name);
+
if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
|| strcmp (name, "<<C++-namespaces>>") == 0)))
cs_pst = ps;
{
int i;
struct partial_symtab *ps;
+
i = 0;
ALL_OBJFILE_PSYMTABS (objfile, ps)
{
void (*fun) (const char *, void *), void *data)
{
struct partial_symtab *ps;
+
ALL_OBJFILE_PSYMTABS (objfile, ps)
{
struct partial_symbol **psym;
if (global)
{
int U;
+
i = 0;
U = length - 1;
while (U - i > 4)
{
int M = (U + i) >> 1;
struct partial_symbol *psym = start[M];
+
if (SYMBOL_LINKAGE_NAME (psym)[0] < name[0])
i = M + 1;
else if (SYMBOL_LINKAGE_NAME (psym)[0] > name[0])
if (global)
{
int U;
+
i = 0;
U = length - 1;
while (U - i > 4)
{
int M = (U + i) >> 1;
struct partial_symbol *psym = start[M];
+
if (SYMBOL_LINKAGE_NAME (psym)[0] < '_')
i = M + 1;
else if (SYMBOL_LINKAGE_NAME (psym)[0] > '_')
wild_match, is_name_suffix))
{
struct symtab *s = PSYMTAB_TO_SYMTAB (ps);
+
if (s == NULL || !s->primary)
continue;
(*callback) (objfile, s, data);
struct objfile *objfile)
{
int new_size;
+
if (listp->size == 0)
{
new_size = 255;
ALL_PSYMTABS (objfile, ps)
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
+
s = PSYMTAB_TO_SYMTAB (ps);
if (s == NULL)
continue;