On ppc-aix, type wchar_t is 2 bytes long, so override the default
target-wide-charset (UTF-32) with UTF-16. This allows us to print
wide characters correctly.
gdb/ChangeLog:
* rs6000-aix-tdep.c (rs6000_aix_auto_wide_charset): New function.
(rs6000_aix_init_osabi): Set auto_wide_charset gdbarch method.
+2012-10-23 Joel Brobecker <brobecker@adacore.com>
+
+ * rs6000-aix-tdep.c (rs6000_aix_auto_wide_charset): New function.
+ (rs6000_aix_init_osabi): Set auto_wide_charset gdbarch method.
+
2012-10-23 Joel Brobecker <brobecker@adacore.com>
* amd64-windows-tdep.c (amd64_windows_auto_wide_charset): New
return 1;
}
+/* Implement the "auto_wide_charset" gdbarch method for this platform. */
+
+static const char *
+rs6000_aix_auto_wide_charset (void)
+{
+ return "UTF-16";
+}
+
/* Implement an osabi sniffer for RS6000/AIX.
This function assumes that ABFD's flavour is XCOFF. In other words,
set_gdbarch_frame_red_zone_size (gdbarch, 224);
else
set_gdbarch_frame_red_zone_size (gdbarch, 0);
+
+ set_gdbarch_auto_wide_charset (gdbarch, rs6000_aix_auto_wide_charset);
}
/* Provide a prototype to silence -Wmissing-prototypes. */