* [PATCH] "disassemble" crashes in console window
@ 2001-08-21 9:55 Keith Seitz
2001-08-21 12:30 ` Keith Seitz
0 siblings, 1 reply; 2+ messages in thread
From: Keith Seitz @ 2001-08-21 9:55 UTC (permalink / raw)
To: Insight Maling List
Hi,
When disassembling in the console window, Insight would often crash. This
happens because _initialize_gdbarch calls INIT_DISASSEMBLE_INFO_NO_ARCH
with gdb_stdout, which is the vanilla gdb_stdout from top.c.
Later when gdbtk_init is called, we delete gdb_stdout and reset it to a
new stream which calls our fprintf routine. As a result,
tm_print_insn_info contains a bogus stream for output.
The following patch re-registers our new gdb_stdout as the default output
stream. (And no, you cannot just call INIT_DISASSEMBLE_INFO again!)
Keith
ChangeLog
2001-08-21 Keith Seitz <keiths@redhat.com>
* generic/gdbtk.c (gdbtk_init): Reinitialize disassemle info's
stream parameter: we just deleted the one it saved when we
re-routed gdb_stdout to our own gdb_stdout.
Patch
Index: generic/gdbtk.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
retrieving revision 1.18
diff -u -p -r1.18 gdbtk.c
--- gdbtk.c 2001/08/16 23:04:46 1.18
+++ gdbtk.c 2001/08/21 16:51:59
@@ -586,6 +586,10 @@ gdbtk_init (argv0)
gdb_stdtarg = gdbtk_fileopen ();
uiout = cli_out_new (gdb_stdout);
+ /* We need to re-register the standard disassembler's
+ output, since we just changed gdb_stdout. */
+ tm_print_insn_info.stream = gdb_stdout;
+
#ifdef __CYGWIN32__
(void) FreeConsole ();
#endif
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] "disassemble" crashes in console window
2001-08-21 9:55 [PATCH] "disassemble" crashes in console window Keith Seitz
@ 2001-08-21 12:30 ` Keith Seitz
0 siblings, 0 replies; 2+ messages in thread
From: Keith Seitz @ 2001-08-21 12:30 UTC (permalink / raw)
To: Insight Maling List
Gdb just fixed this properly. I'm reverting this change.
(Got approval in gdb a lot quicker than I anticipated!)
Keith
On Tue, 21 Aug 2001, Keith Seitz wrote:
> Hi,
>
> When disassembling in the console window, Insight would often crash. This
> happens because _initialize_gdbarch calls INIT_DISASSEMBLE_INFO_NO_ARCH
> with gdb_stdout, which is the vanilla gdb_stdout from top.c.
>
> Later when gdbtk_init is called, we delete gdb_stdout and reset it to a
> new stream which calls our fprintf routine. As a result,
> tm_print_insn_info contains a bogus stream for output.
>
> The following patch re-registers our new gdb_stdout as the default output
> stream. (And no, you cannot just call INIT_DISASSEMBLE_INFO again!)
>
> Keith
>
> ChangeLog
> 2001-08-21 Keith Seitz <keiths@redhat.com>
>
> * generic/gdbtk.c (gdbtk_init): Reinitialize disassemle info's
> stream parameter: we just deleted the one it saved when we
> re-routed gdb_stdout to our own gdb_stdout.
>
> Patch
> Index: generic/gdbtk.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk.c,v
> retrieving revision 1.18
> diff -u -p -r1.18 gdbtk.c
> --- gdbtk.c 2001/08/16 23:04:46 1.18
> +++ gdbtk.c 2001/08/21 16:51:59
> @@ -586,6 +586,10 @@ gdbtk_init (argv0)
> gdb_stdtarg = gdbtk_fileopen ();
> uiout = cli_out_new (gdb_stdout);
>
> + /* We need to re-register the standard disassembler's
> + output, since we just changed gdb_stdout. */
> + tm_print_insn_info.stream = gdb_stdout;
> +
> #ifdef __CYGWIN32__
> (void) FreeConsole ();
> #endif
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-08-21 12:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-21 9:55 [PATCH] "disassemble" crashes in console window Keith Seitz
2001-08-21 12:30 ` Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).