This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: "maint print registers" crash
On Wed, Jun 20, 2007 at 10:26:29PM +0200, Ulrich Weigand wrote:
> Daniel Jacobowitz wrote:
> > I used to be able to start GDB and print out the current register
> > layout without needing a target, by "maint print registers". Now that
> > crashes GDB, because current_regcache is NULL. What do you think -
> > refuse to dump values and use the gdbarch_descr in that case?
>
> Ah, that usage of current_regcache is a bug anyway; I must have
> overlooked it. current_regcache can now be NULL at other times
> as well (always after registers_changed () for example); no code
> should simply use that variable any more.
>
> The following patch changes it to use get_current_regcache ()
> instead, which currently always succeeds allocating a register
> cache (even if we don't have an inferior yet).
>
> That gets "maint print registers" immediately after startup
> working for me. Does this solve your problem?
Yes, this works great - thanks!
--
Daniel Jacobowitz
CodeSourcery