This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: osabi: correct test for compatible handlers
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com,Kris Warkentin <kewarken at qnx dot com>,Daniel Jacobowitz <drow at mvista dot com>
- Date: Wed, 22 Oct 2003 14:49:12 -0400
- Subject: Re: RFA: osabi: correct test for compatible handlers
- References: <vt2n0buw7r5.fsf@zenia.home>
+ /* BFD's 'A->compatible (A, B)' functions return zero if A and B are
+ incompatible. But if they are compatible, it returns the 'more
+ featureful' of the two arches. That is, if A can run code
+ written for B, but B can't run code written for A, then it'll
+ return A.
+
+ struct bfd_arch_info objects are atoms: that is, there's supposed
+ to be exactly one instance for a given machine. So you can tell
+ whether two are equivalent by comparing pointers. */
+ return (a == b || a->compatible (a, b) == a);
Hey, nice.
Don't worry about a can_run_code_for function though, having the logic
inline makes what's happening easier to understand (and will simplify a
follow-on wild-card patch I've got pending).
Andrew