* charset.c: White space.
* c-lang.c: White space.
* cli-out.c: White space.
* coffread.c: White space.
* complaints.c: White space.
* completer.c: White space.
* corefile.c: White space.
* corelow.c: White space.
* cp-abi.c: White space.
* cp-namespace.c: White space.
* cp-support.c: White space.
* cp-valprint.c: White space.
* c-typeprint.c: White space.
* c-valprint.c: White space.
2010-05-13 Michael Snyder <msnyder@vmware.com>
+ * charset.c: White space.
+ * c-lang.c: White space.
+ * cli-out.c: White space.
+ * coffread.c: White space.
+ * complaints.c: White space.
+ * completer.c: White space.
+ * corefile.c: White space.
+ * corelow.c: White space.
+ * cp-abi.c: White space.
+ * cp-namespace.c: White space.
+ * cp-support.c: White space.
+ * cp-valprint.c: White space.
+ * c-typeprint.c: White space.
+ * c-valprint.c: White space.
* blockframe.c: White space.
* breakpoint.c: White space.
* buildsym.c: White space.
int quoter, int *need_escapep)
{
int need_escape = *need_escapep;
+
*need_escapep = 0;
if (gdb_iswprint (w) && (!need_escape || (!gdb_iswdigit (w)
&& w != LCST ('8')
{
char octal[30];
ULONGEST value;
+
value = extract_unsigned_integer (&orig[i], width, byte_order);
/* If the value fits in 3 octal digits, print it that
way. Otherwise, print it as a hex escape. */
while (i < orig_len)
{
char octal[5];
+
sprintf (octal, "\\%.3o", orig[i] & 0xff);
append_string_as_wide (octal, output);
++i;
if (length == -1)
{
unsigned long current_char = 1;
+
for (i = 0; current_char; ++i)
{
QUIT;
/* Painful gyrations. */
int j;
char *s = xstrprintf (_(" <repeats %u times>"), reps);
+
for (j = 0; s[j]; ++j)
{
gdb_wchar_t w = gdb_btowc (s[j]);
case 'U':
{
int length = *p == 'u' ? 4 : 8;
+
ADVANCE;
if (!isxdigit (*p))
error (_("\\u used with no following hex digits"));
while (data < limit)
{
char *p = data;
+
/* Look for next escape, or the end of the input. */
while (p < limit && *p != '\\')
++p;
else
{
int i;
+
/* Write the terminating character. */
for (i = 0; i < TYPE_LENGTH (type); ++i)
obstack_1grow (&output, 0);
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_c_primitive_types + 1,
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_cplus_primitive_types + 1,
int show, int passed_a_ptr, int need_post_space)
{
char *name;
+
if (type == 0)
return;
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
int len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
int j;
+
for (j = 0; j < len2; j++)
if (!TYPE_FN_FIELD_ARTIFICIAL (f, j))
real_len++;
char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
char *name = type_name_no_tag (type);
int is_constructor = name && strcmp (method_name, name) == 0;
+
for (j = 0; j < len2; j++)
{
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
int is_full_physname_constructor =
- is_constructor_name (physname)
- || is_destructor_name (physname)
- || method_name[0] == '~';
+ is_constructor_name (physname)
+ || is_destructor_name (physname)
+ || method_name[0] == '~';
/* Do not print out artificial methods. */
if (TYPE_FN_FIELD_ARTIFICIAL (f, j))
{
int staticp = TYPE_FN_FIELD_STATIC_P (f, j);
struct type *mtype = TYPE_FN_FIELD_TYPE (f, j);
+
cp_type_print_method_args (mtype,
"",
method_name,
if (p != NULL)
{
int length = p - demangled_no_class;
+
demangled_no_static = (char *) xmalloc (length + 1);
strncpy (demangled_no_static, demangled_no_class, length);
*(demangled_no_static + length) = '\0';
-fvtable_thunks. (Otherwise, look under TYPE_CODE_STRUCT.) */
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
print_function_pointer_address (gdbarch, addr, stream,
options->addressprint);
break;
{
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, 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,
/* In all other cases we simply copy input bytes to the
output. */
size_t amt = *inbytesleft;
+
if (amt > *outbytesleft)
amt = *outbytesleft;
memcpy (*outbuf, *inbuf, amt);
const char *host_cset = host_charset ();
const char *target_cset = target_charset (gdbarch);
const char *target_wide_cset = target_wide_charset_name;
+
if (!strcmp (target_wide_cset, "auto"))
target_wide_cset = gdbarch_auto_wide_charset (gdbarch);
size_t orig_in = iter->bytes;
size_t out_avail = out_request * sizeof (gdb_wchar_t);
size_t num;
-
size_t r = iconv (iter->desc,
(ICONV_CONST char **) &iter->input, &iter->bytes,
&outptr, &out_avail);
+
if (r == (size_t) -1)
{
switch (errno)
const char *tblid)
{
cli_out_data *data = ui_out_data (uiout);
+
if (nr_rows == 0)
data->suppress_output = 1;
else
cli_table_body (struct ui_out *uiout)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
/* first, close the table header line */
cli_table_end (struct ui_out *uiout)
{
cli_out_data *data = ui_out_data (uiout);
+
data->suppress_output = 0;
}
const char *colhdr)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
const char *id)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
}
int level)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
}
enum ui_align alignment,
const char *fldname, int value)
{
- char buffer[20]; /* FIXME: how many chars long a %d can become? */
-
+ char buffer[20]; /* FIXME: how many chars long a %d can become? */
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
sprintf (buffer, "%d", value);
const char *fldname)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
{
int before = 0;
int after = 0;
-
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
va_list args)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
cli_spaces (struct ui_out *uiout, int numspaces)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
print_spaces_filtered (numspaces, data->stream);
cli_text (struct ui_out *uiout, const char *string)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
fputs_filtered (string, data->stream);
const char *format, va_list args)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
if (ui_out_get_verblvl (uiout) >= verbosity)
cli_wrap_hint (struct ui_out *uiout, char *identstring)
{
cli_out_data *data = ui_out_data (uiout);
+
if (data->suppress_output)
return;
wrap_here (identstring);
cli_flush (struct ui_out *uiout)
{
cli_out_data *data = ui_out_data (uiout);
+
gdb_flush (data->stream);
}
cli_redirect (struct ui_out *uiout, struct ui_file *outstream)
{
cli_out_data *data = ui_out_data (uiout);
+
if (outstream != NULL)
{
data->original_stream = data->stream;
field_separator (void)
{
cli_out_data *data = ui_out_data (uiout);
+
fputc_filtered (' ', data->stream);
}
cli_out_new (struct ui_file *stream)
{
int flags = ui_source_list;
-
cli_out_data *data = XMALLOC (cli_out_data);
+
cli_out_data_ctor (data, stream);
return ui_out_new (&cli_ui_out_impl, data, flags);
}
{
cli_out_data *data = ui_out_data (uiout);
struct ui_file *old = data->stream;
+
data->stream = stream;
return old;
}
find_targ_sec (bfd *abfd, asection *sect, void *obj)
{
struct find_targ_sec_arg *args = (struct find_targ_sec_arg *) obj;
+
if (sect->target_index == args->targ_index)
*args->resultp = sect;
}
cs_to_section (struct coff_symbol *cs, struct objfile *objfile)
{
asection *sect = cs_to_bfd_section (cs, objfile);
+
if (sect == NULL)
return SECT_OFF_TEXT (objfile);
return sect->index;
struct objfile *objfile)
{
struct bfd_section *bfd_section;
+
/* We don't want TDESC entry points in the minimal symbol table */
if (cs->c_name[0] == '@')
return NULL;
if (debugfile)
{
bfd *abfd = symfile_bfd_open (debugfile);
+
symbol_file_add_separate (abfd, symfile_flags, objfile);
xfree (debugfile);
}
{
/* Record all functions -- external and static -- in minsyms. */
int section = cs_to_section (cs, objfile);
+
tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
record_minimal_symbol (cs, tmpaddr, mst_text, section, objfile);
/* This is a common symbol. See if the target
environment knows where it has been relocated to. */
CORE_ADDR reladdr;
+
if (target_lookup_symbol (cs->c_name, &reladdr))
{
/* Error in lookup; ignore symbol. */
else
{
asection *bfd_section = cs_to_bfd_section (cs, objfile);
+
sec = cs_to_section (cs, objfile);
tmpaddr = cs->c_value;
/* Statics in a PE file also get relocated */
if (SDB_TYPE (cs->c_type))
{
struct symbol *sym;
+
sym = process_coff_symbol
(cs, &main_aux, objfile);
SYMBOL_VALUE (sym) = tmpaddr;
struct objfile *objfile)
{
struct symbol *sym
- = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
- sizeof (struct symbol));
+ = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
+ sizeof (struct symbol));
char *name;
memset (sym, 0, sizeof (struct symbol));
for (; j < syms->nsyms; j++, n++)
{
struct symbol *xsym = syms->symbol[j];
+
SYMBOL_TYPE (xsym) = type;
TYPE_FIELD_NAME (type, n) = SYMBOL_LINKAGE_NAME (xsym);
SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym));
struct complaints *complaints = get_complaints (c);
struct complain *complaint = find_complaint (complaints, file, line, fmt);
enum complaint_series series;
+
gdb_assert (complaints != NULL);
complaint->counter++;
complaint (struct complaints **complaints, const char *fmt, ...)
{
va_list args;
+
va_start (args, fmt);
vcomplaint (complaints, NULL/*file*/, 0/*line*/, fmt, args);
va_end (args);
while (1)
{
char *p, *q;
+
p = rl_filename_completion_function (text, subsequent_name);
if (return_val_used >= return_val_alloced)
{
for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
{
char *name = TYPE_FN_FIELDLIST_NAME (type, i);
+
if (name && ! strncmp (name, fieldname, namelen))
{
if (!computed_type_name)
char *
gdb_completion_word_break_characters (void)
{
- char ** list;
+ char **list;
+
list = complete_line_internal (rl_line_buffer, rl_line_buffer, rl_point,
handle_brkchars);
gdb_assert (list == NULL);
read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
{
int status;
+
status = target_read_memory (memaddr, myaddr, len);
if (status != 0)
memory_error (status, memaddr);
read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
{
int status;
+
status = target_read_stack (memaddr, myaddr, len);
if (status != 0)
memory_error (status, memaddr);
if successful. */
int
-safe_read_memory_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order,
+safe_read_memory_integer (CORE_ADDR memaddr, int len,
+ enum bfd_endian byte_order,
LONGEST *return_value)
{
int status;
struct captured_read_memory_integer_arguments args;
+
args.memaddr = memaddr;
args.len = len;
args.byte_order = byte_order;
read_memory_typed_address (CORE_ADDR addr, struct type *type)
{
gdb_byte *buf = alloca (TYPE_LENGTH (type));
+
read_memory (addr, buf, TYPE_LENGTH (type));
return extract_typed_address (buf, type);
}
write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, int len)
{
int status;
+
status = target_write_memory (memaddr, myaddr, len);
if (status != 0)
memory_error (status, memaddr);
/* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */
void
-write_memory_unsigned_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order,
+write_memory_unsigned_integer (CORE_ADDR addr, int len,
+ enum bfd_endian byte_order,
ULONGEST value)
{
gdb_byte *buf = alloca (len);
+
store_unsigned_integer (buf, len, byte_order, value);
write_memory (addr, buf, len);
}
/* Store VALUE at ADDR in the inferior as a LEN-byte signed integer. */
void
-write_memory_signed_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order,
+write_memory_signed_integer (CORE_ADDR addr, int len,
+ enum bfd_endian byte_order,
LONGEST value)
{
gdb_byte *buf = alloca (len);
+
store_signed_integer (buf, len, byte_order, value);
write_memory (addr, buf, len);
}
_initialize_core (void)
{
struct cmd_list_element *c;
+
c = add_cmd ("core-file", class_files, core_file_command, _("\
Use FILE as core dump for examining memory and registers.\n\
No arg means have no core file. This command has been superseded by the\n\
usually happen, but we're dealing with input here, which can
always be broken in different ways. */
struct thread_info *thread = first_thread_of_process (-1);
+
if (thread == NULL)
{
inferior_appeared (current_inferior (), CORELOW_PID);
struct bfd_section *section;
bfd_size_type size;
-
char sectionstr[100];
+
xsnprintf (sectionstr, sizeof sectionstr, "SPU/%s", annex);
section = bfd_get_section_by_name (core_bfd, sectionstr);
{
/* NULL annex requests list of all present spuids. */
struct spuid_list list;
+
list.buf = readbuf;
list.offset = offset;
list.len = len;
&& gdbarch_core_pid_to_str_p (core_gdbarch))
{
char *ret = gdbarch_core_pid_to_str (core_gdbarch, ptid);
+
if (ret != NULL)
return ret;
}
{
struct type *ret = NULL;
struct gdb_exception e;
+
if ((current_cp_abi.rtti_type) == NULL)
return NULL;
TRY_CATCH (e, RETURN_MASK_ERROR)
{
struct cleanup *cleanup_chain;
int i;
- ui_out_text (uiout, "The available C++ ABIs are:\n");
+ ui_out_text (uiout, "The available C++ ABIs are:\n");
cleanup_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "cp-abi-list");
for (i = 0; i < num_cp_abis; i++)
{
{
char *concatenated_name = alloca (strlen (namespace) + 2 +
strlen (name) + 1);
+
strcpy (concatenated_name, namespace);
strcat (concatenated_name, "::");
strcat (concatenated_name, name);
nested_name,
block,
VAR_DOMAIN);
+
if (sym == NULL || SYMBOL_CLASS (sym) != LOC_TYPEDEF)
return NULL;
else
{
struct type *retval
= cp_lookup_transparent_type_loop (name, scope, scope_length + 2);
+
if (retval != NULL)
return retval;
}
maintenance_cplus_namespace (char *args, int from_tty)
{
struct objfile *objfile;
+
printf_unfiltered (_("Possible namespaces:\n"));
ALL_OBJFILES (objfile)
{
make_symbol_overload_list_namespace (const char *func_name,
const char *namespace)
{
-
if (namespace[0] == '\0')
make_symbol_overload_list_qualified (func_name);
else
{
char *concatenated_name
= alloca (strlen (namespace) + 2 + strlen (func_name) + 1);
+
strcpy (concatenated_name, namespace);
strcat (concatenated_name, "::");
strcat (concatenated_name, func_name);
if (strncmp (p, "operator", 8) == 0)
{
int valid = 0;
- p += 8;
+ p += 8;
SKIP_SPACE (p);
for (i = 0; i < sizeof (operator_tokens) / sizeof (operator_tokens[0]);
++i)
{
int length = strlen (operator_tokens[i]);
+
/* By using strncmp here, we MUST have operator_tokens ordered!
See additional notes where operator_tokens is defined above. */
if (strncmp (p, operator_tokens[i], length) == 0)
{
const char *op = p;
+
valid = 1;
p += length;
{
stat_array_obstack_initial_size =
obstack_object_size (&dont_print_stat_array_obstack);
+
last_set_recurse = recurse;
}
}
else
{
struct value_print_options opts = *options;
+
opts.deref_ref = 0;
v = value_from_longest
(TYPE_FIELD_TYPE (type, i),
else if (field_is_static (&TYPE_FIELD (type, i)))
{
struct value *v = value_static_field (type, i);
+
if (v == NULL)
fputs_filtered ("<optimized out>", stream);
else
else
{
struct value_print_options opts = *options;
+
opts.deref_ref = 0;
val_print (TYPE_FIELD_TYPE (type, i),
valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
CORE_ADDR address,
struct ui_file *stream, int recurse,
const struct value_print_options *options,
- struct type **dont_print_vb, int dont_print_statmem)
+ struct type **dont_print_vb,
+ int dont_print_statmem)
{
struct value *value;
int full, top, using_enc;
{
/* FIXME (alloca): unsafe if baseclass is really really large. */
gdb_byte *buf = alloca (TYPE_LENGTH (baseclass));
+
base_valaddr = buf;
if (target_read_memory (address + boffset, buf,
TYPE_LENGTH (baseclass)) != 0)
if (domain != NULL)
{
char *name;
+
fputs_filtered (prefix, stream);
name = type_name_no_tag (domain);
if (name)