aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2010-05-13 21:36:08 +0000
committerMichael Snyder <msnyder@vmware.com>2010-05-13 21:36:08 +0000
commit1c4d3f96872d3ecb99c14c102ab3f55af8998676 (patch)
tree72d80db60f280451c24f1d05e13eaf1188b206c6 /gdb/frame.c
parentf89b749f3c0347fe1ea838657eb7a00d23d2cbf8 (diff)
downloadgdb-1c4d3f96872d3ecb99c14c102ab3f55af8998676.zip
gdb-1c4d3f96872d3ecb99c14c102ab3f55af8998676.tar.gz
gdb-1c4d3f96872d3ecb99c14c102ab3f55af8998676.tar.bz2
2010-05-13 Michael Snyder <msnyder@vmware.com>
* frame.c: White space, add blank lines.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index e320e4f..650b279 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -381,6 +381,7 @@ frame_id_build_special (CORE_ADDR stack_addr, CORE_ADDR code_addr,
CORE_ADDR special_addr)
{
struct frame_id id = null_frame_id;
+
id.stack_addr = stack_addr;
id.stack_addr_p = 1;
id.code_addr = code_addr;
@@ -394,6 +395,7 @@ struct frame_id
frame_id_build (CORE_ADDR stack_addr, CORE_ADDR code_addr)
{
struct frame_id id = null_frame_id;
+
id.stack_addr = stack_addr;
id.stack_addr_p = 1;
id.code_addr = code_addr;
@@ -405,6 +407,7 @@ struct frame_id
frame_id_build_wild (CORE_ADDR stack_addr)
{
struct frame_id id = null_frame_id;
+
id.stack_addr = stack_addr;
id.stack_addr_p = 1;
return id;
@@ -414,6 +417,7 @@ int
frame_id_p (struct frame_id l)
{
int p;
+
/* The frame is valid iff it has a valid stack address. */
p = l.stack_addr_p;
/* outer_frame_id is also valid. */
@@ -441,6 +445,7 @@ int
frame_id_eq (struct frame_id l, struct frame_id r)
{
int eq;
+
if (!l.stack_addr_p && l.special_addr_p && !r.stack_addr_p && r.special_addr_p)
/* The outermost frame marker is equal to itself. This is the
dodgy thing about outer_frame_id, since between execution steps
@@ -518,6 +523,7 @@ static int
frame_id_inner (struct gdbarch *gdbarch, struct frame_id l, struct frame_id r)
{
int inner;
+
if (!l.stack_addr_p || !r.stack_addr_p)
/* Like NaN, any operation involving an invalid ID always fails. */
inner = 0;
@@ -687,6 +693,7 @@ frame_save_as_regcache (struct frame_info *this_frame)
struct regcache *regcache = regcache_xmalloc (get_frame_arch (this_frame),
aspace);
struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
+
regcache_save (regcache, do_frame_register_read, this_frame);
discard_cleanups (cleanups);
return regcache;
@@ -799,6 +806,7 @@ frame_unwind_register (struct frame_info *frame, int regnum, gdb_byte *buf)
CORE_ADDR addr;
int realnum;
enum lval_type lval;
+
frame_register_unwind (frame, regnum, &optimized, &lval, &addr,
&realnum, buf);
}
@@ -885,6 +893,7 @@ frame_unwind_register_signed (struct frame_info *frame, int regnum)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int size = register_size (gdbarch, regnum);
gdb_byte buf[MAX_REGISTER_SIZE];
+
frame_unwind_register (frame, regnum, buf);
return extract_signed_integer (buf, size, byte_order);
}
@@ -902,6 +911,7 @@ frame_unwind_register_unsigned (struct frame_info *frame, int regnum)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int size = register_size (gdbarch, regnum);
gdb_byte buf[MAX_REGISTER_SIZE];
+
frame_unwind_register (frame, regnum, buf);
return extract_unsigned_integer (buf, size, byte_order);
}
@@ -921,6 +931,7 @@ put_frame_register (struct frame_info *frame, int regnum,
int optim;
enum lval_type lval;
CORE_ADDR addr;
+
frame_register (frame, regnum, &optim, &lval, &addr, &realnum, NULL);
if (optim)
error (_("Attempt to assign to a value that was optimized out."));
@@ -958,6 +969,7 @@ frame_register_read (struct frame_info *frame, int regnum,
enum lval_type lval;
CORE_ADDR addr;
int realnum;
+
frame_register (frame, regnum, &optimized, &lval, &addr, &realnum, myaddr);
return !optimized;
@@ -1071,6 +1083,7 @@ static struct frame_info *
create_sentinel_frame (struct program_space *pspace, struct regcache *regcache)
{
struct frame_info *frame = FRAME_OBSTACK_ZALLOC (struct frame_info);
+
frame->level = -1;
frame->pspace = pspace;
frame->aspace = get_regcache_aspace (regcache);
@@ -1110,6 +1123,7 @@ void *
frame_obstack_zalloc (unsigned long size)
{
void *data = obstack_alloc (&frame_cache_obstack, size);
+
memset (data, 0, size);
return data;
}
@@ -1123,6 +1137,7 @@ static int
unwind_to_current_frame (struct ui_out *ui_out, void *args)
{
struct frame_info *frame = get_prev_frame (args);
+
/* A sentinel frame can fail to unwind, e.g., because its PC value
lands in somewhere like start. */
if (frame == NULL)
@@ -2002,6 +2017,7 @@ get_frame_memory_signed (struct frame_info *this_frame, CORE_ADDR addr,
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
return read_memory_integer (addr, len, byte_order);
}
@@ -2011,6 +2027,7 @@ get_frame_memory_unsigned (struct frame_info *this_frame, CORE_ADDR addr,
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
return read_memory_unsigned_integer (addr, len, byte_order);
}
@@ -2072,6 +2089,7 @@ CORE_ADDR
get_frame_sp (struct frame_info *this_frame)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
+
/* Normality - an architecture that provides a way of obtaining any
frame inner-most address. */
if (gdbarch_unwind_sp_p (gdbarch))