From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21985 invoked by alias); 20 May 2008 17:53:10 -0000 Received: (qmail 21973 invoked by uid 22791); 20 May 2008 17:53:10 -0000 X-Spam-Check-By: sourceware.org Received: from hq.tensilica.com (HELO mailapp.tensilica.com) (65.205.227.29) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 May 2008 17:52:53 +0000 Received: from localhost ([127.0.0.1]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1JyW0s-0006LN-RA; Tue, 20 May 2008 10:52:38 -0700 Received: from mailapp.tensilica.com ([127.0.0.1]) by localhost (mailapp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 23293-10; Tue, 20 May 2008 10:52:38 -0700 (PDT) Received: from maxim_fc5.hq.tensilica.com ([192.168.11.68]) by mailapp.tensilica.com with esmtp (Exim 4.34) id 1JyW0s-0006LI-HO; Tue, 20 May 2008 10:52:38 -0700 Message-ID: <48330FE6.1060907@hq.tensilica.com> Date: Tue, 20 May 2008 22:15:00 -0000 From: Maxim Grigoriev User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: Ulrich Weigand CC: Markus Deuling , GDB Patches Subject: Re: [patch] Get rid of current_gdbarch in xtensa References: <200805201532.m4KFWNcS021488@d12av02.megacenter.de.ibm.com> In-Reply-To: <200805201532.m4KFWNcS021488@d12av02.megacenter.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00606.txt.bz2 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 > >