aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-05-19 19:58:41 +0000
committerJason Molenda <jmolenda@apple.com>1999-05-19 19:58:41 +0000
commit9e086581c726753ae7459a4c77ea9b37c34c5500 (patch)
tree18cb4aec7982e5c6c740346600199e22b81c9566 /gdb/top.c
parent1ceea51453d4ef2d739ce4dfe5d7a74c9a32dc64 (diff)
downloadgdb-9e086581c726753ae7459a4c77ea9b37c34c5500.zip
gdb-9e086581c726753ae7459a4c77ea9b37c34c5500.tar.gz
gdb-9e086581c726753ae7459a4c77ea9b37c34c5500.tar.bz2
import gdb-1999-0519
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 0cf2cd4..60be3cf 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -763,23 +763,24 @@ get_command_line (type, arg)
/* Recursively print a command (including full control structures). */
void
-print_command_line (cmd, depth)
+print_command_line (cmd, depth, stream)
struct command_line *cmd;
unsigned int depth;
+ GDB_FILE *stream;
{
unsigned int i;
if (depth)
{
for (i = 0; i < depth; i++)
- fputs_filtered (" ", gdb_stdout);
+ fputs_filtered (" ", stream);
}
/* A simple command, print it and return. */
if (cmd->control_type == simple_control)
{
- fputs_filtered (cmd->line, gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ fputs_filtered (cmd->line, stream);
+ fputs_filtered ("\n", stream);
return;
}
@@ -787,14 +788,14 @@ print_command_line (cmd, depth)
and return. */
if (cmd->control_type == continue_control)
{
- fputs_filtered ("loop_continue\n", gdb_stdout);
+ fputs_filtered ("loop_continue\n", stream);
return;
}
/* loop_break to break out of a while loop, print it and return. */
if (cmd->control_type == break_control)
{
- fputs_filtered ("loop_break\n", gdb_stdout);
+ fputs_filtered ("loop_break\n", stream);
return;
}
@@ -802,13 +803,13 @@ print_command_line (cmd, depth)
if (cmd->control_type == while_control)
{
struct command_line *list;
- fputs_filtered ("while ", gdb_stdout);
- fputs_filtered (cmd->line, gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ fputs_filtered ("while ", stream);
+ fputs_filtered (cmd->line, stream);
+ fputs_filtered ("\n", stream);
list = *cmd->body_list;
while (list)
{
- print_command_line (list, depth + 1);
+ print_command_line (list, depth + 1, stream);
list = list->next;
}
}
@@ -816,11 +817,11 @@ print_command_line (cmd, depth)
/* An if command. Recursively print both arms before returning. */
if (cmd->control_type == if_control)
{
- fputs_filtered ("if ", gdb_stdout);
- fputs_filtered (cmd->line, gdb_stdout);
- fputs_filtered ("\n", gdb_stdout);
+ fputs_filtered ("if ", stream);
+ fputs_filtered (cmd->line, stream);
+ fputs_filtered ("\n", stream);
/* The true arm. */
- print_command_line (cmd->body_list[0], depth + 1);
+ print_command_line (cmd->body_list[0], depth + 1, stream);
/* Show the false arm if it exists. */
if (cmd->body_count == 2)
@@ -828,17 +829,17 @@ print_command_line (cmd, depth)
if (depth)
{
for (i = 0; i < depth; i++)
- fputs_filtered (" ", gdb_stdout);
+ fputs_filtered (" ", stream);
}
- fputs_filtered ("else\n", gdb_stdout);
- print_command_line (cmd->body_list[1], depth + 1);
+ fputs_filtered ("else\n", stream);
+ print_command_line (cmd->body_list[1], depth + 1, stream);
}
if (depth)
{
for (i = 0; i < depth; i++)
- fputs_filtered (" ", gdb_stdout);
+ fputs_filtered (" ", stream);
}
- fputs_filtered ("end\n", gdb_stdout);
+ fputs_filtered ("end\n", stream);
}
}