GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/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 "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.

Classes

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

Defines

#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 (void)
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 **class, char **category, char **selector)
static void find_methods (char type, const char *class, 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 *class)
static CORE_ADDR find_implementation_from_class (struct gdbarch *gdbarch, CORE_ADDR class, CORE_ADDR sel)
static CORE_ADDR find_implementation (struct gdbarch *gdbarch, CORE_ADDR object, CORE_ADDR sel)
void _initialize_objc_lang (void)

Variables

static struct objfile_data * objc_objfile_data
static struct op_print objc_op_print_tab []
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

Define Documentation

#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().


Function Documentation

void _initialize_objc_lang ( void  )

Definition at line 1608 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 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]
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  )
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  class,
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 *  class,
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 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]
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 
) [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]
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]
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]
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 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]
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 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]

Variable Documentation

Referenced by initialize_all_files().

Referenced by initialize_all_files().

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}
}

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().

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().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines