This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Remove mips/tm-linux.h
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: drow at false dot org (Daniel Jacobowitz)
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 2 May 2007 01:07:43 +0200 (CEST)
- Subject: Re: [rfc] Remove mips/tm-linux.h
Daniel Jacobowitz wrote:
> While working on mips64-linux more today, I decided to remove its
> DEPRECATED_TM_FILE setting. The problem was that it overrode
> IN_SOLIB_DYNSYM_RESOLVE_CODE, which isn't a gdbarch method; it lives
> in the solib_ops instead.
That had been on my list ;-) Thanks for beating me to it.
I'd been thinking of a somewhat different approach: the svr4
implementation checks really for two different things:
- whether the pc is inside the dynamic loader
- whether the pc is in a call stub on its way to the dynamic loader
The first is clearly a "solib" property, but the second is arguably
more of a gdbarch/osabi property. So I'd thought on removing the
in_plt_section check from svr4_in_solib_dynsym_resolve_code,
make a new gdbarch method with a default implementation to check
both in_solib_dynsym_resolve_code and in_plt_section, and use that
new method in infrun.c instead of in_solib_dynsym_resolve_code.
Then mips gdbarch could override that method, and call the
standard in_solib_dynsym_resolve_code plus its own special
check for dynamic stubs.
But I don't really object to your solution either, in particular:
> +/* Set the solib operations for GDBARCH to NEW_OPS. */
> +
> +extern void set_solib_ops (struct gdbarch *gdbarch,
> + struct target_so_ops *new_ops);
something like this is certainly a good idea. (E.g. to clean
up the mess NTO currenly has w.r.t. solib overrides ...)
Either way, there goes the last definition of
IN_SOLIB_DYNSYM_RESOLVE_CODE, so infrun.c could be cleaned
up a bit as a follow-on.
> Tested on mips64-linux, all three ABIs, no change in results.
I'm wondering why you didn't run into this #error in gdbarch.h:
#if !defined (GDB_TM_FILE) && defined (CANNOT_FETCH_REGISTER)
#error "Non multi-arch definition of CANNOT_FETCH_REGISTER"
#endif
#if !defined (GDB_TM_FILE) && defined (CANNOT_STORE_REGISTER)
#error "Non multi-arch definition of CANNOT_STORE_REGISTER"
#endif
because the mips-linux NM file still defines those two macros,
and you just removed the TM file ...
I did run into the that problem on ia64. That's the reason
why I was recently trying to remove the mips-linux NM file,
before going after the TM -- but that still isn't quite
resolved.
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com