From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32655 invoked by alias); 29 Apr 2004 15:07:04 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 32645 invoked from network); 29 Apr 2004 15:07:00 -0000 Received: from unknown (HELO pippin.tausq.org) (64.81.244.94) by sources.redhat.com with SMTP; 29 Apr 2004 15:07:00 -0000 Received: by pippin.tausq.org (Postfix, from userid 1000) id 92C5ECD28A; Thu, 29 Apr 2004 08:07:04 -0700 (PDT) Date: Thu, 29 Apr 2004 15:07:00 -0000 From: Randolph Chung To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc/hppa] handle setting gp for calling shlib functions Message-ID: <20040429150704.GZ3965@tausq.org> Reply-To: Randolph Chung References: <20040429062324.GX3965@tausq.org> <40910D4F.1020700@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40910D4F.1020700@gnu.org> X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00672.txt.bz2 > > static CORE_ADDR > >+hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch, > >+ CORE_ADDR addr, > >+ struct target_ops *targ) > >+{ > >+ if (addr & 2) > >+ { > >+ ULONGEST gp; > >+ > >+ addr &= ~3; > >+ > >+ gp = read_memory_unsigned_integer (addr + 4, 4); > >+ write_register (19, gp); > >+ addr = read_memory_unsigned_integer (addr, 4); > >+ } > >+ > >+ return addr; > >+} > >+ > >+static CORE_ADDR > > This should be using TARG methods read memory(2), and should not be > writing GP to register 19. First point is understood, but about writing to register -- How else can this be handled? i.e. where else in the code path of call_function_by_hand () will I be able to get ahold of the function descriptor and set the gp? Unfortunately the func_addr that is passed into push_dummy_call is already the canonicalized function address, so i cannot do this as part of e.g. find_global_pointer. thanks, randolph -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/