gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

KVC weird


From: David Wetzel
Subject: KVC weird
Date: Thu, 16 Sep 2010 17:56:15 -0700

Hi,

I am trying to find whats breaking GSWeb on current -base. 

The code in GSWApplication+Defaults.m does KVC on a class, not an instance.

To track that down, I made this change in base:

Index: Source/Additions/GSObjCRuntime.m
===================================================================
--- Source/Additions/GSObjCRuntime.m    (revision 31362)
+++ Source/Additions/GSObjCRuntime.m    (working copy)
@@ -950,7 +950,8 @@
       if ([sig numberOfArguments] != 2)
        {
          [NSException raise: NSInvalidArgumentException
-                     format: @"key-value get method has wrong number of args"];
+                     format: @"key-value get method has wrong number of args. 
(Expected 2, got %d)",
+                              [sig numberOfArguments]];
        }
       type = [sig methodReturnType];
     }
@@ -1352,7 +1353,10 @@
       if ([sig numberOfArguments] != 3)
        {
          [NSException raise: NSInvalidArgumentException
-                     format: @"key-value set method has wrong number of args"];
+                     format: @"key-value set method has wrong number of args. "
+                              @"(Got %d, expected 3. selector=%@)",
+                              [sig numberOfArguments],
+                              NSStringFromSelector(sel)];
        }
       type = [sig getArgumentTypeAtIndex: 2];
     }

----------------

And I get:

Breakpoint 2, -[NSException raise] (self=0x7f7ffac68440, _cmd=0x7f7ffdb118d0) 
at NSException.m:950
950       if (_reserved == 0)
Current language:  auto; currently objective-c
(gdb) po self
<NSException: 0x7f7ffac68440> NAME:NSInvalidArgumentException REASON:key-value 
set method has wrong number of args. (Got 0, expected 3. 
selector=setDebugSetConfigFilePath:)
(gdb) up
#1  0x00007f7ffd7ff6b2 in +[NSException raise:format:arguments:] 
(self=0x7f7ffdb11520, _cmd=0x7f7ffdb118a0, name=0x7f7ffdb10f40, 
format=0x7f7ffdb9d0a0, 
    argList=0x7f7fffffccf0) at NSException.m:843
843       [except raise];
(gdb) up
#2  0x00007f7ffd7ff5e8 in +[NSException raise:format:] (self=0x7f7ffdb11520, 
_cmd=0x7f7ffdb9cce0, name=0x7f7ffdb10f40, format=0x7f7ffdb9d0a0)
    at NSException.m:829
829       [self raise: name format: format arguments: args];
(gdb) up
#3  0x00007f7ffd91b1f0 in GSObjCSetVal (self=0x7f7ffd4b6660, key=0x7f7fffffcf40 
"debugSetConfigFilePath", val=0x0, sel=0x7f7ffb146240, 
    type=<value optimized out>, size=<value optimized out>, offset=0) at 
GSObjCRuntime.m:1355
1355              [NSException raise: NSInvalidArgumentException
(gdb) po self
WOApplication
(gdb) po [self class]
WOApplication
(gdb) p self       
$1 = (class NSObject *) 0x7f7ffd4b6660
(gdb) p [self class]
$2 = (struct objc_class *) 0x7f7ffd4b6660


So my wild guess is that [sig numberOfArguments] is wrong.

Any ideas how to fix that? (other than changing the macros at 
GSWApplication+Defaults.m)

thanks!


David 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]