Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: deuling@de.ibm.com (Markus Deuling), maxim2405@gmail.com
Cc: gdb-patches@sourceware.org (GDB Patches)
Subject: Re: [patch] Get rid of current_gdbarch in xtensa
Date: Tue, 20 May 2008 18:08:00 -0000	[thread overview]
Message-ID: <200805201532.m4KFWNcS021488@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <4830FF13.4070605@de.ibm.com> from "Markus Deuling" at May 19, 2008 06:16:19 AM

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


  reply	other threads:[~2008-05-20 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-19 15:17 Markus Deuling
2008-05-20 18:08 ` Ulrich Weigand [this message]
2008-05-20 22:15   ` Maxim Grigoriev
2008-05-20 22:23     ` Ulrich Weigand
2008-05-21 22:27   ` [commit] " Maxim Grigoriev
2008-05-23 14:44     ` Markus Deuling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200805201532.m4KFWNcS021488@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=deuling@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=maxim2405@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox