mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-06 07:33:08 +00:00
The gdb.objc tests haven't compiled in years. This patch fixes this, based on a comment in bug 31671. I don't know whether this approach works with the clang implementation of Objective-C. However, it does work with GCC, provided that gnustep-base is installed.
51 lines
739 B
Objective-C
51 lines
739 B
Objective-C
#include <stdio.h>
|
|
#include <Foundation/NSObject.h>
|
|
|
|
@interface Decode: NSObject
|
|
{
|
|
}
|
|
- multipleDef;
|
|
- (const char *) myDescription;
|
|
@end
|
|
|
|
@implementation Decode
|
|
|
|
- multipleDef
|
|
{
|
|
printf("method multipleDef\n");
|
|
return self;
|
|
}
|
|
|
|
- (const char *) myDescription
|
|
{
|
|
return "Decode gdb test object";
|
|
}
|
|
|
|
@end
|
|
|
|
int
|
|
multipleDef()
|
|
{
|
|
printf("function multipleDef\n");
|
|
return 0;
|
|
}
|
|
|
|
int main (int argc, const char *argv[])
|
|
{
|
|
id obj;
|
|
obj = [Decode new];
|
|
multipleDef();
|
|
[obj multipleDef];
|
|
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)
|
|
return [object myDescription];
|
|
|
|
return NULL;
|
|
}
|