diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-10-19 19:58:18 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-10-19 19:58:18 +0000 |
commit | beb4b03cbebf97e3f16836a770c8eced22ee6a1c (patch) | |
tree | 499f916416078ff34e6c63911160de180739d686 /gdb/rs6000-aix-tdep.c | |
parent | a5b1262727001de95f76936d2462e92fe183a8e7 (diff) | |
download | gdb-beb4b03cbebf97e3f16836a770c8eced22ee6a1c.zip gdb-beb4b03cbebf97e3f16836a770c8eced22ee6a1c.tar.gz gdb-beb4b03cbebf97e3f16836a770c8eced22ee6a1c.tar.bz2 |
ppc-aix osabi sniffer: Turn test of bfd flavour into assertion
Due to the way this function is registers, we know that given bfd's
flavour should always be bfd_target_xcoff_flavour, thus making
the former test always true, which means that this function should
always return GDB_OSABI_AIX, and never return GDB_OSABI_UNKNOWN.
This patch also fixes a typo detected by Tom Tromey that caused
the test itself to be completely ineffective.
gdb/ChangeLog (by Tom Tromey and Joel Brobecker):
* rs6000-aix-tdep.c (rs6000_aix_osabi_sniffer): Replace
inneffective if condition by gdb assertion. Add function
description comment.
Diffstat (limited to 'gdb/rs6000-aix-tdep.c')
-rw-r--r-- | gdb/rs6000-aix-tdep.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 59cfa73..06b43de 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -719,14 +719,19 @@ rs6000_software_single_step (struct frame_info *frame) return 1; } +/* Implement an osabi sniffer for RS6000/AIX. + + This function assumes that ABFD's flavour is XCOFF. In other words, + it should be registered as a sniffer for bfd_target_xcoff_flavour + objfiles only. A failed assertion will be raised if this condition + is not met. */ + static enum gdb_osabi rs6000_aix_osabi_sniffer (bfd *abfd) { - - if (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); - return GDB_OSABI_AIX; + gdb_assert (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); - return GDB_OSABI_UNKNOWN; + return GDB_OSABI_AIX; } static void |