gdb
2010-03-05 Corinna Vinschen <vinschen@redhat.com> Tom Tromey <tromey@redhat.com> * utils.c (host_char_to_target): Add 'gdbarch' argument. (parse_escape): Likewise. * python/py-utils.c (unicode_to_target_string): Update. (unicode_to_target_python_string): Update. (target_string_to_unicode): Update. * printcmd.c (printf_command): Update. * p-exp.y (yylex): Update. * objc-exp.y (yylex): Update. * mi/mi-parse.c: Include charset.h. (mi_parse_escape): New function. (mi_parse_argv): Use it. * jv-exp.y (yylex): Update. * i386-cygwin-tdep.c (i386_cygwin_auto_wide_charset): New function. (i386_cygwin_init_abi): Call set_gdbarch_auto_wide_charset. * gdbarch.sh (auto_charset, auto_wide_charset): New. * gdbarch.c: Rebuild. * gdbarch.h: Rebuild. * defs.h (parse_escape): Update. * cli/cli-setshow.c: Include arch-utils.h. (do_setshow_command): Update. * cli/cli-cmds.c (echo_command): Update. * charset.h (target_charset, target_wide_charset): Update. * charset.c: Include arch-utils.h. (target_charset_name): Default to "auto". (target_wide_charset_name): Likewise. (show_target_charset_name): Handle "auto". (show_target_wide_charset_name): Likewise. (be_le_arch): New global. (set_be_le_names): Add 'gdbarch' argument. (validate): Likewise. Don't call set_be_le_names. (set_charset_sfunc, set_host_charset_sfunc) (set_target_charset_sfunc, set_target_wide_charset_sfunc): Update. (target_charset): Add 'gdbarch' argument. (target_wide_charset): Likewise. Remove 'byte_order' argument. (auto_target_charset_name): New global. (default_auto_charset, default_auto_wide_charset): New functions. (_initialize_charset): Set auto_target_charset_name. Allow "auto" for target charsets. Copy result of nl_langinfo. Use GetACP if USE_WIN32API. * c-lang.c (charset_for_string_type): Add 'gdbarch' argument, remove 'byte_order' argument. Update. (classify_type): Likewise. (c_emit_char): Update. (c_printchar): Update. (c_printstr): Update. (c_get_string): Update. (evaluate_subexp_c): Update. * arch-utils.h (default_auto_charset, default_auto_wide_charset): Declare. * python/python.c (gdbpy_target_charset): New function. (gdbpy_target_wide_charset): Likewise. (GdbMethods): Update. * NEWS: Update. gdb/doc * gdb.texinfo (Basic Python): Document target_charset and target_wide_charset. gdb/testsuite * gdb.python/py-prettyprint.py (pp_nullstr.to_string): Use gdb.target_charset. (pp_ns.to_string): Likewise.
This commit is contained in:
parent
78e2826bcc
commit
f870a310ee
25 changed files with 397 additions and 72 deletions
10
gdb/utils.c
10
gdb/utils.c
|
@ -1653,7 +1653,7 @@ query (const char *ctlstr, ...)
|
|||
function returns 1. Otherwise, the function returns 0. */
|
||||
|
||||
static int
|
||||
host_char_to_target (int c, int *target_c)
|
||||
host_char_to_target (struct gdbarch *gdbarch, int c, int *target_c)
|
||||
{
|
||||
struct obstack host_data;
|
||||
char the_char = c;
|
||||
|
@ -1663,7 +1663,7 @@ host_char_to_target (int c, int *target_c)
|
|||
obstack_init (&host_data);
|
||||
cleanups = make_cleanup_obstack_free (&host_data);
|
||||
|
||||
convert_between_encodings (target_charset (), host_charset (),
|
||||
convert_between_encodings (target_charset (gdbarch), host_charset (),
|
||||
&the_char, 1, 1, &host_data, translit_none);
|
||||
|
||||
if (obstack_object_size (&host_data) == 1)
|
||||
|
@ -1692,7 +1692,7 @@ host_char_to_target (int c, int *target_c)
|
|||
after the zeros. A value of 0 does not mean end of string. */
|
||||
|
||||
int
|
||||
parse_escape (char **string_ptr)
|
||||
parse_escape (struct gdbarch *gdbarch, char **string_ptr)
|
||||
{
|
||||
int target_char = -2; /* initialize to avoid GCC warnings */
|
||||
int c = *(*string_ptr)++;
|
||||
|
@ -1758,11 +1758,11 @@ parse_escape (char **string_ptr)
|
|||
break;
|
||||
}
|
||||
|
||||
if (!host_char_to_target (c, &target_char))
|
||||
if (!host_char_to_target (gdbarch, c, &target_char))
|
||||
error
|
||||
("The escape sequence `\%c' is equivalent to plain `%c', which"
|
||||
" has no equivalent\n" "in the `%s' character set.", c, c,
|
||||
target_charset ());
|
||||
target_charset (gdbarch));
|
||||
return target_char;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue