mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-18 21:34:13 +08:00
2010-05-14 Michael Snyder <msnyder@vmware.com>
* findcmd.c: White space. * findvar.c: White space. * fork-child.c: White space. * frame-base.c: White space. * frame.c: White space. * frame-unwind.c: White space. * f-valprint.c: White space.
This commit is contained in:
@ -1,5 +1,13 @@
|
|||||||
2010-05-14 Michael Snyder <msnyder@vmware.com>
|
2010-05-14 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* findcmd.c: White space.
|
||||||
|
* findvar.c: White space.
|
||||||
|
* fork-child.c: White space.
|
||||||
|
* frame-base.c: White space.
|
||||||
|
* frame.c: White space.
|
||||||
|
* frame-unwind.c: White space.
|
||||||
|
* f-valprint.c: White space.
|
||||||
|
|
||||||
* elfread.c: White space.
|
* elfread.c: White space.
|
||||||
* environ.c: White space.
|
* environ.c: White space.
|
||||||
* eval.c: White space.
|
* eval.c: White space.
|
||||||
|
@ -311,6 +311,7 @@ f_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)
|
||||||
@ -322,9 +323,10 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
|||||||
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
|
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
|
||||||
{
|
{
|
||||||
struct value *deref_val =
|
struct value *deref_val =
|
||||||
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,
|
common_val_print (deref_val, stream, recurse,
|
||||||
options, current_language);
|
options, current_language);
|
||||||
}
|
}
|
||||||
@ -352,6 +354,7 @@ f_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, type, &opts, 0, stream);
|
print_scalar_formatted (valaddr, type, &opts, 0, stream);
|
||||||
@ -403,6 +406,7 @@ f_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, type, &opts, 0, stream);
|
print_scalar_formatted (valaddr, type, &opts, 0, stream);
|
||||||
@ -451,6 +455,7 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset,
|
|||||||
for (index = 0; index < TYPE_NFIELDS (type); index++)
|
for (index = 0; index < TYPE_NFIELDS (type); index++)
|
||||||
{
|
{
|
||||||
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
|
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
|
||||||
|
|
||||||
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
|
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
|
||||||
embedded_offset, address, stream, recurse, options);
|
embedded_offset, address, stream, recurse, options);
|
||||||
if (index != TYPE_NFIELDS (type) - 1)
|
if (index != TYPE_NFIELDS (type) - 1)
|
||||||
@ -537,7 +542,7 @@ info_common_command (char *comname, int from_tty)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct minimal_symbol *msymbol =
|
struct minimal_symbol *msymbol =
|
||||||
lookup_minimal_symbol_by_pc (get_frame_pc (fi));
|
lookup_minimal_symbol_by_pc (get_frame_pc (fi));
|
||||||
|
|
||||||
if (msymbol != NULL)
|
if (msymbol != NULL)
|
||||||
funname = SYMBOL_LINKAGE_NAME (msymbol);
|
funname = SYMBOL_LINKAGE_NAME (msymbol);
|
||||||
@ -626,7 +631,7 @@ there_is_a_visible_common_named (char *comname)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct minimal_symbol *msymbol =
|
struct minimal_symbol *msymbol =
|
||||||
lookup_minimal_symbol_by_pc (fi->pc);
|
lookup_minimal_symbol_by_pc (fi->pc);
|
||||||
|
|
||||||
if (msymbol != NULL)
|
if (msymbol != NULL)
|
||||||
funname = SYMBOL_LINKAGE_NAME (msymbol);
|
funname = SYMBOL_LINKAGE_NAME (msymbol);
|
||||||
|
@ -126,6 +126,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
|
|||||||
if (*s == '+')
|
if (*s == '+')
|
||||||
{
|
{
|
||||||
LONGEST len;
|
LONGEST len;
|
||||||
|
|
||||||
++s;
|
++s;
|
||||||
v = parse_to_comma_and_eval (&s);
|
v = parse_to_comma_and_eval (&s);
|
||||||
len = value_as_long (v);
|
len = value_as_long (v);
|
||||||
@ -145,6 +146,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
CORE_ADDR end_addr;
|
CORE_ADDR end_addr;
|
||||||
|
|
||||||
v = parse_to_comma_and_eval (&s);
|
v = parse_to_comma_and_eval (&s);
|
||||||
end_addr = value_as_address (v);
|
end_addr = value_as_address (v);
|
||||||
if (start_addr > end_addr)
|
if (start_addr > end_addr)
|
||||||
@ -179,6 +181,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
|
|||||||
> pattern_buf_size)
|
> pattern_buf_size)
|
||||||
{
|
{
|
||||||
size_t current_offset = pattern_buf_end - pattern_buf;
|
size_t current_offset = pattern_buf_end - pattern_buf;
|
||||||
|
|
||||||
pattern_buf_size *= 2;
|
pattern_buf_size *= 2;
|
||||||
pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
|
pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
|
||||||
pattern_buf_end = pattern_buf + current_offset;
|
pattern_buf_end = pattern_buf + current_offset;
|
||||||
@ -298,6 +301,7 @@ find_command (char *args, int from_tty)
|
|||||||
if (found_count > 0)
|
if (found_count > 0)
|
||||||
{
|
{
|
||||||
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
|
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
|
||||||
|
|
||||||
set_internalvar (lookup_internalvar ("_"),
|
set_internalvar (lookup_internalvar ("_"),
|
||||||
value_from_pointer (ptr_type, last_found_addr));
|
value_from_pointer (ptr_type, last_found_addr));
|
||||||
}
|
}
|
||||||
|
@ -321,6 +321,7 @@ unsigned_pointer_to_address (struct gdbarch *gdbarch,
|
|||||||
struct type *type, const gdb_byte *buf)
|
struct type *type, const gdb_byte *buf)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
|
|
||||||
return extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
|
return extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,6 +330,7 @@ signed_pointer_to_address (struct gdbarch *gdbarch,
|
|||||||
struct type *type, const gdb_byte *buf)
|
struct type *type, const gdb_byte *buf)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
|
|
||||||
return extract_signed_integer (buf, TYPE_LENGTH (type), byte_order);
|
return extract_signed_integer (buf, TYPE_LENGTH (type), byte_order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -339,6 +341,7 @@ unsigned_address_to_pointer (struct gdbarch *gdbarch, struct type *type,
|
|||||||
gdb_byte *buf, CORE_ADDR addr)
|
gdb_byte *buf, CORE_ADDR addr)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
|
|
||||||
store_unsigned_integer (buf, TYPE_LENGTH (type), byte_order, addr);
|
store_unsigned_integer (buf, TYPE_LENGTH (type), byte_order, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,6 +350,7 @@ address_to_signed_pointer (struct gdbarch *gdbarch, struct type *type,
|
|||||||
gdb_byte *buf, CORE_ADDR addr)
|
gdb_byte *buf, CORE_ADDR addr)
|
||||||
{
|
{
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
|
|
||||||
store_signed_integer (buf, TYPE_LENGTH (type), byte_order, addr);
|
store_signed_integer (buf, TYPE_LENGTH (type), byte_order, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -439,6 +443,7 @@ read_var_value (struct symbol *var, struct frame_info *frame)
|
|||||||
CORE_ADDR addr
|
CORE_ADDR addr
|
||||||
= symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
|
= symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
|
||||||
SYMBOL_OBJ_SECTION (var));
|
SYMBOL_OBJ_SECTION (var));
|
||||||
|
|
||||||
store_typed_address (value_contents_raw (v), type, addr);
|
store_typed_address (value_contents_raw (v), type, addr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -448,11 +453,9 @@ read_var_value (struct symbol *var, struct frame_info *frame)
|
|||||||
return v;
|
return v;
|
||||||
|
|
||||||
case LOC_CONST_BYTES:
|
case LOC_CONST_BYTES:
|
||||||
{
|
memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len);
|
||||||
memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len);
|
VALUE_LVAL (v) = not_lval;
|
||||||
VALUE_LVAL (v) = not_lval;
|
return v;
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
case LOC_STATIC:
|
case LOC_STATIC:
|
||||||
if (overlay_debugging)
|
if (overlay_debugging)
|
||||||
@ -473,6 +476,7 @@ read_var_value (struct symbol *var, struct frame_info *frame)
|
|||||||
{
|
{
|
||||||
struct value *ref;
|
struct value *ref;
|
||||||
CORE_ADDR argref;
|
CORE_ADDR argref;
|
||||||
|
|
||||||
argref = get_frame_args_address (frame);
|
argref = get_frame_args_address (frame);
|
||||||
if (!argref)
|
if (!argref)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -178,6 +178,7 @@ fork_inferior (char *exec_file_arg, char *allargs, char **env,
|
|||||||
assuming that every other character is a separate
|
assuming that every other character is a separate
|
||||||
argument. */
|
argument. */
|
||||||
int argc = (strlen (allargs) + 1) / 2 + 2;
|
int argc = (strlen (allargs) + 1) / 2 + 2;
|
||||||
|
|
||||||
argv = (char **) xmalloc (argc * sizeof (*argv));
|
argv = (char **) xmalloc (argc * sizeof (*argv));
|
||||||
argv[0] = exec_file;
|
argv[0] = exec_file;
|
||||||
breakup_args (allargs, &argv[1]);
|
breakup_args (allargs, &argv[1]);
|
||||||
|
@ -73,6 +73,7 @@ frame_base_init (struct obstack *obstack)
|
|||||||
{
|
{
|
||||||
struct frame_base_table *table
|
struct frame_base_table *table
|
||||||
= OBSTACK_ZALLOC (obstack, struct frame_base_table);
|
= OBSTACK_ZALLOC (obstack, struct frame_base_table);
|
||||||
|
|
||||||
table->tail = &table->head;
|
table->tail = &table->head;
|
||||||
table->default_base = &default_frame_base;
|
table->default_base = &default_frame_base;
|
||||||
return table;
|
return table;
|
||||||
@ -83,6 +84,7 @@ frame_base_append_sniffer (struct gdbarch *gdbarch,
|
|||||||
frame_base_sniffer_ftype *sniffer)
|
frame_base_sniffer_ftype *sniffer)
|
||||||
{
|
{
|
||||||
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
|
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
|
||||||
|
|
||||||
(*table->tail) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_base_table_entry);
|
(*table->tail) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_base_table_entry);
|
||||||
(*table->tail)->sniffer = sniffer;
|
(*table->tail)->sniffer = sniffer;
|
||||||
table->tail = &(*table->tail)->next;
|
table->tail = &(*table->tail)->next;
|
||||||
@ -93,6 +95,7 @@ frame_base_set_default (struct gdbarch *gdbarch,
|
|||||||
const struct frame_base *default_base)
|
const struct frame_base *default_base)
|
||||||
{
|
{
|
||||||
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
|
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
|
||||||
|
|
||||||
table->default_base = default_base;
|
table->default_base = default_base;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -106,6 +109,7 @@ frame_base_find_by_frame (struct frame_info *this_frame)
|
|||||||
for (entry = table->head; entry != NULL; entry = entry->next)
|
for (entry = table->head; entry != NULL; entry = entry->next)
|
||||||
{
|
{
|
||||||
const struct frame_base *desc = NULL;
|
const struct frame_base *desc = NULL;
|
||||||
|
|
||||||
desc = entry->sniffer (this_frame);
|
desc = entry->sniffer (this_frame);
|
||||||
if (desc != NULL)
|
if (desc != NULL)
|
||||||
return desc;
|
return desc;
|
||||||
|
@ -49,6 +49,7 @@ frame_unwind_init (struct obstack *obstack)
|
|||||||
{
|
{
|
||||||
struct frame_unwind_table *table
|
struct frame_unwind_table *table
|
||||||
= OBSTACK_ZALLOC (obstack, struct frame_unwind_table);
|
= OBSTACK_ZALLOC (obstack, struct frame_unwind_table);
|
||||||
|
|
||||||
/* Start the table out with a few default sniffers. OSABI code
|
/* Start the table out with a few default sniffers. OSABI code
|
||||||
can't override this. */
|
can't override this. */
|
||||||
table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
|
table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
|
||||||
|
@ -592,6 +592,7 @@ frame_find_by_id (struct frame_id id)
|
|||||||
for (frame = get_current_frame (); ; frame = prev_frame)
|
for (frame = get_current_frame (); ; frame = prev_frame)
|
||||||
{
|
{
|
||||||
struct frame_id this = get_frame_id (frame);
|
struct frame_id this = get_frame_id (frame);
|
||||||
|
|
||||||
if (frame_id_eq (id, this))
|
if (frame_id_eq (id, this))
|
||||||
/* An exact match. */
|
/* An exact match. */
|
||||||
return frame;
|
return frame;
|
||||||
@ -620,6 +621,7 @@ frame_unwind_pc (struct frame_info *this_frame)
|
|||||||
if (!this_frame->prev_pc.p)
|
if (!this_frame->prev_pc.p)
|
||||||
{
|
{
|
||||||
CORE_ADDR pc;
|
CORE_ADDR pc;
|
||||||
|
|
||||||
if (gdbarch_unwind_pc_p (frame_unwind_arch (this_frame)))
|
if (gdbarch_unwind_pc_p (frame_unwind_arch (this_frame)))
|
||||||
{
|
{
|
||||||
/* The right way. The `pure' way. The one true way. This
|
/* The right way. The `pure' way. The one true way. This
|
||||||
@ -942,6 +944,7 @@ put_frame_register (struct frame_info *frame, int regnum,
|
|||||||
/* FIXME: write_memory doesn't yet take constant buffers.
|
/* FIXME: write_memory doesn't yet take constant buffers.
|
||||||
Arrrg! */
|
Arrrg! */
|
||||||
gdb_byte tmp[MAX_REGISTER_SIZE];
|
gdb_byte tmp[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
memcpy (tmp, buf, register_size (gdbarch, regnum));
|
memcpy (tmp, buf, register_size (gdbarch, regnum));
|
||||||
write_memory (addr, tmp, register_size (gdbarch, regnum));
|
write_memory (addr, tmp, register_size (gdbarch, regnum));
|
||||||
break;
|
break;
|
||||||
@ -998,6 +1001,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
|
|||||||
for (i = regnum; i < numregs; i++)
|
for (i = regnum; i < numregs; i++)
|
||||||
{
|
{
|
||||||
int thissize = register_size (gdbarch, i);
|
int thissize = register_size (gdbarch, i);
|
||||||
|
|
||||||
if (thissize == 0)
|
if (thissize == 0)
|
||||||
break; /* This register is not available on this architecture. */
|
break; /* This register is not available on this architecture. */
|
||||||
maxsize += thissize;
|
maxsize += thissize;
|
||||||
@ -1013,6 +1017,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
|
|||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
int curr_len = register_size (gdbarch, regnum) - offset;
|
int curr_len = register_size (gdbarch, regnum) - offset;
|
||||||
|
|
||||||
if (curr_len > len)
|
if (curr_len > len)
|
||||||
curr_len = len;
|
curr_len = len;
|
||||||
|
|
||||||
@ -1024,6 +1029,7 @@ get_frame_register_bytes (struct frame_info *frame, int regnum,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gdb_byte buf[MAX_REGISTER_SIZE];
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
if (!frame_register_read (frame, regnum, buf))
|
if (!frame_register_read (frame, regnum, buf))
|
||||||
return 0;
|
return 0;
|
||||||
memcpy (myaddr, buf + offset, curr_len);
|
memcpy (myaddr, buf + offset, curr_len);
|
||||||
@ -1055,6 +1061,7 @@ put_frame_register_bytes (struct frame_info *frame, int regnum,
|
|||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
int curr_len = register_size (gdbarch, regnum) - offset;
|
int curr_len = register_size (gdbarch, regnum) - offset;
|
||||||
|
|
||||||
if (curr_len > len)
|
if (curr_len > len)
|
||||||
curr_len = len;
|
curr_len = len;
|
||||||
|
|
||||||
@ -1065,6 +1072,7 @@ put_frame_register_bytes (struct frame_info *frame, int regnum,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gdb_byte buf[MAX_REGISTER_SIZE];
|
gdb_byte buf[MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
frame_register_read (frame, regnum, buf);
|
frame_register_read (frame, regnum, buf);
|
||||||
memcpy (buf + offset, myaddr, curr_len);
|
memcpy (buf + offset, myaddr, curr_len);
|
||||||
put_frame_register (frame, regnum, buf);
|
put_frame_register (frame, regnum, buf);
|
||||||
|
Reference in New Issue
Block a user