RFA: probable rs6000-aix-tdep.c bug found by clang

Pedro Alves palves@redhat.com
Thu Oct 18 09:10:00 GMT 2012

On 10/17/2012 10:24 PM, Joel Brobecker wrote:
>> Based on indentation and logic I think that the fix is to remove the ";".
>> However, I have no decent way to test this and would appreciate someone
>> else looking at it.
> [...]
>> 2012-10-17  Tom Tromey  <tromey@redhat.com>
>> 	* rs6000-aix-tdep.c (rs6000_aix_osabi_sniffer): Remove extraneous
>> 	semicolon.

I suspect this is the root cause of PR8966 (AIX 5.1 single_step configuration
is broken).  http://sourceware.org/bugzilla/show_bug.cgi?id=8966

We're always returning the _UNKNOWN osabi, so this is unreachable:

static void
rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);

  /* RS6000/AIX does not support PT_STEP.  Has to be simulated.  */
  set_gdbarch_software_single_step (gdbarch, rs6000_software_single_step);

> In fact, going one step further, do we need the check at all?
> This is how the sniffer is registered:
>   gdbarch_register_osabi_sniffer (bfd_arch_rs6000,
>                                   bfd_target_xcoff_flavour,
>                                   rs6000_aix_osabi_sniffer);
>   gdbarch_register_osabi_sniffer (bfd_arch_powerpc,
>                                   bfd_target_xcoff_flavour,
>                                   rs6000_aix_osabi_sniffer);
> So, isn't rs6000_aix_osabi_sniffer going to be called if, and only
> if, the bfd has a bfd_target_xcoff_flavour, thus making the check
> superfluous?

Sure looks like it.

Pedro Alves

More information about the Gdb-patches mailing list