This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[ob] f*.c, white space
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 14 May 2010 12:29:11 -0700
- Subject: [ob] f*.c, white space
add blank line between decls and statements
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.
Index: findcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/findcmd.c,v
retrieving revision 1.11
diff -u -p -r1.11 findcmd.c
--- findcmd.c 1 Jan 2010 07:31:31 -0000 1.11
+++ findcmd.c 14 May 2010 19:26:33 -0000
@@ -126,6 +126,7 @@ parse_find_args (char *args, ULONGEST *m
if (*s == '+')
{
LONGEST len;
+
++s;
v = parse_to_comma_and_eval (&s);
len = value_as_long (v);
@@ -145,6 +146,7 @@ parse_find_args (char *args, ULONGEST *m
else
{
CORE_ADDR end_addr;
+
v = parse_to_comma_and_eval (&s);
end_addr = value_as_address (v);
if (start_addr > end_addr)
@@ -179,6 +181,7 @@ parse_find_args (char *args, ULONGEST *m
> pattern_buf_size)
{
size_t current_offset = pattern_buf_end - pattern_buf;
+
pattern_buf_size *= 2;
pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
pattern_buf_end = pattern_buf + current_offset;
@@ -298,6 +301,7 @@ find_command (char *args, int from_tty)
if (found_count > 0)
{
struct type *ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
+
set_internalvar (lookup_internalvar ("_"),
value_from_pointer (ptr_type, last_found_addr));
}
Index: findvar.c
===================================================================
RCS file: /cvs/src/src/gdb/findvar.c,v
retrieving revision 1.128
diff -u -p -r1.128 findvar.c
--- findvar.c 1 Jan 2010 07:31:31 -0000 1.128
+++ findvar.c 14 May 2010 19:26:33 -0000
@@ -321,6 +321,7 @@ unsigned_pointer_to_address (struct gdba
struct type *type, const gdb_byte *buf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
return extract_unsigned_integer (buf, TYPE_LENGTH (type), byte_order);
}
@@ -329,6 +330,7 @@ signed_pointer_to_address (struct gdbarc
struct type *type, const gdb_byte *buf)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
return extract_signed_integer (buf, TYPE_LENGTH (type), byte_order);
}
@@ -339,6 +341,7 @@ unsigned_address_to_pointer (struct gdba
gdb_byte *buf, CORE_ADDR addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
store_unsigned_integer (buf, TYPE_LENGTH (type), byte_order, addr);
}
@@ -347,6 +350,7 @@ address_to_signed_pointer (struct gdbarc
gdb_byte *buf, CORE_ADDR addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
+
store_signed_integer (buf, TYPE_LENGTH (type), byte_order, addr);
}
@@ -439,6 +443,7 @@ read_var_value (struct symbol *var, stru
CORE_ADDR addr
= symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
SYMBOL_OBJ_SECTION (var));
+
store_typed_address (value_contents_raw (v), type, addr);
}
else
@@ -448,11 +453,9 @@ read_var_value (struct symbol *var, stru
return v;
case LOC_CONST_BYTES:
- {
- memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len);
- VALUE_LVAL (v) = not_lval;
- return v;
- }
+ memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len);
+ VALUE_LVAL (v) = not_lval;
+ return v;
case LOC_STATIC:
if (overlay_debugging)
@@ -473,6 +476,7 @@ read_var_value (struct symbol *var, stru
{
struct value *ref;
CORE_ADDR argref;
+
argref = get_frame_args_address (frame);
if (!argref)
return 0;
Index: fork-child.c
===================================================================
RCS file: /cvs/src/src/gdb/fork-child.c,v
retrieving revision 1.55
diff -u -p -r1.55 fork-child.c
--- fork-child.c 1 Jan 2010 07:31:31 -0000 1.55
+++ fork-child.c 14 May 2010 19:26:33 -0000
@@ -178,6 +178,7 @@ fork_inferior (char *exec_file_arg, char
assuming that every other character is a separate
argument. */
int argc = (strlen (allargs) + 1) / 2 + 2;
+
argv = (char **) xmalloc (argc * sizeof (*argv));
argv[0] = exec_file;
breakup_args (allargs, &argv[1]);
Index: frame-base.c
===================================================================
RCS file: /cvs/src/src/gdb/frame-base.c,v
retrieving revision 1.18
diff -u -p -r1.18 frame-base.c
--- frame-base.c 1 Jan 2010 07:31:31 -0000 1.18
+++ frame-base.c 14 May 2010 19:26:33 -0000
@@ -73,6 +73,7 @@ frame_base_init (struct obstack *obstack
{
struct frame_base_table *table
= OBSTACK_ZALLOC (obstack, struct frame_base_table);
+
table->tail = &table->head;
table->default_base = &default_frame_base;
return table;
@@ -83,6 +84,7 @@ frame_base_append_sniffer (struct gdbarc
frame_base_sniffer_ftype *sniffer)
{
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
+
(*table->tail) = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct frame_base_table_entry);
(*table->tail)->sniffer = sniffer;
table->tail = &(*table->tail)->next;
@@ -93,6 +95,7 @@ frame_base_set_default (struct gdbarch *
const struct frame_base *default_base)
{
struct frame_base_table *table = gdbarch_data (gdbarch, frame_base_data);
+
table->default_base = default_base;
}
@@ -106,6 +109,7 @@ frame_base_find_by_frame (struct frame_i
for (entry = table->head; entry != NULL; entry = entry->next)
{
const struct frame_base *desc = NULL;
+
desc = entry->sniffer (this_frame);
if (desc != NULL)
return desc;
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.282
diff -u -p -r1.282 frame.c
--- frame.c 13 May 2010 21:36:08 -0000 1.282
+++ frame.c 14 May 2010 19:26:33 -0000
@@ -592,6 +592,7 @@ frame_find_by_id (struct frame_id id)
for (frame = get_current_frame (); ; frame = prev_frame)
{
struct frame_id this = get_frame_id (frame);
+
if (frame_id_eq (id, this))
/* An exact match. */
return frame;
@@ -620,6 +621,7 @@ frame_unwind_pc (struct frame_info *this
if (!this_frame->prev_pc.p)
{
CORE_ADDR pc;
+
if (gdbarch_unwind_pc_p (frame_unwind_arch (this_frame)))
{
/* The right way. The `pure' way. The one true way. This
@@ -942,6 +944,7 @@ put_frame_register (struct frame_info *f
/* FIXME: write_memory doesn't yet take constant buffers.
Arrrg! */
gdb_byte tmp[MAX_REGISTER_SIZE];
+
memcpy (tmp, buf, register_size (gdbarch, regnum));
write_memory (addr, tmp, register_size (gdbarch, regnum));
break;
@@ -998,6 +1001,7 @@ get_frame_register_bytes (struct frame_i
for (i = regnum; i < numregs; i++)
{
int thissize = register_size (gdbarch, i);
+
if (thissize == 0)
break; /* This register is not available on this architecture. */
maxsize += thissize;
@@ -1013,6 +1017,7 @@ get_frame_register_bytes (struct frame_i
while (len > 0)
{
int curr_len = register_size (gdbarch, regnum) - offset;
+
if (curr_len > len)
curr_len = len;
@@ -1024,6 +1029,7 @@ get_frame_register_bytes (struct frame_i
else
{
gdb_byte buf[MAX_REGISTER_SIZE];
+
if (!frame_register_read (frame, regnum, buf))
return 0;
memcpy (myaddr, buf + offset, curr_len);
@@ -1055,6 +1061,7 @@ put_frame_register_bytes (struct frame_i
while (len > 0)
{
int curr_len = register_size (gdbarch, regnum) - offset;
+
if (curr_len > len)
curr_len = len;
@@ -1065,6 +1072,7 @@ put_frame_register_bytes (struct frame_i
else
{
gdb_byte buf[MAX_REGISTER_SIZE];
+
frame_register_read (frame, regnum, buf);
memcpy (buf + offset, myaddr, curr_len);
put_frame_register (frame, regnum, buf);
Index: frame-unwind.c
===================================================================
RCS file: /cvs/src/src/gdb/frame-unwind.c,v
retrieving revision 1.29
diff -u -p -r1.29 frame-unwind.c
--- frame-unwind.c 7 May 2010 01:12:11 -0000 1.29
+++ frame-unwind.c 14 May 2010 19:26:33 -0000
@@ -49,6 +49,7 @@ frame_unwind_init (struct obstack *obsta
{
struct frame_unwind_table *table
= OBSTACK_ZALLOC (obstack, struct frame_unwind_table);
+
/* Start the table out with a few default sniffers. OSABI code
can't override this. */
table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry);
Index: f-valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/f-valprint.c,v
retrieving revision 1.56
diff -u -p -r1.56 f-valprint.c
--- f-valprint.c 7 May 2010 00:28:32 -0000 1.56
+++ f-valprint.c 14 May 2010 19:26:33 -0000
@@ -311,6 +311,7 @@ f_val_print (struct type *type, const gd
{
CORE_ADDR addr
= extract_typed_address (valaddr + embedded_offset, type);
+
fprintf_filtered (stream, "@");
fputs_filtered (paddress (gdbarch, addr), stream);
if (options->deref_ref)
@@ -322,9 +323,10 @@ f_val_print (struct type *type, const gd
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);
}
@@ -352,6 +354,7 @@ f_val_print (struct type *type, const gd
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, type, &opts, 0, stream);
@@ -403,6 +406,7 @@ f_val_print (struct type *type, const gd
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, type, &opts, 0, stream);
@@ -451,6 +455,7 @@ f_val_print (struct type *type, const gd
for (index = 0; index < TYPE_NFIELDS (type); index++)
{
int offset = TYPE_FIELD_BITPOS (type, index) / 8;
+
f_val_print (TYPE_FIELD_TYPE (type, index), valaddr + offset,
embedded_offset, address, stream, recurse, options);
if (index != TYPE_NFIELDS (type) - 1)
@@ -537,7 +542,7 @@ info_common_command (char *comname, int
else
{
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)
funname = SYMBOL_LINKAGE_NAME (msymbol);
@@ -626,7 +631,7 @@ there_is_a_visible_common_named (char *c
else
{
struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (fi->pc);
+ lookup_minimal_symbol_by_pc (fi->pc);
if (msymbol != NULL)
funname = SYMBOL_LINKAGE_NAME (msymbol);