This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Get rid of current_gdbarch in xtensa
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: deuling at de dot ibm dot com (Markus Deuling), maxim2405 at gmail dot com
- Cc: gdb-patches at sourceware dot org (GDB Patches)
- Date: Tue, 20 May 2008 17:32:23 +0200 (CEST)
- Subject: Re: [patch] Get rid of current_gdbarch in xtensa
Markus Deuling wrote:
> @@ -2034,9 +2034,9 @@ call0_track_op (xtensa_c0reg_t dst[], xt
> /* 2 operands: dst, literal offset. */
> gdb_assert (nods == 2);
> /* litbase = xtensa_get_litbase (pc); can be also used. */
> - litbase = (gdbarch_tdep (current_gdbarch)->litbase_regnum == -1)
> + litbase = (gdbarch_tdep (gdbarch)->litbase_regnum == -1)
> ? 0 : xtensa_read_register
> - (gdbarch_tdep (current_gdbarch)->litbase_regnum);
> + (gdbarch_tdep (gdbarch)->litbase_regnum);
There's really a different problem here: xtensa_read_register simply
uses get_current_regcache () to retrieve that "litbase" register.
This seems quite broken, in particular when call0_track_op is called
out of the xtensa_skip_prologue code path, where the current regcache
may not really be related at all to the function that is being
queried ...
In those cases where we have a proper frame to read from, the question
of how to retrieve the litbase register number should resolve itself
automatically.
Maxim, do you have any suggestions how to handle this? Is there a
way to retrieve the "litbase" in the xtensa_skip_prologue case?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com