summaryrefslogtreecommitdiff
path: root/gdb/compile/compile-loc2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/compile/compile-loc2c.c')
-rw-r--r--gdb/compile/compile-loc2c.c118
1 files changed, 59 insertions, 59 deletions
diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c
index ba29d027bb3..3ce0bfab45f 100644
--- a/gdb/compile/compile-loc2c.c
+++ b/gdb/compile/compile-loc2c.c
@@ -435,9 +435,9 @@ compute_stack_depth (enum bfd_endian byte_order, unsigned int addr_size,
static void
push (int indent, string_file *stream, ULONGEST l)
{
- fprintf_filtered (stream,
- "%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
- indent, "", hex_string (l));
+ gdb_printf (stream,
+ "%*s__gdb_stack[++__gdb_tos] = (" GCC_UINTPTR ") %s;\n",
+ indent, "", hex_string (l));
}
/* Emit code to push an arbitrary expression. This works like
@@ -451,13 +451,13 @@ pushf (int indent, string_file *stream, const char *format, ...)
{
va_list args;
- fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos + 1] = ", indent, "");
+ gdb_printf (stream, "%*s__gdb_stack[__gdb_tos + 1] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
stream->puts (";\n");
- fprintf_filtered (stream, "%*s++__gdb_tos;\n", indent, "");
+ gdb_printf (stream, "%*s++__gdb_tos;\n", indent, "");
}
/* Emit code for a unary expression -- one which operates in-place on
@@ -471,7 +471,7 @@ unary (int indent, string_file *stream, const char *format, ...)
{
va_list args;
- fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos] = ", indent, "");
+ gdb_printf (stream, "%*s__gdb_stack[__gdb_tos] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
@@ -488,12 +488,12 @@ binary (int indent, string_file *stream, const char *format, ...)
{
va_list args;
- fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 1] = ", indent, "");
+ gdb_printf (stream, "%*s__gdb_stack[__gdb_tos - 1] = ", indent, "");
va_start (args, format);
stream->vprintf (format, args);
va_end (args);
stream->puts (";\n");
- fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, "");
+ gdb_printf (stream, "%*s--__gdb_tos;\n", indent, "");
}
/* Print the name of a label given its "SCOPE", an arbitrary integer
@@ -614,9 +614,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
++scope;
- fprintf_filtered (stream, "%*s__attribute__ ((unused)) %s %s;\n",
- indent, "", type_name, result_name);
- fprintf_filtered (stream, "%*s{\n", indent, "");
+ gdb_printf (stream, "%*s__attribute__ ((unused)) %s %s;\n",
+ indent, "", type_name, result_name);
+ gdb_printf (stream, "%*s{\n", indent, "");
indent += 2;
stack_depth = compute_stack_depth (byte_order, addr_size,
@@ -652,19 +652,19 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
"compiled code."),
sym->print_name ());
- fprintf_filtered (stream, "%*s%s = %s;\n",
- indent, "", result_name,
- core_addr_to_string (value_address (val)));
- fprintf_filtered (stream, "%*s}\n", indent - 2, "");
+ gdb_printf (stream, "%*s%s = %s;\n",
+ indent, "", result_name,
+ core_addr_to_string (value_address (val)));
+ gdb_printf (stream, "%*s}\n", indent - 2, "");
return;
}
- fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n",
- indent, "", stack_depth);
+ gdb_printf (stream, "%*s" GCC_UINTPTR " __gdb_stack[%d];\n",
+ indent, "", stack_depth);
if (need_tempvar)
- fprintf_filtered (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, "");
- fprintf_filtered (stream, "%*sint __gdb_tos = -1;\n", indent, "");
+ gdb_printf (stream, "%*s" GCC_UINTPTR " __gdb_tmp;\n", indent, "");
+ gdb_printf (stream, "%*sint __gdb_tos = -1;\n", indent, "");
if (initial != NULL)
pushf (indent, stream, "%s", core_addr_to_string (*initial));
@@ -684,8 +684,8 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
stream->printf ("/* %s */\n", get_DW_OP_name (op));
/* This is handy for debugging the generated code:
- fprintf_filtered (stream, "if (__gdb_tos != %d) abort ();\n",
- (int) info[op_ptr - base].depth - 1);
+ gdb_printf (stream, "if (__gdb_tos != %d) abort ();\n",
+ (int) info[op_ptr - base].depth - 1);
*/
++op_ptr;
@@ -923,7 +923,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break;
case DW_OP_drop:
- fprintf_filtered (stream, "%*s--__gdb_tos;\n", indent, "");
+ gdb_printf (stream, "%*s--__gdb_tos;\n", indent, "");
break;
case DW_OP_pick:
@@ -933,16 +933,16 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break;
case DW_OP_swap:
- fprintf_filtered (stream,
- "%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n",
- indent, "");
- fprintf_filtered (stream,
- "%*s__gdb_stack[__gdb_tos - 1] = "
- "__gdb_stack[__gdb_tos];\n",
- indent, "");
- fprintf_filtered (stream, ("%*s__gdb_stack[__gdb_tos] = "
- "__gdb_tmp;\n"),
- indent, "");
+ gdb_printf (stream,
+ "%*s__gdb_tmp = __gdb_stack[__gdb_tos - 1];\n",
+ indent, "");
+ gdb_printf (stream,
+ "%*s__gdb_stack[__gdb_tos - 1] = "
+ "__gdb_stack[__gdb_tos];\n",
+ indent, "");
+ gdb_printf (stream, ("%*s__gdb_stack[__gdb_tos] = "
+ "__gdb_tmp;\n"),
+ indent, "");
break;
case DW_OP_over:
@@ -950,20 +950,20 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
break;
case DW_OP_rot:
- fprintf_filtered (stream, ("%*s__gdb_tmp = "
- "__gdb_stack[__gdb_tos];\n"),
- indent, "");
- fprintf_filtered (stream,
- "%*s__gdb_stack[__gdb_tos] = "
- "__gdb_stack[__gdb_tos - 1];\n",
- indent, "");
- fprintf_filtered (stream,
- "%*s__gdb_stack[__gdb_tos - 1] = "
- "__gdb_stack[__gdb_tos -2];\n",
- indent, "");
- fprintf_filtered (stream, "%*s__gdb_stack[__gdb_tos - 2] = "
- "__gdb_tmp;\n",
- indent, "");
+ gdb_printf (stream, ("%*s__gdb_tmp = "
+ "__gdb_stack[__gdb_tos];\n"),
+ indent, "");
+ gdb_printf (stream,
+ "%*s__gdb_stack[__gdb_tos] = "
+ "__gdb_stack[__gdb_tos - 1];\n",
+ indent, "");
+ gdb_printf (stream,
+ "%*s__gdb_stack[__gdb_tos - 1] = "
+ "__gdb_stack[__gdb_tos -2];\n",
+ indent, "");
+ gdb_printf (stream, "%*s__gdb_stack[__gdb_tos - 2] = "
+ "__gdb_tmp;\n",
+ indent, "");
break;
case DW_OP_deref:
@@ -984,11 +984,11 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
/* Cast to a pointer of the desired type, then
dereference. */
- fprintf_filtered (stream,
- "%*s__gdb_stack[__gdb_tos] = "
- "*((__gdb_int_%s *) "
- "__gdb_stack[__gdb_tos]);\n",
- indent, "", mode);
+ gdb_printf (stream,
+ "%*s__gdb_stack[__gdb_tos] = "
+ "*((__gdb_int_%s *) "
+ "__gdb_stack[__gdb_tos]);\n",
+ indent, "", mode);
}
break;
@@ -1110,7 +1110,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
case DW_OP_skip:
offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2;
- fprintf_filtered (stream, "%*sgoto ", indent, "");
+ gdb_printf (stream, "%*sgoto ", indent, "");
print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n");
break;
@@ -1118,10 +1118,10 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
case DW_OP_bra:
offset = extract_signed_integer (op_ptr, 2, byte_order);
op_ptr += 2;
- fprintf_filtered (stream,
- "%*sif ((( " GCC_INTPTR
- ") __gdb_stack[__gdb_tos--]) != 0) goto ",
- indent, "");
+ gdb_printf (stream,
+ "%*sif ((( " GCC_INTPTR
+ ") __gdb_stack[__gdb_tos--]) != 0) goto ",
+ indent, "");
print_label (stream, scope, op_ptr + offset - base);
stream->puts (";\n");
break;
@@ -1134,9 +1134,9 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
}
}
- fprintf_filtered (stream, "%*s%s = __gdb_stack[__gdb_tos];\n",
- indent, "", result_name);
- fprintf_filtered (stream, "%*s}\n", indent - 2, "");
+ gdb_printf (stream, "%*s%s = __gdb_stack[__gdb_tos];\n",
+ indent, "", result_name);
+ gdb_printf (stream, "%*s}\n", indent - 2, "");
}
/* See compile.h. */