summaryrefslogtreecommitdiff
path: root/gdb/rs6000-aix-tdep.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2012-10-23 15:37:21 +0000
committerJoel Brobecker <brobecker@gnat.com>2012-10-23 15:37:21 +0000
commitf8711c468527f9f5a15382d9cbf8b0d8b2cb92ab (patch)
tree8fa179d79c9569ff1ec4c63896bc6ac007b09db4 /gdb/rs6000-aix-tdep.c
parent535ddb5a0174a2fdb9076369721df0c5f4f276b3 (diff)
downloadgdb-f8711c468527f9f5a15382d9cbf8b0d8b2cb92ab.tar.gz
Change target-wide-charset to UTF-16 on ppc-aix.
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.
Diffstat (limited to 'gdb/rs6000-aix-tdep.c')
-rw-r--r--gdb/rs6000-aix-tdep.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 06b43de217a..b4fc931d2b3 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. */