mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-20 06:15:09 +08:00
* gdb/objc-lang.c (FETCH_ARGUMENT): Remove macro.
(OBJC_FETCH_POINTER_ARGUMENT): Shorthand macro for using FETCH_POINTER_ARGUMENT with Objective-C method arguments. (find_implementation, resolve_msgsend, resolve_msgsend_stret, resolve_msgsend_super, resolve_msgsend_super_stret): Use it.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2003-06-07 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* gdb/objc-lang.c (FETCH_ARGUMENT): Remove macro.
|
||||||
|
(OBJC_FETCH_POINTER_ARGUMENT): Shorthand macro for
|
||||||
|
using FETCH_POINTER_ARGUMENT with Objective-C method arguments.
|
||||||
|
(find_implementation, resolve_msgsend, resolve_msgsend_stret,
|
||||||
|
resolve_msgsend_super, resolve_msgsend_super_stret):
|
||||||
|
Use it.
|
||||||
|
|
||||||
2003-06-07 Andrew Cagney <cagney@redhat.com>
|
2003-06-07 Andrew Cagney <cagney@redhat.com>
|
||||||
|
|
||||||
* symfile.h: Re-indent, clean up comments.
|
* symfile.h: Re-indent, clean up comments.
|
||||||
|
@ -1722,41 +1722,6 @@ _initialize_objc_language (void)
|
|||||||
add_com_alias ("po", "print-object", class_vars, 1);
|
add_com_alias ("po", "print-object", class_vars, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 1
|
|
||||||
/* Disable these functions until we put them in the gdbarch vector. */
|
|
||||||
static unsigned long FETCH_ARGUMENT (int i)
|
|
||||||
{
|
|
||||||
internal_error (__FILE__, __LINE__, "FETCH_ARGUMENT not implemented");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#if defined (__powerpc__) || defined (__ppc__)
|
|
||||||
static unsigned long FETCH_ARGUMENT (int i)
|
|
||||||
{
|
|
||||||
return read_register (3 + i);
|
|
||||||
}
|
|
||||||
#elif defined (__i386__)
|
|
||||||
static unsigned long FETCH_ARGUMENT (int i)
|
|
||||||
{
|
|
||||||
CORE_ADDR stack = read_register (SP_REGNUM);
|
|
||||||
return read_memory_unsigned_integer (stack + (4 * (i + 1)), 4);
|
|
||||||
}
|
|
||||||
#elif defined (__sparc__)
|
|
||||||
static unsigned long FETCH_ARGUMENT (int i)
|
|
||||||
{
|
|
||||||
return read_register (O0_REGNUM + i);
|
|
||||||
}
|
|
||||||
#elif defined (__hppa__) || defined (__hppa)
|
|
||||||
static unsigned long FETCH_ARGUMENT (int i)
|
|
||||||
{
|
|
||||||
return read_register (R0_REGNUM + 26 - i);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#error unknown architecture
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_objc_method (CORE_ADDR addr, struct objc_method *method)
|
read_objc_method (CORE_ADDR addr, struct objc_method *method)
|
||||||
{
|
{
|
||||||
@ -1871,6 +1836,9 @@ find_implementation (CORE_ADDR object, CORE_ADDR sel)
|
|||||||
return find_implementation_from_class (ostr.isa, sel);
|
return find_implementation_from_class (ostr.isa, sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define OBJC_FETCH_POINTER_ARGUMENT(argi) \
|
||||||
|
FETCH_POINTER_ARGUMENT (get_current_frame (), argi, builtin_type_void_func_ptr)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc)
|
resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc)
|
||||||
{
|
{
|
||||||
@ -1878,8 +1846,8 @@ resolve_msgsend (CORE_ADDR pc, CORE_ADDR *new_pc)
|
|||||||
CORE_ADDR sel;
|
CORE_ADDR sel;
|
||||||
CORE_ADDR res;
|
CORE_ADDR res;
|
||||||
|
|
||||||
object = FETCH_ARGUMENT (0);
|
object = OBJC_FETCH_POINTER_ARGUMENT (0);
|
||||||
sel = FETCH_ARGUMENT (1);
|
sel = OBJC_FETCH_POINTER_ARGUMENT (1);
|
||||||
|
|
||||||
res = find_implementation (object, sel);
|
res = find_implementation (object, sel);
|
||||||
if (new_pc != 0)
|
if (new_pc != 0)
|
||||||
@ -1896,8 +1864,8 @@ resolve_msgsend_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
|
|||||||
CORE_ADDR sel;
|
CORE_ADDR sel;
|
||||||
CORE_ADDR res;
|
CORE_ADDR res;
|
||||||
|
|
||||||
object = FETCH_ARGUMENT (1);
|
object = OBJC_FETCH_POINTER_ARGUMENT (1);
|
||||||
sel = FETCH_ARGUMENT (2);
|
sel = OBJC_FETCH_POINTER_ARGUMENT (2);
|
||||||
|
|
||||||
res = find_implementation (object, sel);
|
res = find_implementation (object, sel);
|
||||||
if (new_pc != 0)
|
if (new_pc != 0)
|
||||||
@ -1916,8 +1884,8 @@ resolve_msgsend_super (CORE_ADDR pc, CORE_ADDR *new_pc)
|
|||||||
CORE_ADDR sel;
|
CORE_ADDR sel;
|
||||||
CORE_ADDR res;
|
CORE_ADDR res;
|
||||||
|
|
||||||
super = FETCH_ARGUMENT (0);
|
super = OBJC_FETCH_POINTER_ARGUMENT (0);
|
||||||
sel = FETCH_ARGUMENT (1);
|
sel = OBJC_FETCH_POINTER_ARGUMENT (1);
|
||||||
|
|
||||||
read_objc_super (super, &sstr);
|
read_objc_super (super, &sstr);
|
||||||
if (sstr.class == 0)
|
if (sstr.class == 0)
|
||||||
@ -1940,8 +1908,8 @@ resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc)
|
|||||||
CORE_ADDR sel;
|
CORE_ADDR sel;
|
||||||
CORE_ADDR res;
|
CORE_ADDR res;
|
||||||
|
|
||||||
super = FETCH_ARGUMENT (1);
|
super = OBJC_FETCH_POINTER_ARGUMENT (1);
|
||||||
sel = FETCH_ARGUMENT (2);
|
sel = OBJC_FETCH_POINTER_ARGUMENT (2);
|
||||||
|
|
||||||
read_objc_super (super, &sstr);
|
read_objc_super (super, &sstr);
|
||||||
if (sstr.class == 0)
|
if (sstr.class == 0)
|
||||||
|
Reference in New Issue
Block a user