From 38a69d0a4d05b7fb52902a3c9bd2360d7191af3b Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 23 Oct 2012 15:37:21 +0000 Subject: [PATCH] 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. --- gdb/ChangeLog | 5 +++++ gdb/rs6000-aix-tdep.c | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3216db6..d3d534d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2012-10-23 Joel Brobecker + * 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 + * amd64-windows-tdep.c (amd64_windows_auto_wide_charset): New function. (amd64_windows_init_abi): Set auto_wide_charset gdbarch method 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. */ -- 2.7.4