GDB (xrefs)
|
#include "defs.h"
#include "charset.h"
#include "gdbcmd.h"
#include "gdb_assert.h"
#include "gdb_obstack.h"
#include "gdb_wait.h"
#include "charset-list.h"
#include "vec.h"
#include "environ.h"
#include "arch-utils.h"
#include "gdb_vecs.h"
#include <stddef.h>
#include "gdb_string.h"
#include <ctype.h>
Go to the source code of this file.
#define EILSEQ ENOENT |
Definition at line 108 of file charset.c.
Referenced by convert_between_encodings(), phony_iconv(), and wchar_iterate().
#define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" |
Definition at line 84 of file charset.c.
Referenced by phony_iconv_open(), and VEC().
#define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1" |
#define GDB_DEFAULT_TARGET_WIDE_CHARSET "ISO-8859-1" |
Definition at line 86 of file charset.c.
Referenced by default_auto_wide_charset().
#define iconv phony_iconv |
Definition at line 95 of file charset.c.
Referenced by convert_between_encodings(), and wchar_iterate().
#define iconv_close phony_iconv_close |
Definition at line 97 of file charset.c.
Referenced by cleanup_iconv(), do_cleanup_iterator(), and validate().
#define ICONV_CONST const |
Definition at line 100 of file charset.c.
Referenced by convert_between_encodings(), and wchar_iterate().
#define iconv_open phony_iconv_open |
Definition at line 93 of file charset.c.
Referenced by convert_between_encodings(), make_wchar_iterator(), and validate().
Definition at line 91 of file charset.c.
Referenced by cleanup_iconv(), convert_between_encodings(), make_wchar_iterator(), and validate().
void _initialize_charset | ( | void | ) |
Definition at line 1004 of file charset.c.
References _, _initialize_charset, add_setshow_enum_cmd(), auto_host_charset_name, charset_enum, class_support, CODESET, default_charset_names, host_charset_name, nl_langinfo(), set_charset_sfunc(), set_host_charset_sfunc(), set_target_charset_sfunc(), set_target_wide_charset_sfunc(), setlist, show_charset(), show_host_charset_name(), show_target_charset_name(), show_target_wide_charset_name(), showlist, target_charset_name, target_wide_charset_name, VEC_address, VEC_length, and VEC_safe_push.
static void cleanup_iconv | ( | void * | p | ) | [static] |
Definition at line 462 of file charset.c.
References iconv_close, and iconv_t.
Referenced by convert_between_encodings().
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 469 of file charset.c.
References _, cleanup_iconv(), do_cleanups(), EILSEQ, error(), iconv, ICONV_CONST, iconv_open, iconv_t, make_cleanup(), obstack_grow_str, perror_with_name(), translit_none, and xsnprintf().
Referenced by convert_ucn(), generic_emit_char(), generic_printstr(), host_char_to_target(), parse_one_string(), printf_wide_c_string(), and ui_printf().
const char* default_auto_charset | ( | void | ) |
Definition at line 927 of file charset.c.
References auto_target_charset_name.
Referenced by gdbarch_alloc().
const char* default_auto_wide_charset | ( | void | ) |
Definition at line 933 of file charset.c.
References GDB_DEFAULT_TARGET_WIDE_CHARSET.
Referenced by gdbarch_alloc().
static void do_cleanup_iterator | ( | void * | p | ) | [static] |
Definition at line 611 of file charset.c.
References wchar_iterator::desc, iconv_close, wchar_iterator::out, and xfree().
Referenced by make_cleanup_wchar_iterator().
const char* host_charset | ( | void | ) |
Definition at line 392 of file charset.c.
References auto_host_charset_name, and host_charset_name.
Referenced by bppy_get_commands(), bppy_get_condition(), bppy_get_expression(), bppy_get_location(), cmdpy_function(), frapy_name(), gdbpy_frame_stop_reason_string(), generic_emit_char(), generic_printstr(), host_char_to_target(), objfpy_get_filename(), parse_one_string(), printf_wide_c_string(), pspy_get_filename(), python_string_to_host_string(), python_string_to_unicode(), stpy_fullname(), stpy_get_filename(), typy_str(), ui_printf(), validate(), and VEC().
int host_hex_value | ( | char | c | ) |
Definition at line 446 of file charset.c.
References gdb_assert.
Referenced by convert_hex(), convert_octal(), convert_ucn(), mi_parse_escape(), and parse_escape().
char host_letter_to_control_character | ( | char | c | ) |
struct cleanup* make_cleanup_wchar_iterator | ( | struct wchar_iterator * | iter | ) | [read] |
Definition at line 621 of file charset.c.
References do_cleanup_iterator(), and make_cleanup().
Referenced by generic_emit_char(), and generic_printstr().
struct wchar_iterator* make_wchar_iterator | ( | const gdb_byte * | input, |
size_t | bytes, | ||
const char * | charset, | ||
size_t | width | ||
) | [read] |
Definition at line 588 of file charset.c.
References _, wchar_iterator::bytes, wchar_iterator::desc, iconv_open, iconv_t, wchar_iterator::input, INTERMEDIATE_ENCODING, wchar_iterator::out, wchar_iterator::out_size, perror_with_name(), and wchar_iterator::width.
Referenced by generic_emit_char(), and generic_printstr().
static size_t phony_iconv | ( | iconv_t | utf_flag, |
const char ** | inbuf, | ||
size_t * | inbytesleft, | ||
char ** | outbuf, | ||
size_t * | outbytesleft | ||
) | [static] |
static int phony_iconv_close | ( | iconv_t | arg | ) | [static] |
static iconv_t phony_iconv_open | ( | const char * | to, |
const char * | from | ||
) | [static] |
Definition at line 112 of file charset.c.
References GDB_DEFAULT_HOST_CHARSET.
static void set_be_le_names | ( | struct gdbarch * | gdbarch | ) | [static] |
Definition at line 277 of file charset.c.
References charset_enum, gdbarch_auto_wide_charset(), len, target_wide_charset_be_name, target_wide_charset_le_name, and target_wide_charset_name.
Referenced by target_wide_charset().
static void set_charset_sfunc | ( | char * | charset, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 343 of file charset.c.
References get_current_arch(), host_charset_name, target_charset_name, and validate().
Referenced by _initialize_charset().
static void set_host_charset_sfunc | ( | char * | charset, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 354 of file charset.c.
References get_current_arch(), and validate().
Referenced by _initialize_charset().
static void set_target_charset_sfunc | ( | char * | charset, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 362 of file charset.c.
References get_current_arch(), and validate().
Referenced by _initialize_charset().
static void set_target_wide_charset_sfunc | ( | char * | charset, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 370 of file charset.c.
References get_current_arch(), and validate().
Referenced by _initialize_charset().
static void show_charset | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | name | ||
) | [static] |
Definition at line 378 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.
Referenced by _initialize_charset().
static void show_host_charset_name | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 212 of file charset.c.
References _, auto_host_charset_name, and fprintf_filtered().
Referenced by _initialize_charset(), and show_charset().
static void show_target_charset_name | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 226 of file charset.c.
References _, fprintf_filtered(), gdbarch_auto_charset(), and get_current_arch().
Referenced by _initialize_charset(), and show_charset().
static void show_target_wide_charset_name | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 241 of file charset.c.
References _, fprintf_filtered(), gdbarch_auto_wide_charset(), and get_current_arch().
Referenced by _initialize_charset(), and show_charset().
const char* target_charset | ( | struct gdbarch * | gdbarch | ) |
Definition at line 400 of file charset.c.
References gdbarch_auto_charset(), and target_charset_name.
Referenced by charset_for_string_type(), f_get_encoding(), host_char_to_target(), java_get_encoding(), parse_escape(), unicode_to_target_python_string(), unicode_to_target_string(), and validate().
const char* target_wide_charset | ( | struct gdbarch * | gdbarch | ) |
Definition at line 408 of file charset.c.
References gdbarch::byte_order, 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(), printf_wide_c_string(), and ui_printf().
Definition at line 315 of file charset.c.
References _, error(), 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().
Definition at line 722 of file charset.c.
References GDB_DEFAULT_HOST_CHARSET, and VEC_safe_push.
int wchar_iterate | ( | struct wchar_iterator * | iter, |
enum wchar_iterate_result * | out_result, | ||
gdb_wchar_t ** | out_chars, | ||
const gdb_byte ** | ptr, | ||
size_t * | len | ||
) |
Definition at line 627 of file charset.c.
References _, wchar_iterator::bytes, wchar_iterator::desc, EILSEQ, iconv, ICONV_CONST, wchar_iterator::input, wchar_iterator::out, wchar_iterator::out_size, perror_with_name(), wchar_iterate_eof, wchar_iterate_incomplete, wchar_iterate_invalid, wchar_iterate_ok, wchar_iterator::width, and xrealloc().
Referenced by count_next_character(), and generic_emit_char().
Referenced by _initialize_charset(), and initialize_all_files().
const char* auto_host_charset_name = GDB_DEFAULT_HOST_CHARSET [static] |
Definition at line 209 of file charset.c.
Referenced by _initialize_charset(), host_charset(), and show_host_charset_name().
const char* auto_target_charset_name = GDB_DEFAULT_TARGET_CHARSET [static] |
Definition at line 924 of file charset.c.
Referenced by default_auto_charset().
struct gdbarch* be_le_arch [static] |
const char** charset_enum [static] |
Definition at line 262 of file charset.c.
Referenced by _initialize_charset(), and set_be_le_names().
const char* default_charset_names[] [static] |
{ DEFAULT_CHARSET_NAMES 0 }
Definition at line 256 of file charset.c.
Referenced by _initialize_charset().
const char* host_charset_name = "auto" [static] |
Definition at line 210 of file charset.c.
Referenced by _initialize_charset(), host_charset(), set_charset_sfunc(), and show_charset().
const char* target_charset_name = "auto" [static] |
Definition at line 224 of file charset.c.
Referenced by _initialize_charset(), set_charset_sfunc(), show_charset(), and target_charset().
const char* target_wide_charset_be_name [static] |
Definition at line 267 of file charset.c.
Referenced by set_be_le_names(), and target_wide_charset().
const char* target_wide_charset_le_name [static] |
Definition at line 268 of file charset.c.
Referenced by set_be_le_names(), and target_wide_charset().
const char* target_wide_charset_name = "auto" [static] |
Definition at line 239 of file charset.c.
Referenced by _initialize_charset(), set_be_le_names(), show_charset(), target_wide_charset(), and validate().