OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.objc/] [basicclass.m] - Rev 262

Go to most recent revision | Compare with Previous | Blame | View Log

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

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.