GDB (xrefs)
|
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "c-lang.h"
#include "objc-lang.h"
#include "exceptions.h"
#include "complaints.h"
#include "value.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb_string.h"
#include "target.h"
#include "gdbcore.h"
#include "gdbcmd.h"
#include "frame.h"
#include "gdb_regex.h"
#include "regcache.h"
#include "block.h"
#include "infcall.h"
#include "valprint.h"
#include "gdb_assert.h"
#include "cli/cli-utils.h"
#include <ctype.h>
Go to the source code of this file.
#define nmethcalls (sizeof (methcalls) / sizeof (methcalls[0])) |
Definition at line 1239 of file objc-lang.c.
Referenced by find_objc_msgcall(), and find_objc_msgsend().
void _initialize_objc_lang | ( | void | ) |
Definition at line 1608 of file objc-lang.c.
References objc_objfile_data.
void _initialize_objc_language | ( | void | ) |
Definition at line 1359 of file objc-lang.c.
References _, add_com(), add_com_alias(), add_info(), add_language(), class_vars, classes_info(), print_object_command(), and selectors_info().
void add_msglist | ( | struct stoken * | str, |
int | addcolon | ||
) |
Definition at line 427 of file objc-lang.c.
References len, stoken::length, msglist_len, msglist_sel, p, stoken::ptr, xfree(), and xmalloc().
static void classes_info | ( | char * | regexp, |
int | from_tty | ||
) | [static] |
Definition at line 706 of file objc-lang.c.
References _, ALL_MSYMBOLS, begin_line(), compare_classes(), error(), name, p, printf_filtered(), puts_filtered_tabular(), qsort, QUIT, re_comp(), specialcmp(), strchr(), and SYMBOL_NATURAL_NAME.
Referenced by _initialize_objc_language().
static int compare_classes | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 683 of file objc-lang.c.
References _, error(), specialcmp(), and SYMBOL_PRINT_NAME.
Referenced by classes_info().
static int compare_selectors | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 517 of file objc-lang.c.
References _, error(), specialcmp(), strchr(), and SYMBOL_PRINT_NAME.
Referenced by selectors_info().
int end_msglist | ( | void | ) |
Definition at line 465 of file objc-lang.c.
References _, error(), lookup_child_selector(), selname::msglist_len, msglist_len, selname::msglist_sel, msglist_sel, selname::next, p, parse_gdbarch, selname_chain, write_exp_elt_longcst(), and xfree().
static CORE_ADDR find_implementation | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | object, | ||
CORE_ADDR | sel | ||
) | [static] |
Definition at line 1490 of file objc-lang.c.
References find_implementation_from_class(), objc_object::isa, and read_objc_object().
Referenced by resolve_msgsend(), and resolve_msgsend_stret().
static CORE_ADDR find_implementation_from_class | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | class, | ||
CORE_ADDR | sel | ||
) | [static] |
Definition at line 1437 of file objc-lang.c.
References gdbarch_byte_order(), objc_method::imp, objc_class::methods, objc_method::name, read_memory_unsigned_integer(), read_objc_class(), read_objc_methlist_method(), read_objc_methlist_nmethods(), and objc_class::super_class.
Referenced by find_implementation(), resolve_msgsend_super(), and resolve_msgsend_super_stret().
const char* find_imps | ( | const char * | method, |
VEC(const_char_ptr)** | symbol_names | ||
) |
Definition at line 1105 of file objc-lang.c.
References find_methods(), gdb_assert, lookup_minimal_symbol(), lookup_symbol(), parse_method(), parse_selector(), SYMBOL_NATURAL_NAME, uniquify_strings(), VAR_DOMAIN, VEC_empty, and VEC_safe_push.
Referenced by decode_objc(), and find_function_symbols().
static void find_methods | ( | char | type, |
const char * | class, | ||
const char * | category, | ||
const char * | selector, | ||
VEC(const_char_ptr)** | symbol_names | ||
) | [static] |
Definition at line 953 of file objc-lang.c.
References ALL_OBJFILE_MSYMBOLS, ALL_OBJFILES, gdb_assert, objc_objfile_data, objfile::objfile_obstack, parse_method(), QUIT, SYMBOL_NATURAL_NAME, VEC_safe_push, and xrealloc().
Referenced by find_imps().
int find_objc_msgcall | ( | CORE_ADDR | pc, |
CORE_ADDR * | new_pc | ||
) |
Definition at line 1332 of file objc-lang.c.
References find_objc_msgcall_submethod(), find_objc_msgsend(), and nmethcalls.
Referenced by objc_skip_trampoline().
static int find_objc_msgcall_submethod | ( | int(*)(CORE_ADDR, CORE_ADDR *) | f, |
CORE_ADDR | pc, | ||
CORE_ADDR * | new_pc | ||
) | [static] |
Definition at line 1311 of file objc-lang.c.
References catch_errors(), objc_submethod_helper_data::f, find_objc_msgcall_submethod_helper(), objc_submethod_helper_data::new_pc, objc_submethod_helper_data::pc, and RETURN_MASK_ALL.
Referenced by find_objc_msgcall().
static int find_objc_msgcall_submethod_helper | ( | void * | arg | ) | [static] |
Definition at line 1299 of file objc-lang.c.
References objc_submethod_helper_data::f, objc_submethod_helper_data::new_pc, and objc_submethod_helper_data::pc.
Referenced by find_objc_msgcall_submethod().
static void find_objc_msgsend | ( | void | ) | [static] |
Definition at line 1249 of file objc-lang.c.
References objc_methcall::begin, objc_methcall::end, func, lookup_minimal_symbol(), name, nmethcalls, and SYMBOL_VALUE_ADDRESS.
Referenced by find_objc_msgcall().
CORE_ADDR lookup_child_selector | ( | struct gdbarch * | gdbarch, |
char * | selname | ||
) |
Definition at line 140 of file objc-lang.c.
References _, builtin_type::builtin_char, builtin_type(), call_function_by_hand(), complaint(), find_function_in_inferior(), lookup_minimal_symbol(), symfile_complaints, target_has_execution, value_as_long(), value_coerce_array(), and value_string().
Referenced by end_msglist(), evaluate_subexp_standard(), and value_nsstring().
CORE_ADDR lookup_objc_class | ( | struct gdbarch * | gdbarch, |
char * | classname | ||
) |
Definition at line 111 of file objc-lang.c.
References _, builtin_type::builtin_char, builtin_type(), call_function_by_hand(), complaint(), find_function_in_inferior(), lookup_minimal_symbol(), symfile_complaints, target_has_execution, value_as_long(), value_coerce_array(), and value_string().
Referenced by value_nsstring().
struct symbol* lookup_struct_typedef | ( | char * | name, |
const struct block * | block, | ||
int | noerr | ||
) | [read] |
Definition at line 86 of file objc-lang.c.
References _, error(), lookup_symbol(), STRUCT_DOMAIN, SYMBOL_TYPE, TYPE_CODE, and TYPE_CODE_STRUCT.
Referenced by value_nsstring().
char* objc_demangle | ( | const char * | mangled, |
int | options | ||
) |
Definition at line 223 of file objc-lang.c.
References strchr(), xfree(), and xmalloc().
Referenced by symbol_find_demangled_name().
static CORE_ADDR objc_skip_trampoline | ( | struct frame_info * | frame, |
CORE_ADDR | stop_pc | ||
) | [static] |
Definition at line 293 of file objc-lang.c.
References find_objc_msgcall(), gdbarch_skip_trampoline_code(), and get_frame_arch().
static char* parse_method | ( | char * | method, |
char * | type, | ||
char ** | class, | ||
char ** | category, | ||
char ** | selector | ||
) | [static] |
Definition at line 857 of file objc-lang.c.
References gdb_assert, and skip_spaces().
Referenced by find_imps(), and find_methods().
static char* parse_selector | ( | char * | method, |
char ** | selector | ||
) | [static] |
Definition at line 805 of file objc-lang.c.
References gdb_assert, and skip_spaces().
Referenced by find_imps().
static void print_object_command | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1161 of file objc-lang.c.
References _, builtin_type::builtin_data_ptr, call_function_by_hand(), do_cleanups(), error(), EVAL_NORMAL, evaluate_subexp(), find_function_in_inferior(), free_current_contents(), expression::gdbarch, make_cleanup(), parse_expression(), printf_filtered(), QUIT, read_memory(), and value_as_long().
Referenced by _initialize_objc_language().
static void read_objc_class | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr, | ||
struct objc_class * | class | ||
) | [static] |
Definition at line 1418 of file objc-lang.c.
References gdbarch_byte_order(), and read_memory_unsigned_integer().
Referenced by find_implementation_from_class().
static void read_objc_methlist_method | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr, | ||
unsigned long | num, | ||
struct objc_method * | method | ||
) | [static] |
Definition at line 1391 of file objc-lang.c.
References gdb_assert, read_objc_methlist_nmethods(), and read_objc_method().
Referenced by find_implementation_from_class().
static unsigned long read_objc_methlist_nmethods | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr | ||
) | [static] |
Definition at line 1383 of file objc-lang.c.
References gdbarch_byte_order(), and read_memory_unsigned_integer().
Referenced by find_implementation_from_class(), and read_objc_methlist_method().
static void read_objc_method | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr, | ||
struct objc_method * | method | ||
) | [static] |
Definition at line 1372 of file objc-lang.c.
References gdbarch_byte_order(), objc_method::imp, objc_method::name, read_memory_unsigned_integer(), and objc_method::types.
Referenced by read_objc_methlist_method().
static void read_objc_object | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr, | ||
struct objc_object * | object | ||
) | [static] |
Definition at line 1399 of file objc-lang.c.
References gdbarch_byte_order(), and read_memory_unsigned_integer().
Referenced by find_implementation().
static void read_objc_super | ( | struct gdbarch * | gdbarch, |
CORE_ADDR | addr, | ||
struct objc_super * | super | ||
) | [static] |
Definition at line 1408 of file objc-lang.c.
References objc_super::class, gdbarch_byte_order(), read_memory_unsigned_integer(), and objc_super::receiver.
Referenced by resolve_msgsend_super(), and resolve_msgsend_super_stret().
static int resolve_msgsend | ( | CORE_ADDR | pc, |
CORE_ADDR * | new_pc | ||
) | [static] |
Definition at line 1505 of file objc-lang.c.
References builtin_type::builtin_func_ptr, builtin_type(), find_implementation(), gdbarch_fetch_pointer_argument(), get_current_frame(), and get_frame_arch().
static int resolve_msgsend_stret | ( | CORE_ADDR | pc, |
CORE_ADDR * | new_pc | ||
) | [static] |
Definition at line 1527 of file objc-lang.c.
References builtin_type::builtin_func_ptr, builtin_type(), find_implementation(), gdbarch_fetch_pointer_argument(), get_current_frame(), and get_frame_arch().
static int resolve_msgsend_super | ( | CORE_ADDR | pc, |
CORE_ADDR * | new_pc | ||
) | [static] |
Definition at line 1549 of file objc-lang.c.
References builtin_type::builtin_func_ptr, builtin_type(), objc_super::class, find_implementation_from_class(), gdbarch_fetch_pointer_argument(), get_current_frame(), get_frame_arch(), and read_objc_super().
static int resolve_msgsend_super_stret | ( | CORE_ADDR | pc, |
CORE_ADDR * | new_pc | ||
) | [static] |
Definition at line 1577 of file objc-lang.c.
References builtin_type::builtin_func_ptr, builtin_type(), objc_super::class, find_implementation_from_class(), gdbarch_fetch_pointer_argument(), get_current_frame(), get_frame_arch(), and read_objc_super().
static void selectors_info | ( | char * | regexp, |
int | from_tty | ||
) | [static] |
Definition at line 544 of file objc-lang.c.
References _, ALL_MSYMBOLS, begin_line(), compare_selectors(), complaint(), error(), name, p, printf_filtered(), puts_filtered_tabular(), qsort, QUIT, re_comp(), specialcmp(), strchr(), SYMBOL_NATURAL_NAME, and symfile_complaints.
Referenced by _initialize_objc_language().
static int specialcmp | ( | const char * | a, |
const char * | b | ||
) | [static] |
Definition at line 494 of file objc-lang.c.
Referenced by classes_info(), compare_classes(), compare_selectors(), and selectors_info().
void start_msglist | ( | void | ) |
Definition at line 412 of file objc-lang.c.
References selname::msglist_len, msglist_len, msglist_sel, selname_chain, and xmalloc().
static void uniquify_strings | ( | VEC(const_char_ptr)** | strings | ) | [static] |
Definition at line 1050 of file objc-lang.c.
References compare_strings(), qsort, VEC_address, VEC_iterate, VEC_length, VEC_replace, and VEC_truncate.
Referenced by find_imps().
struct value* value_nsstring | ( | struct gdbarch * | gdbarch, |
char * | ptr, | ||
int | len | ||
) | [read] |
Definition at line 169 of file objc-lang.c.
References _, builtin_type::builtin_char, builtin_type::builtin_data_ptr, builtin_type::builtin_long, builtin_type(), call_function_by_hand(), deprecated_set_value_type(), error(), find_function_in_inferior(), lookup_child_selector(), lookup_minimal_symbol(), lookup_objc_class(), lookup_pointer_type(), lookup_struct_typedef(), SYMBOL_TYPE, target_has_execution, type, value_coerce_array(), value_from_longest(), and value_string().
Referenced by evaluate_subexp_standard().
Referenced by initialize_all_files().
Referenced by initialize_all_files().
struct objc_methcall methcalls[] [static] |
{ { "_objc_msgSend", resolve_msgsend, 0, 0}, { "_objc_msgSend_stret", resolve_msgsend_stret, 0, 0}, { "_objc_msgSendSuper", resolve_msgsend_super, 0, 0}, { "_objc_msgSendSuper_stret", resolve_msgsend_super_stret, 0, 0}, { "_objc_getClass", NULL, 0, 0}, { "_objc_getMetaClass", NULL, 0, 0} }
Definition at line 1230 of file objc-lang.c.
int msglist_len [static] |
Definition at line 407 of file objc-lang.c.
Referenced by add_msglist(), end_msglist(), and start_msglist().
char* msglist_sel [static] |
Definition at line 409 of file objc-lang.c.
Referenced by add_msglist(), end_msglist(), and start_msglist().
struct language_defn objc_language_defn |
Definition at line 355 of file objc-lang.c.
struct objfile_data* objc_objfile_data [static] |
Definition at line 79 of file objc-lang.c.
Referenced by _initialize_objc_lang(), and find_methods().
struct op_print objc_op_print_tab[] [static] |
Definition at line 321 of file objc-lang.c.
struct selname* selname_chain [static] |
Definition at line 408 of file objc-lang.c.
Referenced by end_msglist(), and start_msglist().