* Makefile.in (ALL_SUBDIRS): Add gdb.objc
* configure.in (AC_OUTPUT): Add gdb.objc/Makefile * gdb.objc/Makefile.in, gdb.objc/basicclass.exp, gdb.objc/basicclass.m: : New files * lib/gdb.exp (gdb_compile_objc): New procedure.
This commit is contained in:
parent
10a9829174
commit
130cacceca
8 changed files with 382 additions and 42 deletions
81
gdb/testsuite/gdb.objc/basicclass.m
Normal file
81
gdb/testsuite/gdb.objc/basicclass.m
Normal file
|
@ -0,0 +1,81 @@
|
|||
#include <objc/Object.h>
|
||||
|
||||
@interface BasicClass: Object
|
||||
{
|
||||
id object;
|
||||
}
|
||||
+ newWithArg: arg;
|
||||
- doIt;
|
||||
- takeArg: arg;
|
||||
- printHi;
|
||||
- (int) printNumber: (int)number;
|
||||
- (const char *) myDescription;
|
||||
@end
|
||||
|
||||
@interface BasicClass (Private)
|
||||
- hiddenMethod;
|
||||
@end
|
||||
|
||||
@implementation BasicClass
|
||||
+ newWithArg: arg
|
||||
{
|
||||
id obj = [self new];
|
||||
[obj takeArg: arg];
|
||||
return obj;
|
||||
}
|
||||
|
||||
- doIt
|
||||
{
|
||||
return self;
|
||||
}
|
||||
|
||||
- takeArg: arg
|
||||
{
|
||||
object = arg;
|
||||
[self hiddenMethod];
|
||||
return self;
|
||||
}
|
||||
|
||||
- printHi
|
||||
{
|
||||
printf("Hi\n");
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int) printNumber: (int)number
|
||||
{
|
||||
printf("%d\n", number);
|
||||
return number+1;
|
||||
}
|
||||
|
||||
- (const char *) myDescription
|
||||
{
|
||||
return "BasicClass gdb test object";
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation BasicClass (Private)
|
||||
- hiddenMethod
|
||||
{
|
||||
return self;
|
||||
}
|
||||
@end
|
||||
|
||||
int main (int argc, const char *argv[])
|
||||
{
|
||||
id obj;
|
||||
obj = [BasicClass new];
|
||||
[obj takeArg: obj];
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *_NSPrintForDebugger(id object)
|
||||
{
|
||||
/* This is not really what _NSPrintForDebugger should do, but it
|
||||
is a simple test if gdb can call this function */
|
||||
if (object && [object respondsTo: @selector(myDescription)])
|
||||
return [object myDescription];
|
||||
|
||||
return NULL;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue