diff options
author | Andrew Cagney <cagney@redhat.com> | 2003-10-24 15:36:17 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2003-10-24 15:36:17 +0000 |
commit | 5f72444609f5780f39bb60c1b04b1616a3fbc888 (patch) | |
tree | fc8662c4aec02ab8de5bd0bd4339d6aa94e554ed | |
parent | e3d54347fecd99fe254b14a8613f2d2cdca1747e (diff) | |
download | gdb-5f72444609f5780f39bb60c1b04b1616a3fbc888.zip gdb-5f72444609f5780f39bb60c1b04b1616a3fbc888.tar.gz gdb-5f72444609f5780f39bb60c1b04b1616a3fbc888.tar.bz2 |
2003-10-24 Andrew Cagney <cagney@redhat.com>
* osabi.c (gdbarch_init_osabi): Add comment on 32-bit vs 64-bit.
(can_run_code_for): Use the OO term "singleton".
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/osabi.c | 14 |
2 files changed, 16 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9d4e324..176863b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-10-24 Andrew Cagney <cagney@redhat.com> + + * osabi.c (gdbarch_init_osabi): Add comment on 32-bit vs 64-bit. + (can_run_code_for): Use the OO term "singleton". + 2003-10-23 Andrew Cagney <cagney@redhat.com> * Makefile.in (stack.o): Add $(regcache_h). diff --git a/gdb/osabi.c b/gdb/osabi.c index e7774b7..fc712a6 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -295,9 +295,9 @@ can_run_code_for (const struct bfd_arch_info *a, const struct bfd_arch_info *b) 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. */ + struct bfd_arch_info objects are singletons: 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); } @@ -333,6 +333,14 @@ gdbarch_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch) type that is compatible with the desired machine type. Right now we simply return the first match, which is fine for now. However, we might want to do something smarter in the future. */ + /* NOTE: cagney/2003-10-23: The code for "a can_run_code_for b" + is implemented using BFD's compatible method (a->compatible + (b) == a -- the lowest common denominator between a and b is + a). That method's definition of compatible may not be as you + expect. For instance, while "amd64 can run code for i386" + (or more generally "64-bit ISA can run code for the 32-bit + ISA"). Fortunatly, BFD doesn't normally consider 32-bit and + 64-bit "compatible" so won't get a match. */ if (can_run_code_for (arch_info, handler->arch_info)) { (*handler->init_osabi) (info, gdbarch); |