This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [PATCH] "disassemble" crashes in console window
- To: Insight Maling List <insight at sources dot redhat dot com>
- Subject: Re: [PATCH] "disassemble" crashes in console window
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Tue, 21 Aug 2001 12:29:57 -0700 (PDT)
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
>
>
>