* win32-nat.c (safe_symbol_file_add_args): Store old gdb_stderr and gdb_stdout
here. (safe_symbol_file_add_stub): Redirect gdb_stdout as well as stderr. (safe_symbol_file_add_cleanup): Restore gdb_stdout. (info_dll_command): Use the pager for displaying DLLs since there are often quite a few.
This commit is contained in:
parent
5c8cc33173
commit
7c5c87c02d
3 changed files with 35 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
|||
Sat Jun 10 22:31:46 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* win32-nat.c (safe_symbol_file_add_args): Store old gdb_stderr and
|
||||
gdb_stdout here.
|
||||
(safe_symbol_file_add_stub): Redirect gdb_stdout as well as stderr.
|
||||
(safe_symbol_file_add_cleanup): Restore gdb_stdout.
|
||||
(info_dll_command): Use the pager for displaying DLLs since there are
|
||||
often quite a few.
|
||||
|
||||
Sun Jun 11 11:34:05 2000 Andrew Cagney <cagney@b1.cygnus.com>
|
||||
|
||||
From Sat Jun 10 17:54:04 2000 Hans-Peter Nilsson <hp@axis.com>:
|
||||
|
|
|
@ -422,6 +422,7 @@ struct safe_symbol_file_add_args
|
|||
struct section_addr_info *addrs;
|
||||
int mainline;
|
||||
int flags;
|
||||
struct ui_file *err, *out;
|
||||
struct objfile *ret;
|
||||
};
|
||||
|
||||
|
@ -438,11 +439,15 @@ safe_symbol_file_add_stub (void *argv)
|
|||
|
||||
/* Restore gdb's stderr after calling symbol_file_add */
|
||||
static void
|
||||
safe_symbol_file_add_cleanup (void *gdb_stderrv)
|
||||
safe_symbol_file_add_cleanup (void *p)
|
||||
{
|
||||
#define sp ((struct safe_symbol_file_add_args *)p)
|
||||
gdb_flush (gdb_stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
ui_file_delete (gdb_stderr);
|
||||
gdb_stderr = (struct ui_file *)gdb_stderrv;
|
||||
ui_file_delete (gdb_stdout);
|
||||
gdb_stderr = sp->err;
|
||||
gdb_stdout = sp->err;
|
||||
}
|
||||
|
||||
/* symbol_file_add wrapper that prevents errors from being displayed. */
|
||||
|
@ -455,10 +460,14 @@ safe_symbol_file_add (char *name, int from_tty,
|
|||
struct safe_symbol_file_add_args p;
|
||||
struct cleanup *cleanup;
|
||||
|
||||
cleanup = make_cleanup (safe_symbol_file_add_cleanup, gdb_stderr);
|
||||
cleanup = make_cleanup (safe_symbol_file_add_cleanup, &p);
|
||||
|
||||
p.err = gdb_stderr;
|
||||
p.out = gdb_stdout;
|
||||
gdb_flush (gdb_stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
gdb_stderr = ui_file_new ();
|
||||
gdb_stdout = ui_file_new ();
|
||||
p.name = name;
|
||||
p.from_tty = from_tty;
|
||||
p.addrs = addrs;
|
||||
|
@ -652,7 +661,7 @@ info_dll_command (char *ignore, int from_tty)
|
|||
|
||||
printf ("%*s Load Address\n", -max_dll_name_len, "DLL Name");
|
||||
while ((so = so->next) != NULL)
|
||||
printf_unfiltered ("%*s %08lx\n", -max_dll_name_len, so->name, so->load_addr);
|
||||
printf_filtered ("%*s %08lx\n", -max_dll_name_len, so->name, so->load_addr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -422,6 +422,7 @@ struct safe_symbol_file_add_args
|
|||
struct section_addr_info *addrs;
|
||||
int mainline;
|
||||
int flags;
|
||||
struct ui_file *err, *out;
|
||||
struct objfile *ret;
|
||||
};
|
||||
|
||||
|
@ -438,11 +439,15 @@ safe_symbol_file_add_stub (void *argv)
|
|||
|
||||
/* Restore gdb's stderr after calling symbol_file_add */
|
||||
static void
|
||||
safe_symbol_file_add_cleanup (void *gdb_stderrv)
|
||||
safe_symbol_file_add_cleanup (void *p)
|
||||
{
|
||||
#define sp ((struct safe_symbol_file_add_args *)p)
|
||||
gdb_flush (gdb_stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
ui_file_delete (gdb_stderr);
|
||||
gdb_stderr = (struct ui_file *)gdb_stderrv;
|
||||
ui_file_delete (gdb_stdout);
|
||||
gdb_stderr = sp->err;
|
||||
gdb_stdout = sp->err;
|
||||
}
|
||||
|
||||
/* symbol_file_add wrapper that prevents errors from being displayed. */
|
||||
|
@ -455,10 +460,14 @@ safe_symbol_file_add (char *name, int from_tty,
|
|||
struct safe_symbol_file_add_args p;
|
||||
struct cleanup *cleanup;
|
||||
|
||||
cleanup = make_cleanup (safe_symbol_file_add_cleanup, gdb_stderr);
|
||||
cleanup = make_cleanup (safe_symbol_file_add_cleanup, &p);
|
||||
|
||||
p.err = gdb_stderr;
|
||||
p.out = gdb_stdout;
|
||||
gdb_flush (gdb_stderr);
|
||||
gdb_flush (gdb_stdout);
|
||||
gdb_stderr = ui_file_new ();
|
||||
gdb_stdout = ui_file_new ();
|
||||
p.name = name;
|
||||
p.from_tty = from_tty;
|
||||
p.addrs = addrs;
|
||||
|
@ -652,7 +661,7 @@ info_dll_command (char *ignore, int from_tty)
|
|||
|
||||
printf ("%*s Load Address\n", -max_dll_name_len, "DLL Name");
|
||||
while ((so = so->next) != NULL)
|
||||
printf_unfiltered ("%*s %08lx\n", -max_dll_name_len, so->name, so->load_addr);
|
||||
printf_filtered ("%*s %08lx\n", -max_dll_name_len, so->name, so->load_addr);
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue