GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
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 "gdbsupport/gdb_regex.h"
#include "regcache.h"
#include "block.h"
#include "infcall.h"
#include "valprint.h"
#include "cli/cli-utils.h"
#include "c-exp.h"
#include <ctype.h>
#include <algorithm>

Go to the source code of this file.

Classes

struct  objc_object
 
struct  objc_class
 
struct  objc_super
 
struct  objc_method
 
class  objc_language
 
struct  selname
 
struct  objc_methcall
 

Macros

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

Functions

struct symbollookup_struct_typedef (const char *name, const struct block *block, int noerr)
 
CORE_ADDR lookup_objc_class (struct gdbarch *gdbarch, const char *classname)
 
CORE_ADDR lookup_child_selector (struct gdbarch *gdbarch, const char *selname)
 
struct valuevalue_nsstring (struct gdbarch *gdbarch, const char *ptr, int len)
 
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 info_selectors_command (const char *regexp, int from_tty)
 
static int compare_classes (const void *a, const void *b)
 
static void info_classes_command (const 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, std::vector< const char * > *symbol_names)
 
static void uniquify_strings (std::vector< const char * > *strings)
 
const char * find_imps (const char *method, std::vector< const char * > *symbol_names)
 
static void print_object_command (const 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 (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 ()
 
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)
 

Variables

static const registry< objfile >::key< unsigned int > objc_objfile_data
 
static objc_language objc_language_defn
 
static int msglist_len
 
static struct selnameselname_chain
 
static char * msglist_sel
 
static struct objc_methcall methcalls []
 

Macro Definition Documentation

◆ nmethcalls

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

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

Referenced by find_objc_msgcall(), and find_objc_msgsend().

Function Documentation

◆ _initialize_objc_language()

void _initialize_objc_language ( )

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

Referenced by initialize_all_files().

◆ add_msglist()

void add_msglist ( struct stoken * str,
int addcolon )

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

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

Referenced by yyparse().

◆ compare_classes()

static int compare_classes ( const void * a,
const void * b )
static

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

References specialcmp().

Referenced by info_classes_command().

◆ compare_selectors()

static int compare_selectors ( const void * a,
const void * b )
static

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

References specialcmp().

Referenced by info_selectors_command().

◆ end_msglist()

int end_msglist ( struct parser_state * ps)

◆ find_implementation()

static CORE_ADDR find_implementation ( struct gdbarch * gdbarch,
CORE_ADDR object,
CORE_ADDR sel )
static

◆ find_implementation_from_class()

static CORE_ADDR find_implementation_from_class ( struct gdbarch * gdbarch,
CORE_ADDR theclass,
CORE_ADDR sel )
static

◆ find_imps()

const char * find_imps ( const char * method,
std::vector< const char * > * symbol_names )

◆ find_methods()

static void find_methods ( char type,
const char * theclass,
const char * category,
const char * selector,
std::vector< const char * > * symbol_names )
static

◆ find_objc_msgcall()

int find_objc_msgcall ( CORE_ADDR pc,
CORE_ADDR * new_pc )

◆ find_objc_msgcall_submethod()

static int find_objc_msgcall_submethod ( int(*)(CORE_ADDR, CORE_ADDR *) f,
CORE_ADDR pc,
CORE_ADDR * new_pc )
static

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

References exception_fprintf(), f(), and gdb_stderr.

Referenced by find_objc_msgcall().

◆ find_objc_msgsend()

static void find_objc_msgsend ( void )
static

◆ info_classes_command()

static void info_classes_command ( const char * regexp,
int from_tty )
static

◆ info_selectors_command()

static void info_selectors_command ( const char * regexp,
int from_tty )
static

◆ lookup_child_selector()

CORE_ADDR lookup_child_selector ( struct gdbarch * gdbarch,
const char * selname )

◆ lookup_objc_class()

CORE_ADDR lookup_objc_class ( struct gdbarch * gdbarch,
const char * classname )

◆ lookup_struct_typedef()

struct symbol * lookup_struct_typedef ( const char * name,
const struct block * block,
int noerr )

◆ parse_method()

static char * parse_method ( char * method,
char * type,
char ** theclass,
char ** category,
char ** selector )
static

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

References s1, s2, and selector.

Referenced by find_imps(), and find_methods().

◆ parse_selector()

static char * parse_selector ( char * method,
char ** selector )
static

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

References s1, s2, and selector.

Referenced by find_imps().

◆ print_object_command()

static void print_object_command ( const char * args,
int from_tty )
static

◆ read_objc_class()

static void read_objc_class ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct objc_class * theclass )
static

◆ read_objc_methlist_method()

static void read_objc_methlist_method ( struct gdbarch * gdbarch,
CORE_ADDR addr,
unsigned long num,
struct objc_method * method )
static

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

References read_objc_methlist_nmethods(), and read_objc_method().

Referenced by find_implementation_from_class().

◆ read_objc_methlist_nmethods()

static unsigned long read_objc_methlist_nmethods ( struct gdbarch * gdbarch,
CORE_ADDR addr )
static

◆ read_objc_method()

static void read_objc_method ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct objc_method * method )
static

◆ read_objc_object()

static void read_objc_object ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct objc_object * object )
static

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

References gdbarch_byte_order(), and read_memory_unsigned_integer().

Referenced by find_implementation().

◆ read_objc_super()

static void read_objc_super ( struct gdbarch * gdbarch,
CORE_ADDR addr,
struct objc_super * super )
static

◆ resolve_msgsend()

static int resolve_msgsend ( CORE_ADDR pc,
CORE_ADDR * new_pc )
static

◆ resolve_msgsend_stret()

static int resolve_msgsend_stret ( CORE_ADDR pc,
CORE_ADDR * new_pc )
static

◆ resolve_msgsend_super()

static int resolve_msgsend_super ( CORE_ADDR pc,
CORE_ADDR * new_pc )
static

◆ resolve_msgsend_super_stret()

static int resolve_msgsend_super_stret ( CORE_ADDR pc,
CORE_ADDR * new_pc )
static

◆ specialcmp()

static int specialcmp ( const char * a,
const char * b )
static

◆ start_msglist()

void start_msglist ( void )

◆ uniquify_strings()

static void uniquify_strings ( std::vector< const char * > * strings)
static

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

Referenced by find_imps().

◆ value_nsstring()

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

Variable Documentation

◆ methcalls

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(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition objc-lang.c:1464
static int resolve_msgsend_super_stret(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition objc-lang.c:1536
static int resolve_msgsend_super(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition objc-lang.c:1508
static int resolve_msgsend_stret(CORE_ADDR pc, CORE_ADDR *new_pc)
Definition objc-lang.c:1486

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

Referenced by find_objc_msgcall(), and find_objc_msgsend().

◆ msglist_len

int msglist_len
static

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

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

◆ msglist_sel

char* msglist_sel
static

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

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

◆ objc_language_defn

objc_language objc_language_defn
static

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

◆ objc_objfile_data

const registry<objfile>::key<unsigned int> objc_objfile_data
static

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

Referenced by find_methods().

◆ selname_chain

struct selname* selname_chain
static

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

Referenced by end_msglist(), and start_msglist().