60 if (msym.minsym != NULL)
94 && strcmp (
TYPE_NAME (target_type),
"uint8") == 0)
140 const char **packagep,
const char **objectp)
144 last_dot = strrchr (buf,
'.');
146 *objectp = last_dot + 1;
148 last_dot = strrchr (buf,
'.');
149 if (last_dot != NULL)
150 *packagep = last_dot + 1;
184 const char **packagep,
185 const char **objectp,
186 const char **method_type_packagep,
187 const char **method_type_objectp,
188 int *method_type_is_pointerp)
192 int len = strlen (mangled_name);
198 const char *first_dot;
200 const char *last_dot;
204 *packagep = *objectp = NULL;
205 *method_type_packagep = *method_type_objectp = NULL;
206 *method_type_is_pointerp = 0;
209 if (strcmp (mangled_name,
"__go_init_main") == 0)
211 char *
package = xstrdup ("main");
219 if (strcmp (mangled_name,
"main.main") == 0)
221 char *
package = xstrdup ("main");
242 if (strchr (mangled_name,
'@') != NULL)
245 first_dot = strchr (mangled_name,
'.');
246 if (first_dot == NULL)
252 last_dot = strrchr (mangled_name,
'.');
253 if (last_dot == first_dot)
257 if (last_dot[1] ==
'\0' 258 || last_dot[-1] ==
'.')
263 buf = xstrdup (mangled_name);
267 saw_digit = method_type = NULL;
271 int current = *(
const unsigned char *) --p;
272 int current_is_digit = isdigit (current);
276 if (current_is_digit)
279 && ((p > buf && p[-1] ==
'.')
280 || (p > buf + 1 && p[-1] ==
'p' && p[-2] ==
'.')))
282 if (atoi (p + 1) == strlen (saw_digit + 2))
300 if (current_is_digit && p[1] ==
'_')
308 if (method_type != NULL
310 && (method_type > buf && method_type[-1] !=
'.'))
313 method_type_packagep, method_type_objectp);
315 *method_type_is_pointerp = saw_pointer;
341 const char *package_name;
342 const char *object_name;
343 const char *method_type_package_name;
344 const char *method_type_object_name;
345 int method_type_is_pointer;
347 if (mangled_name == NULL)
351 &package_name, &object_name,
352 &method_type_package_name,
353 &method_type_object_name,
354 &method_type_is_pointer);
355 if (name_buf == NULL)
361 if (method_type_package_name != NULL)
364 if (method_type_is_pointer)
369 if (method_type_is_pointer)
382 result = xstrdup ((
const char *) obstack_finish (&
tempbuf));
394 return *demangled != NULL;
404 const char *package_name;
405 const char *object_name;
406 const char *method_type_package_name;
407 const char *method_type_object_name;
408 int method_type_is_pointer;
414 &package_name, &object_name,
415 &method_type_package_name,
416 &method_type_object_name,
417 &method_type_is_pointer);
419 if (name_buf == NULL)
421 result = xstrdup (package_name);
432 while (
block != NULL)
436 if (
function != NULL)
440 if (package_name != NULL)
struct type * builtin_uint16
void go_print_type(struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
char * go_block_package_name(const struct block *block)
struct type * arch_type(struct gdbarch *gdbarch, enum type_code code, int bit, const char *name)
static void go_language_arch_info(struct gdbarch *gdbarch, struct language_arch_info *lai)
#define TYPE_FIELD_NAME(thistype, n)
unsigned int default_search_name_hash(const char *string0)
struct type * builtin_uint32
const char * go_main_name(void)
const struct floatformat * floatformats_ieee_double[BFD_ENDIAN_UNKNOWN]
#define GDBARCH_OBSTACK_CALLOC(GDBARCH, NR, TYPE)
struct type * builtin_int16
int gdbarch_int_bit(struct gdbarch *gdbarch)
const char * default_word_break_characters(void)
struct type * builtin_complex128
#define TYPE_NAME(thistype)
int gdbarch_ptr_bit(struct gdbarch *gdbarch)
void * gdbarch_data(struct gdbarch *gdbarch, struct gdbarch_data *data)
struct type * arch_character_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
struct type * builtin_int
struct value * default_read_var_value(struct symbol *var, const struct block *var_block, struct frame_info *frame)
struct type * builtin_int8
static void unpack_package_and_object(char *buf, const char **packagep, const char **objectp)
static int gccgo_string_p(struct type *type)
struct type * string_char_type
char * go_symbol_package_name(const struct symbol *sym)
struct type * arch_boolean_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
#define TYPE_FIELD_TYPE(thistype, n)
struct type * arch_complex_type(struct gdbarch *gdbarch, const char *name, struct type *target_type)
void c_get_string(struct value *value, gdb_byte **buffer, int *length, struct type **char_type, const char **charset)
#define GDBARCH_OBSTACK_ZALLOC(GDBARCH, TYPE)
struct type * arch_integer_type(struct gdbarch *gdbarch, int bit, int unsigned_p, const char *name)
struct type * builtin_int32
#define BLOCK_FUNCTION(bl)
struct type * builtin_char
void go_yyerror(const char *)
struct type * check_typedef(struct type *type)
const struct exp_descriptor exp_descriptor_c
struct block_symbol basic_lookup_symbol_nonlocal(const struct language_defn *langdef, const char *name, const struct block *block, const domain_enum domain)
struct type * bool_type_default
const struct language_defn go_language_defn
struct type * builtin_uint8
struct type * builtin_int64
void c_emit_char(int c, struct type *type, struct ui_file *stream, int quoter)
static struct obstack tempbuf
struct type * arch_float_type(struct gdbarch *gdbarch, int bit, const char *name, const struct floatformat **floatformats)
struct type * builtin_uintptr
const char * bool_type_symbol
int default_pass_by_reference(struct type *type)
const struct builtin_go_type * builtin_go_type(struct gdbarch *gdbarch)
struct type * basic_lookup_transparent_type(const char *name)
static int sixg_string_p(struct type *type)
#define BLOCK_SUPERBLOCK(bl)
void _initialize_go_language(void)
void null_post_parser(expression_up *exp, int void_context_p)
#define SYMBOL_LINKAGE_NAME(symbol)
static int startswith(const char *string, const char *pattern)
int go_parse(struct parser_state *par_state)
struct type * builtin_void
void default_print_array_index(struct value *index_value, struct ui_file *stream, const struct value_print_options *options)
enum go_type go_classify_struct_type(struct type *type)
void c_print_typedef(struct type *, struct symbol *, struct ui_file *)
struct type * builtin_uint64
struct type * builtin_float64
struct type * builtin_complex64
void c_printstr(struct ui_file *stream, struct type *type, const gdb_byte *string, unsigned int length, const char *user_encoding, int force_ellipses, const struct value_print_options *options)
const struct floatformat * floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]
void default_collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word, enum type_code code)
static char * unpack_mangled_go_symbol(const char *mangled_name, const char **packagep, const char **objectp, const char **method_type_packagep, const char **method_type_objectp, int *method_type_is_pointerp)
gdb::unique_xmalloc_ptr< char > c_watch_location_expression(struct type *type, CORE_ADDR addr)
#define TYPE_TARGET_TYPE(thistype)
#define TYPE_CODE(thistype)
#define default_varobj_ops
static int go_sniff_from_mangled_name(const char *mangled, char **demangled)
#define TYPE_NFIELDS(thistype)
#define SYMBOL_LANGUAGE(symbol)
#define obstack_grow_str(OBSTACK, STRING)
void go_val_print(struct type *type, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, struct value *val, const struct value_print_options *options)
#define TYPE_TAG_NAME(type)
static const char GO_MAIN_MAIN[]
#define obstack_grow_str0(OBSTACK, STRING)
void c_printchar(int c, struct type *type, struct ui_file *stream)
struct type * builtin_bool
#define TYPE_LENGTH(thistype)
void iterate_over_symbols(const struct block *block, const lookup_name_info &name, const domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
struct type ** primitive_type_vector
struct bound_minimal_symbol lookup_minimal_symbol(const char *name, const char *sfile, struct objfile *objf)
struct type * builtin_float32
void c_value_print(struct value *, struct ui_file *, const struct value_print_options *)
static void * build_go_types(struct gdbarch *gdbarch)
struct type * builtin_uint
static const struct op_print go_op_print_tab[]
struct gdbarch_data * gdbarch_data_register_post_init(gdbarch_data_post_init_ftype *post_init)
char * go_demangle(const char *mangled_name, int options)
static struct gdbarch_data * go_type_data