This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [patch/rfc/hppa] handle setting gp for calling shlib functions
- From: Randolph Chung <randolph at tausq dot org>
- To: Andrew Cagney <cagney at gnu dot org>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 29 Apr 2004 08:07:04 -0700
- Subject: Re: [patch/rfc/hppa] handle setting gp for calling shlib functions
- References: <20040429062324.GX3965@tausq.org> <40910D4F.1020700@gnu.org>
- Reply-to: Randolph Chung <randolph at tausq dot org>
> > 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/