summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2009-10-06 23:27:04 +0000
committerPierre Muller <muller@ics.u-strasbg.fr>2009-10-06 23:27:04 +0000
commiteca075010d58fa938079d7bc8bed1733615f3a75 (patch)
tree10dda6d5be4ba0f939aa0951a4cef666d84589f2
parentada4a1e8ae6e4b9c279dd965b3cf9219ee67455b (diff)
downloadgdb-eca075010d58fa938079d7bc8bed1733615f3a75.tar.gz
ARI fix: OP eol rule.
* doublest.c (floatformat_from_length): Avoid operator at end of line. * dwarf2-frame.c (dwarf2_build_frame_info): Idem. * dwarf2read.c (read_array_order, dwarf_decode_macros): Idem. * eval.c (evaluate_subexp_standard): Idem. * event-loop.c (create_timer, handle_timer_event): Idem. * expprint.c (print_subexp_standard): Idem. * f-exp.y (variable): Idem. * f-typeprint.c (f_print_type): Idem.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/doublest.c4
-rw-r--r--gdb/dwarf2-frame.c4
-rw-r--r--gdb/dwarf2read.c22
-rw-r--r--gdb/eval.c44
-rw-r--r--gdb/event-loop.c12
-rw-r--r--gdb/expprint.c4
-rw-r--r--gdb/f-exp.y6
-rw-r--r--gdb/f-typeprint.c12
9 files changed, 73 insertions, 47 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d39a1639cd5..b29049e5b5b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-07 Pierre Muller <muller@ics.u-strasbg.fr>
+
+ ARI fix: OP eol rule.
+ * doublest.c (floatformat_from_length): Avoid operator at end of line.
+ * dwarf2-frame.c (dwarf2_build_frame_info): Idem.
+ * dwarf2read.c (read_array_order, dwarf_decode_macros): Idem.
+ * eval.c (evaluate_subexp_standard): Idem.
+ * event-loop.c (create_timer, handle_timer_event): Idem.
+ * expprint.c (print_subexp_standard): Idem.
+ * f-exp.y (variable): Idem.
+ * f-typeprint.c (f_print_type): Idem.
+
2009-10-06 Pierre Muller <muller@ics.u-strasbg.fr>
ARI fix: OP eol rule.
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 2e0bdda884a..54956e129e7 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -778,8 +778,8 @@ floatformat_from_length (struct gdbarch *gdbarch, int len)
both in processor and in memory.
The code below accepts the real bit size. */
else if ((gdbarch_long_double_format (gdbarch) != NULL)
- && (len * TARGET_CHAR_BIT ==
- gdbarch_long_double_format (gdbarch)[0]->totalsize))
+ && (len * TARGET_CHAR_BIT
+ == gdbarch_long_double_format (gdbarch)[0]->totalsize))
format = gdbarch_long_double_format (gdbarch)
[gdbarch_byte_order (gdbarch)];
else
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 668c4344bd4..9c464ba7e94 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -2112,8 +2112,8 @@ dwarf2_build_frame_info (struct objfile *objfile)
obstack_grow (&objfile->objfile_obstack, &fde_table.entries[j],
sizeof (fde_table.entries[0]));
while (++j < fde_table.num_entries
- && (fde_table.entries[k]->initial_location ==
- fde_table.entries[j]->initial_location))
+ && (fde_table.entries[k]->initial_location
+ == fde_table.entries[j]->initial_location))
/* Skip. */;
}
fde_table2->entries = obstack_finish (&objfile->objfile_obstack);
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 4cce36b6f19..69a7242815d 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -5383,8 +5383,8 @@ read_array_order (struct die_info *die, struct dwarf2_cu *cu)
version checking.
*/
- if (cu->language == language_fortran &&
- cu->producer && strstr (cu->producer, "GNU F77"))
+ if (cu->language == language_fortran
+ && cu->producer && strstr (cu->producer, "GNU F77"))
{
return DW_ORD_row_major;
}
@@ -11156,20 +11156,22 @@ dwarf_decode_macros (struct line_header *lh, unsigned int offset,
complaint (&symfile_complaints,
_("debug info with no main source gives macro %s "
"on line %d: %s"),
- macinfo_type ==
- DW_MACINFO_define ? _("definition") : macinfo_type ==
- DW_MACINFO_undef ? _("undefinition") :
- "something-or-other", line, body);
+ macinfo_type == DW_MACINFO_define ?
+ _("definition") :
+ macinfo_type == DW_MACINFO_undef ?
+ _("undefinition") :
+ _("something-or-other"), line, body);
break;
}
if ((line == 0 && !at_commandline) || (line != 0 && at_commandline))
complaint (&symfile_complaints,
_("debug info gives %s macro %s with %s line %d: %s"),
at_commandline ? _("command-line") : _("in-file"),
- macinfo_type ==
- DW_MACINFO_define ? _("definition") : macinfo_type ==
- DW_MACINFO_undef ? _("undefinition") :
- "something-or-other",
+ macinfo_type == DW_MACINFO_define ?
+ _("definition") :
+ macinfo_type == DW_MACINFO_undef ?
+ _("undefinition") :
+ _("something-or-other"),
line == 0 ? _("zero") : _("non-zero"), line, body);
if (macinfo_type == DW_MACINFO_define)
diff --git a/gdb/eval.c b/gdb/eval.c
index 2926465c418..2f6ded246ac 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -884,8 +884,8 @@ evaluate_subexp_standard (struct type *expect_type,
LONGEST low_bound, high_bound;
/* get targettype of elementtype */
- while (TYPE_CODE (check_type) == TYPE_CODE_RANGE ||
- TYPE_CODE (check_type) == TYPE_CODE_TYPEDEF)
+ while (TYPE_CODE (check_type) == TYPE_CODE_RANGE
+ || TYPE_CODE (check_type) == TYPE_CODE_TYPEDEF)
check_type = TYPE_TARGET_TYPE (check_type);
if (get_discrete_bounds (element_type, &low_bound, &high_bound) < 0)
@@ -919,14 +919,14 @@ evaluate_subexp_standard (struct type *expect_type,
range_low_type = TYPE_TARGET_TYPE (range_low_type);
if (TYPE_CODE (range_high_type) == TYPE_CODE_RANGE)
range_high_type = TYPE_TARGET_TYPE (range_high_type);
- if ((TYPE_CODE (range_low_type) != TYPE_CODE (range_high_type)) ||
- (TYPE_CODE (range_low_type) == TYPE_CODE_ENUM &&
- (range_low_type != range_high_type)))
+ if ((TYPE_CODE (range_low_type) != TYPE_CODE (range_high_type))
+ || (TYPE_CODE (range_low_type) == TYPE_CODE_ENUM
+ && (range_low_type != range_high_type)))
/* different element modes */
error (_("POWERSET tuple elements of different mode"));
- if ((TYPE_CODE (check_type) != TYPE_CODE (range_low_type)) ||
- (TYPE_CODE (check_type) == TYPE_CODE_ENUM &&
- range_low_type != check_type))
+ if ((TYPE_CODE (check_type) != TYPE_CODE (range_low_type))
+ || (TYPE_CODE (check_type) == TYPE_CODE_ENUM
+ && range_low_type != check_type))
error (_("incompatible POWERSET tuple elements"));
if (range_low > range_high)
{
@@ -1161,8 +1161,13 @@ evaluate_subexp_standard (struct type *expect_type,
if (addr)
{
struct symbol *sym = NULL;
- /* Is it a high_level symbol? */
+ /* The address might point to a function descriptor;
+ resolve it to the actual code address instead. */
+ addr = gdbarch_convert_from_func_ptr_addr (exp->gdbarch, addr,
+ &current_target);
+
+ /* Is it a high_level symbol? */
sym = find_pc_function (addr);
if (sym != NULL)
method = value_of_variable (sym, 0);
@@ -1216,11 +1221,20 @@ evaluate_subexp_standard (struct type *expect_type,
{
if (TYPE_CODE (value_type (method)) != TYPE_CODE_FUNC)
error (_("method address has symbol information with non-function type; skipping"));
+
+ /* Create a function pointer of the appropriate type, and replace
+ its value with the value of msg_send or msg_send_stret. We must
+ use a pointer here, as msg_send and msg_send_stret are of pointer
+ type, and the representation may be different on systems that use
+ function descriptors. */
if (struct_return)
- set_value_address (method, value_as_address (msg_send_stret));
+ called_method
+ = value_from_pointer (lookup_pointer_type (value_type (method)),
+ value_as_address (msg_send_stret));
else
- set_value_address (method, value_as_address (msg_send));
- called_method = method;
+ called_method
+ = value_from_pointer (lookup_pointer_type (value_type (method)),
+ value_as_address (msg_send));
}
else
{
@@ -1275,7 +1289,7 @@ evaluate_subexp_standard (struct type *expect_type,
{
/* Function objc_msg_lookup returns a pointer. */
deprecated_set_value_type (argvec[0],
- lookup_function_type (lookup_pointer_type (value_type (argvec[0]))));
+ lookup_pointer_type (lookup_function_type (value_type (argvec[0]))));
argvec[0] = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
}
@@ -1648,8 +1662,8 @@ evaluate_subexp_standard (struct type *expect_type,
struct value_print_options opts;
get_user_print_options (&opts);
- if (opts.objectprint && TYPE_TARGET_TYPE(type) &&
- (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
+ if (opts.objectprint && TYPE_TARGET_TYPE(type)
+ && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
real_type = value_rtti_target_type (arg1, &full, &top, &using_enc);
if (real_type)
diff --git a/gdb/event-loop.c b/gdb/event-loop.c
index 3672aa825f1..afbc2d70ea6 100644
--- a/gdb/event-loop.c
+++ b/gdb/event-loop.c
@@ -1212,9 +1212,9 @@ create_timer (int milliseconds, timer_handler_func * proc, gdb_client_data clien
{
/* If the seconds field is greater or if it is the same, but the
microsecond field is greater. */
- if ((timer_index->when.tv_sec > timer_ptr->when.tv_sec) ||
- ((timer_index->when.tv_sec == timer_ptr->when.tv_sec)
- && (timer_index->when.tv_usec > timer_ptr->when.tv_usec)))
+ if ((timer_index->when.tv_sec > timer_ptr->when.tv_sec)
+ || ((timer_index->when.tv_sec == timer_ptr->when.tv_sec)
+ && (timer_index->when.tv_usec > timer_ptr->when.tv_usec)))
break;
}
@@ -1288,9 +1288,9 @@ handle_timer_event (event_data dummy)
while (timer_ptr != NULL)
{
- if ((timer_ptr->when.tv_sec > time_now.tv_sec) ||
- ((timer_ptr->when.tv_sec == time_now.tv_sec) &&
- (timer_ptr->when.tv_usec > time_now.tv_usec)))
+ if ((timer_ptr->when.tv_sec > time_now.tv_sec)
+ || ((timer_ptr->when.tv_sec == time_now.tv_sec)
+ && (timer_ptr->when.tv_usec > time_now.tv_usec)))
break;
/* Get rid of the timer from the beginning of the list. */
diff --git a/gdb/expprint.c b/gdb/expprint.c
index e83d1011ab5..2936a934441 100644
--- a/gdb/expprint.c
+++ b/gdb/expprint.c
@@ -413,8 +413,8 @@ print_subexp_standard (struct expression *exp, int *pos,
(*pos) += 2;
if ((int) prec > (int) PREC_PREFIX)
fputs_filtered ("(", stream);
- if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC &&
- exp->elts[pc + 3].opcode == OP_LONG)
+ if (TYPE_CODE (exp->elts[pc + 1].type) == TYPE_CODE_FUNC
+ && exp->elts[pc + 3].opcode == OP_LONG)
{
struct value_print_options opts;
diff --git a/gdb/f-exp.y b/gdb/f-exp.y
index c04c8f46410..abc34deb89e 100644
--- a/gdb/f-exp.y
+++ b/gdb/f-exp.y
@@ -492,9 +492,9 @@ variable: name_not_typename
{
if (symbol_read_needs_frame (sym))
{
- if (innermost_block == 0 ||
- contained_in (block_found,
- innermost_block))
+ if (innermost_block == 0
+ || contained_in (block_found,
+ innermost_block))
innermost_block = block_found;
}
write_exp_elt_opcode (OP_VAR_VALUE);
diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
index 6c9668f00e2..0fe1b4e9f5d 100644
--- a/gdb/f-typeprint.c
+++ b/gdb/f-typeprint.c
@@ -60,15 +60,13 @@ f_print_type (struct type *type, char *varstring, struct ui_file *stream,
f_type_print_base (type, stream, show, level);
code = TYPE_CODE (type);
if ((varstring != NULL && *varstring != '\0')
- ||
/* Need a space if going to print stars or brackets;
but not if we will print just a type name. */
- ((show > 0 || TYPE_NAME (type) == 0)
- &&
- (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
- || code == TYPE_CODE_METHOD
- || code == TYPE_CODE_ARRAY
- || code == TYPE_CODE_REF)))
+ || ((show > 0 || TYPE_NAME (type) == 0)
+ && (code == TYPE_CODE_PTR || code == TYPE_CODE_FUNC
+ || code == TYPE_CODE_METHOD
+ || code == TYPE_CODE_ARRAY
+ || code == TYPE_CODE_REF)))
fputs_filtered (" ", stream);
f_type_print_varspec_prefix (type, stream, show, 0);