GDB (xrefs)
|
#include "defs.h"
#include "charset.h"
#include "gdbcmd.h"
#include "gdbsupport/gdb_obstack.h"
#include "gdbsupport/gdb_wait.h"
#include "charset-list.h"
#include "gdbsupport/environ.h"
#include "arch-utils.h"
#include "gdbsupport/gdb_vecs.h"
#include <ctype.h>
Go to the source code of this file.
Classes | |
class | iconv_wrapper |
struct | charset_vector |
Macros | |
#define | GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" |
#define | GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET |
#define | GDB_DEFAULT_TARGET_WIDE_CHARSET "UTF-32" |
#define | DEFAULT_CHARSET_NAMES GDB_DEFAULT_HOST_CHARSET , |
#define | iconv_t int |
#define | iconv_open phony_iconv_open |
#define | iconv phony_iconv |
#define | iconv_close phony_iconv_close |
#define | ICONV_CONST const |
Functions | |
static iconv_t | phony_iconv_open (const char *to, const char *from) |
static int | phony_iconv_close (iconv_t arg) |
static size_t | phony_iconv (iconv_t utf_flag, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) |
static void | show_host_charset_name (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | show_target_charset_name (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | show_target_wide_charset_name (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | set_be_le_names (struct gdbarch *gdbarch) |
static void | validate (struct gdbarch *gdbarch) |
static void | set_charset_sfunc (const char *charset, int from_tty, struct cmd_list_element *c) |
static void | set_host_charset_sfunc (const char *charset, int from_tty, struct cmd_list_element *c) |
static void | set_target_charset_sfunc (const char *charset, int from_tty, struct cmd_list_element *c) |
static void | set_target_wide_charset_sfunc (const char *charset, int from_tty, struct cmd_list_element *c) |
static void | show_charset (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *name) |
const char * | host_charset (void) |
const char * | target_charset (struct gdbarch *gdbarch) |
const char * | target_wide_charset (struct gdbarch *gdbarch) |
char | host_letter_to_control_character (char c) |
void | convert_between_encodings (const char *from, const char *to, const gdb_byte *bytes, unsigned int num_bytes, int width, struct obstack *output, enum transliterations translit) |
static void | find_charset_names (void) |
const char * | default_auto_charset (void) |
const char * | default_auto_wide_charset (void) |
void | _initialize_charset () |
Variables | |
static const char * | auto_host_charset_name = GDB_DEFAULT_HOST_CHARSET |
static const char * | host_charset_name = "auto" |
static const char * | target_charset_name = "auto" |
static const char * | target_wide_charset_name = "auto" |
static const char *const | default_charset_names [] |
static const char *const * | charset_enum |
static const char * | target_wide_charset_be_name |
static const char * | target_wide_charset_le_name |
static struct gdbarch * | be_le_arch |
static charset_vector | charsets |
static const char * | auto_target_charset_name = GDB_DEFAULT_TARGET_CHARSET |
#define DEFAULT_CHARSET_NAMES GDB_DEFAULT_HOST_CHARSET , |
#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" |
Definition at line 82 of file charset.c.
Referenced by find_charset_names(), and phony_iconv_open().
#define GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET |
#define GDB_DEFAULT_TARGET_WIDE_CHARSET "UTF-32" |
Definition at line 85 of file charset.c.
Referenced by default_auto_wide_charset().
#define iconv phony_iconv |
Definition at line 94 of file charset.c.
Referenced by iconv_wrapper::convert(), and wchar_iterator::iterate().
#define iconv_close phony_iconv_close |
Definition at line 96 of file charset.c.
Referenced by validate(), iconv_wrapper::~iconv_wrapper(), and wchar_iterator::~wchar_iterator().
#define ICONV_CONST const |
Definition at line 99 of file charset.c.
Referenced by convert_between_encodings(), and wchar_iterator::iterate().
#define iconv_open phony_iconv_open |
Definition at line 92 of file charset.c.
Referenced by iconv_wrapper::iconv_wrapper(), validate(), and wchar_iterator::wchar_iterator().
#define iconv_t int |
Definition at line 90 of file charset.c.
Referenced by iconv_wrapper::iconv_wrapper(), validate(), wchar_iterator::wchar_iterator(), and wchar_iterator::~wchar_iterator().
void _initialize_charset | ( | ) |
Definition at line 988 of file charset.c.
Referenced by initialize_all_files().
void convert_between_encodings | ( | const char * | from, |
const char * | to, | ||
const gdb_byte * | bytes, | ||
unsigned int | num_bytes, | ||
int | width, | ||
struct obstack * | output, | ||
enum transliterations | translit ) |
Definition at line 497 of file charset.c.
References iconv_wrapper::convert(), ICONV_CONST, and translit_none.
Referenced by ada_encode_1(), ada_fold_name(), convert_from_hex_encoded(), convert_ucn(), expr::ada_string_operation::evaluate(), generic_emit_char(), generic_printstr(), host_char_to_target(), lex_multibyte_char(), rust_parser::lex_string(), parse_one_string(), printf_wide_c_string(), and ui_printf().
const char * default_auto_charset | ( | void | ) |
Definition at line 920 of file charset.c.
References auto_target_charset_name.
const char * default_auto_wide_charset | ( | void | ) |
Definition at line 926 of file charset.c.
References GDB_DEFAULT_TARGET_WIDE_CHARSET.
|
static |
Definition at line 722 of file charset.c.
References charset_vector::charsets, charsets, and GDB_DEFAULT_HOST_CHARSET.
const char * host_charset | ( | void | ) |
Definition at line 416 of file charset.c.
References auto_host_charset_name, and host_charset_name.
Referenced by ada_encode_1(), ada_fold_name(), cmdpy_completer_helper(), cmdpy_function(), cmdscm_add_completion(), cmdscm_completer(), cmdscm_function(), convert_from_hex_encoded(), disasmpy_addr_part_str(), disasmpy_result_str(), disasmpy_text_part_str(), expr::ada_string_operation::evaluate(), frapy_name(), gdbpy_frame_stop_reason_string(), gdbscm_scm_from_host_string(), gdbscm_scm_to_host_string(), gdbscm_value_print(), generic_emit_char(), generic_printstr(), host_char_to_target(), host_string_to_python_string(), mi_command_py::invoke(), lex_multibyte_char(), parse_one_string(), pending_framepy_name(), printf_wide_c_string(), python_string_to_host_string(), typy_repr(), typy_str(), ui_printf(), validate(), valpy_format_string(), and valpy_str().
|
static |
Definition at line 131 of file charset.c.
References extract_unsigned_integer().
|
static |
Definition at line 107 of file charset.c.
References GDB_DEFAULT_HOST_CHARSET.
|
static |
Definition at line 295 of file charset.c.
References be_le_arch, charset_enum, gdbarch_auto_wide_charset(), target_wide_charset_be_name, target_wide_charset_le_name, and target_wide_charset_name.
Referenced by target_wide_charset().
|
static |
Definition at line 367 of file charset.c.
References get_current_arch(), host_charset_name, target_charset_name, and validate().
|
static |
Definition at line 378 of file charset.c.
References get_current_arch(), and validate().
|
static |
Definition at line 386 of file charset.c.
References get_current_arch(), and validate().
|
static |
Definition at line 394 of file charset.c.
References get_current_arch(), and validate().
|
static |
Definition at line 402 of file charset.c.
References host_charset_name, show_host_charset_name(), show_target_charset_name(), show_target_wide_charset_name(), target_charset_name, and target_wide_charset_name.
|
static |
Definition at line 230 of file charset.c.
References auto_host_charset_name, and gdb_printf().
Referenced by show_charset().
|
static |
Definition at line 244 of file charset.c.
References gdb_printf(), gdbarch_auto_charset(), and get_current_arch().
Referenced by show_charset().
|
static |
Definition at line 259 of file charset.c.
References gdb_printf(), gdbarch_auto_wide_charset(), and get_current_arch().
Referenced by show_charset().
const char * target_charset | ( | struct gdbarch * | gdbarch | ) |
Definition at line 424 of file charset.c.
References gdbarch_auto_charset(), and target_charset_name.
Referenced by charset_for_string_type(), rust_language::emitchar(), gdbscm_arch_charset(), f_language::get_encoding(), host_char_to_target(), parse_escape(), ppscm_print_string_repr(), unicode_to_target_python_string(), unicode_to_target_string(), validate(), and vlscm_convert_typed_value_from_scheme().
const char * target_wide_charset | ( | struct gdbarch * | gdbarch | ) |
Definition at line 432 of file charset.c.
References gdbarch_auto_wide_charset(), gdbarch_byte_order(), set_be_le_names(), target_wide_charset_be_name, target_wide_charset_le_name, and target_wide_charset_name.
Referenced by charset_for_string_type(), gdbscm_arch_wide_charset(), printf_wide_c_string(), and ui_printf().
|
static |
Definition at line 339 of file charset.c.
References be_le_arch, gdbarch_auto_wide_charset(), host_charset(), iconv_close, iconv_open, iconv_t, target_charset(), and target_wide_charset_name.
Referenced by set_charset_sfunc(), set_host_charset_sfunc(), set_target_charset_sfunc(), and set_target_wide_charset_sfunc().
|
static |
Definition at line 227 of file charset.c.
Referenced by host_charset(), and show_host_charset_name().
|
static |
Definition at line 917 of file charset.c.
Referenced by default_auto_charset().
|
static |
Definition at line 289 of file charset.c.
Referenced by set_be_le_names(), and validate().
|
static |
Definition at line 280 of file charset.c.
Referenced by set_be_le_names().
|
static |
Definition at line 717 of file charset.c.
Referenced by find_charset_names().
|
static |
|
static |
Definition at line 228 of file charset.c.
Referenced by host_charset(), set_charset_sfunc(), and show_charset().
|
static |
Definition at line 242 of file charset.c.
Referenced by set_charset_sfunc(), show_charset(), and target_charset().
|
static |
Definition at line 285 of file charset.c.
Referenced by set_be_le_names(), and target_wide_charset().
|
static |
Definition at line 286 of file charset.c.
Referenced by set_be_le_names(), and target_wide_charset().
|
static |
Definition at line 257 of file charset.c.
Referenced by set_be_le_names(), show_charset(), target_wide_charset(), and validate().