This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA/commit] Change target-wide-charset to UTF-16 on ppc-aix.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Fri, 19 Oct 2012 13:12:37 -0700
- Subject: [RFA/commit] Change target-wide-charset to UTF-16 on ppc-aix.
Same as Windows64, where we're having trouble printing wchar_t
characters, but this time on ppc-aix
(http://www.sourceware.org/ml/gdb-patches/2012-10/msg00361.html).
Same fix.
gdb/ChangeLog:
* rs6000-aix-tdep.c (rs6000_aix_auto_wide_charset): New function.
(rs6000_aix_init_osabi): Set auto_wide_charset gdbarch method.
Tested on ppc-aix, using AdaCore's testsuite. It should fix
gdb.base/wchar.exp.
I'll commit in a few days unless there are objections.
---
gdb/rs6000-aix-tdep.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 06b43de..b4fc931 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -719,6 +719,14 @@ rs6000_software_single_step (struct frame_info *frame)
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,
@@ -775,6 +783,8 @@ rs6000_aix_init_osabi (struct gdbarch_info info, struct gdbarch *gdbarch)
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. */
--
1.7.9.5