Re: [PATCH 2/2] Notice architecture changes even when the register window is not open.

Keith Seitz <[email protected]> Thu, 05 Sep 2013 12:00:07 -0700
Newsgroups gmane.comp.debugging.insight
Message-ID <[email protected]>
On 09/05/2013 07:27 AM, Andrew Burgess wrote:
> I think this a bad situation to be in as, the reg-cache would ideally
> be hidden from the user of "gdb_reginfo", and secondly, we only
> really need to update the reg-cache once per architecture change, not
> many times, which could happen if many users are all trying to keep
> the reg-cache upto date.

Ouch. I believe at the time, this was never considered. I'm not even 
sure if it was possible. Nonetheless, it clearly *is* possible now, so 
thank you for tracking this down.

BTW, what architecture are you using to trigger this bug?

> Anyway, let me know what you think, all feedback welcome.

One little comment below.

> Index: ./gdb/gdbtk/library/interface.tcl
> ===================================================================
> RCS file: /cvs/src/src/gdb/gdbtk/library/interface.tcl,v
> retrieving revision 1.60
> diff -u -p -r1.60 interface.tcl
> --- ./gdb/gdbtk/library/interface.tcl	9 Oct 2009 01:23:55 -0000	1.60
> +++ ./gdb/gdbtk/library/interface.tcl	5 Sep 2013 14:19:53 -0000
> @@ -1815,6 +1815,9 @@ proc initialize_gdbtk {} {
>   # The architecture changed. Inform the UI.
>   proc gdbtk_tcl_architecture_changed {} {
>     set e [ArchChangedEvent \#auto]
> +  # First perform global actions as a result of the architecture change.
> +  gdb_reg_arch_changed $e
> +  # Now dispatch to all the other even handlers.

typo ("even[t] handlers")

>     GDBEventHandler::dispatch $e
>     delete object $e
>   }

Okay with that change.

Keith