OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [gdb/] [testsuite/] [gdb.objc/] [basicclass.m] - Diff between revs 24 and 157

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
#include <objc/Object.h>
#include <objc/Object.h>
 
 
@interface BasicClass: Object
@interface BasicClass: Object
{
{
  id object;
  id object;
}
}
+ newWithArg: arg;
+ newWithArg: arg;
- doIt;
- doIt;
- takeArg: arg;
- takeArg: arg;
- printHi;
- printHi;
- (int) printNumber: (int)number;
- (int) printNumber: (int)number;
- (const char *) myDescription;
- (const char *) myDescription;
@end
@end
 
 
@interface BasicClass (Private)
@interface BasicClass (Private)
- hiddenMethod;
- hiddenMethod;
@end
@end
 
 
@implementation BasicClass
@implementation BasicClass
+ newWithArg: arg
+ newWithArg: arg
{
{
  id obj = [self new];
  id obj = [self new];
  [obj takeArg: arg];
  [obj takeArg: arg];
  return obj;
  return obj;
}
}
 
 
- doIt
- doIt
{
{
  return self;
  return self;
}
}
 
 
- takeArg: arg
- takeArg: arg
{
{
  object = arg;
  object = arg;
  [self hiddenMethod];
  [self hiddenMethod];
  return self;
  return self;
}
}
 
 
- printHi
- printHi
{
{
  printf("Hi\n");
  printf("Hi\n");
  return self;
  return self;
}
}
 
 
- (int) printNumber: (int)number
- (int) printNumber: (int)number
{
{
  printf("%d\n", number);
  printf("%d\n", number);
  return number+1;
  return number+1;
}
}
 
 
- (const char *) myDescription
- (const char *) myDescription
{
{
  return "BasicClass gdb test object";
  return "BasicClass gdb test object";
}
}
 
 
@end
@end
 
 
@implementation BasicClass (Private)
@implementation BasicClass (Private)
- hiddenMethod
- hiddenMethod
{
{
  return self;
  return self;
}
}
@end
@end
 
 
int main (int argc, const char *argv[])
int main (int argc, const char *argv[])
{
{
  id obj;
  id obj;
  obj = [BasicClass new];
  obj = [BasicClass new];
  [obj takeArg: obj];
  [obj takeArg: obj];
  return 0;
  return 0;
}
}
 
 
const char *_NSPrintForDebugger(id object)
const char *_NSPrintForDebugger(id object)
{
{
  /* This is not really what _NSPrintForDebugger should do, but it
  /* This is not really what _NSPrintForDebugger should do, but it
     is a simple test if gdb can call this function */
     is a simple test if gdb can call this function */
  if (object && [object respondsTo: @selector(myDescription)])
  if (object && [object respondsTo: @selector(myDescription)])
    return [object myDescription];
    return [object myDescription];
 
 
  return NULL;
  return NULL;
}
}
 
 

powered by: WebSVN 2.1.0

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