GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-7.10/gdb/objc-lang.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "varobj.h"
#include "c-lang.h"
#include "objc-lang.h"
#include "complaints.h"
#include "value.h"
#include "symfile.h"
#include "objfiles.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 "cli/cli-utils.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  objc_object
 
struct  objc_class
 
struct  objc_super
 
struct  objc_method
 
struct  selname
 
struct  objc_methcall
 
struct  objc_submethod_helper_data
 

Macros

#define nmethcalls   (sizeof (methcalls) / sizeof (methcalls[0]))
 

Functions

struct symbollookup_struct_typedef (char *name, const struct block *block, int noerr)
 
CORE_ADDR lookup_objc_class (struct gdbarch *gdbarch, char *classname)
 
CORE_ADDR lookup_child_selector (struct gdbarch *gdbarch, char *selname)
 
struct valuevalue_nsstring (struct gdbarch *gdbarch, char *ptr, int len)
 
char * objc_demangle (const char *mangled, int options)
 
static CORE_ADDR objc_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc)
 
void start_msglist (void)
 
void add_msglist (struct stoken *str, int addcolon)
 
int end_msglist (struct parser_state *ps)
 
static int specialcmp (const char *a, const char *b)
 
static int compare_selectors (const void *a, const void *b)
 
static void selectors_info (char *regexp, int from_tty)
 
static int compare_classes (const void *a, const void *b)
 
static void classes_info (char *regexp, int from_tty)
 
static char * parse_selector (char *method, char **selector)
 
static char * parse_method (char *method, char *type, char **theclass, char **category, char **selector)
 
static void find_methods (char type, const char *theclass, const char *category, const char *selector, VEC(const_char_ptr)**symbol_names)
 
static void uniquify_strings (VEC(const_char_ptr)**strings)
 
const char * find_imps (const char *method, VEC(const_char_ptr)**symbol_names)
 
static void print_object_command (char *args, int from_tty)
 
static int resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc)
 
static int resolve_msgsend_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
 
static int resolve_msgsend_super (CORE_ADDR pc, CORE_ADDR *new_pc)
 
static int resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
 
static void find_objc_msgsend (void)
 
static int find_objc_msgcall_submethod_helper (void *arg)
 
static int find_objc_msgcall_submethod (int(*f)(CORE_ADDR, CORE_ADDR *), CORE_ADDR pc, CORE_ADDR *new_pc)
 
int find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc)
 
void _initialize_objc_language (void)
 
static void read_objc_method (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_method *method)
 
static unsigned long read_objc_methlist_nmethods (struct gdbarch *gdbarch, CORE_ADDR addr)
 
static void read_objc_methlist_method (struct gdbarch *gdbarch, CORE_ADDR addr, unsigned long num, struct objc_method *method)
 
static void read_objc_object (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_object *object)
 
static void read_objc_super (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_super *super)
 
static void read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_class *theclass)
 
static CORE_ADDR find_implementation_from_class (struct gdbarch *gdbarch, CORE_ADDR theclass, CORE_ADDR sel)
 
static CORE_ADDR find_implementation (struct gdbarch *gdbarch, CORE_ADDR object, CORE_ADDR sel)
 
void _initialize_objc_lang (void)
 

Variables

static const struct objfile_data * objc_objfile_data
 
static const struct op_print objc_op_print_tab []
 
const struct language_defn objc_language_defn
 
static int msglist_len
 
static struct selnameselname_chain
 
static char * msglist_sel
 
static struct objc_methcall methcalls []
 
initialize_file_ftype _initialize_objc_language
 
initialize_file_ftype _initialize_objc_lang
 

Macro Definition Documentation

#define nmethcalls   (sizeof (methcalls) / sizeof (methcalls[0]))

Definition at line 1247 of file objc-lang.c.

Referenced by find_objc_msgcall(), and find_objc_msgsend().

Function Documentation

void _initialize_objc_lang ( void  )

Definition at line 1609 of file objc-lang.c.

References objc_objfile_data.

void _initialize_objc_language ( void  )
void add_msglist ( struct stoken str,
int  addcolon 
)

Definition at line 429 of file objc-lang.c.

References len, stoken::length, msglist_len, msglist_sel, stoken::ptr, xfree(), and xmalloc().

Referenced by yyparse().

static void classes_info ( char *  regexp,
int  from_tty 
)
static
static int compare_classes ( const void *  a,
const void *  b 
)
static

Definition at line 685 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 519 of file objc-lang.c.

References _, error(), specialcmp(), and SYMBOL_PRINT_NAME.

Referenced by selectors_info().

int end_msglist ( struct parser_state ps)
static CORE_ADDR find_implementation ( struct gdbarch gdbarch,
CORE_ADDR  object,
CORE_ADDR  sel 
)
static
static CORE_ADDR find_implementation_from_class ( struct gdbarch gdbarch,
CORE_ADDR  theclass,
CORE_ADDR  sel 
)
static
const char* find_imps ( const char *  method,
VEC(const_char_ptr)**  symbol_names 
)
static void find_methods ( char  type,
const char *  theclass,
const char *  category,
const char *  selector,
VEC(const_char_ptr)**  symbol_names 
)
static
int find_objc_msgcall ( CORE_ADDR  pc,
CORE_ADDR new_pc 
)

Definition at line 1338 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
static int find_objc_msgcall_submethod_helper ( void *  arg)
static
static void find_objc_msgsend ( void  )
static
CORE_ADDR lookup_child_selector ( struct gdbarch gdbarch,
char *  selname 
)
CORE_ADDR lookup_objc_class ( struct gdbarch gdbarch,
char *  classname 
)
struct symbol* lookup_struct_typedef ( char *  name,
const struct block block,
int  noerr 
)

Definition at line 84 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 221 of file objc-lang.c.

References xfree(), and xmalloc().

Referenced by symbol_find_demangled_name().

static CORE_ADDR objc_skip_trampoline ( struct frame_info frame,
CORE_ADDR  stop_pc 
)
static
static char* parse_method ( char *  method,
char *  type,
char **  theclass,
char **  category,
char **  selector 
)
static

Definition at line 859 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 807 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
static void read_objc_class ( struct gdbarch gdbarch,
CORE_ADDR  addr,
struct objc_class theclass 
)
static
static void read_objc_methlist_method ( struct gdbarch gdbarch,
CORE_ADDR  addr,
unsigned long  num,
struct objc_method method 
)
static
static unsigned long read_objc_methlist_nmethods ( struct gdbarch gdbarch,
CORE_ADDR  addr 
)
static
static void read_objc_method ( struct gdbarch gdbarch,
CORE_ADDR  addr,
struct objc_method method 
)
static
static void read_objc_object ( struct gdbarch gdbarch,
CORE_ADDR  addr,
struct objc_object object 
)
static

Definition at line 1405 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
static int resolve_msgsend ( CORE_ADDR  pc,
CORE_ADDR new_pc 
)
static
static int resolve_msgsend_stret ( CORE_ADDR  pc,
CORE_ADDR new_pc 
)
static
static int resolve_msgsend_super ( CORE_ADDR  pc,
CORE_ADDR new_pc 
)
static
static int resolve_msgsend_super_stret ( CORE_ADDR  pc,
CORE_ADDR new_pc 
)
static
static void selectors_info ( char *  regexp,
int  from_tty 
)
static
static int specialcmp ( const char *  a,
const char *  b 
)
static

Definition at line 496 of file objc-lang.c.

Referenced by classes_info(), compare_classes(), compare_selectors(), and selectors_info().

void start_msglist ( void  )
static void uniquify_strings ( VEC(const_char_ptr)**  strings)
static

Definition at line 1052 of file objc-lang.c.

References compare_strings(), qsort, VEC_address, VEC_empty, VEC_iterate, VEC_length, VEC_replace, and VEC_truncate.

Referenced by find_imps().

struct value* value_nsstring ( struct gdbarch gdbarch,
char *  ptr,
int  len 
)

Variable Documentation

initialize_file_ftype _initialize_objc_lang
initialize_file_ftype _initialize_objc_language
struct objc_methcall methcalls[]
static
Initial value:
= {
{ "_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}
}
static int resolve_msgsend_super_stret(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition: objc-lang.c:1578
static int resolve_msgsend_stret(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition: objc-lang.c:1528
static int resolve_msgsend_super(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition: objc-lang.c:1550
static int resolve_msgsend(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition: objc-lang.c:1506

Definition at line 1238 of file objc-lang.c.

int msglist_len
static

Definition at line 409 of file objc-lang.c.

Referenced by add_msglist(), end_msglist(), and start_msglist().

char* msglist_sel
static

Definition at line 411 of file objc-lang.c.

Referenced by add_msglist(), end_msglist(), and start_msglist().

const struct language_defn objc_language_defn

Definition at line 353 of file objc-lang.c.

const struct objfile_data* objc_objfile_data
static

Definition at line 77 of file objc-lang.c.

Referenced by _initialize_objc_lang(), and find_methods().

const struct op_print objc_op_print_tab[]
static

Definition at line 319 of file objc-lang.c.

struct selname* selname_chain
static

Definition at line 410 of file objc-lang.c.

Referenced by end_msglist(), and start_msglist().