Home | History | Annotate | Line # | Download | only in gdb.objc
      1 #include <stdio.h>
      2 #include <objc/Object.h>
      3 
      4 @interface Decode: Object
      5 {
      6 }
      7 - multipleDef;
      8 - (const char *) myDescription;
      9 @end
     10 
     11 @implementation Decode
     12 
     13 - multipleDef
     14 {
     15   printf("method multipleDef\n");
     16   return self;
     17 }
     18 
     19 - (const char *) myDescription
     20 {
     21   return "Decode gdb test object";
     22 }
     23 
     24 @end
     25 
     26 int
     27 multipleDef()
     28 {
     29   printf("function multipleDef\n");
     30   return 0;
     31 }
     32 
     33 int main (int argc, const char *argv[])
     34 {
     35   id obj;
     36   obj = [Decode new];
     37   multipleDef();
     38   [obj multipleDef];
     39   return 0;
     40 }
     41 
     42 const char *_NSPrintForDebugger(id object)
     43 {
     44   /* This is not really what _NSPrintForDebugger should do, but it
     45      is a simple test if gdb can call this function */
     46   if (object && [object respondsTo: @selector(myDescription)])
     47     return [object myDescription];
     48 
     49   return NULL;
     50 }
     51