This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Get rid of current_gdbarch in xtensa


Hello Ulrich and Markus,

Thanks for taking care of Xtensa.

I think xtensa_read_register() should be eliminated.
If you don't mind I can take the original Markus's patch
from here and finish and test it.

Thanks,
-- Maxim


Ulrich Weigand wrote:
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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]