From f7121306f4feb722aebc2f9af53f3d5f3a808fe0 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 1 May 2011 12:37:35 -0400 Subject: [PATCH] Actually call the delegate method, which hooks everything up. --- Source/DebuggerBackEnd.m | 13 ++++++++++++- Source/EvalController.m | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/DebuggerBackEnd.m b/Source/DebuggerBackEnd.m index 7de4ce0..295851c 100644 --- a/Source/DebuggerBackEnd.m +++ b/Source/DebuggerBackEnd.m @@ -35,6 +35,7 @@ - (void)contextsReceived:(NSXMLDocument*)response; - (void)variablesReceived:(NSXMLDocument*)response; - (void)propertiesReceived:(NSXMLDocument*)response; +- (void)evalScriptReceived:(NSXMLDocument*)response; @end @@ -253,8 +254,10 @@ char* encodedString = malloc(modp_b64_encode_len([str length])); modp_b64_encode(encodedString, [str UTF8String], [str length]); - [connection_ sendCustomCommandWithFormat:@"eval -i {txn} -- %s", encodedString]; + NSNumber* tx = [connection_ sendCustomCommandWithFormat:@"eval -i {txn} -- %s", encodedString]; free(encodedString); + + [self recordCallback:@selector(evalScriptReceived:) forTransaction:tx]; } // Specific Response Handlers ////////////////////////////////////////////////// @@ -505,6 +508,14 @@ [delegate receivedProperties:children forTransaction:transaction]; } +/** + * Callback from a |-evalScript:| request. + */ +- (void)evalScriptReceived:(NSXMLDocument*)response +{ + [delegate scriptWasEvaluatedWithResult:[response stringValue]]; +} + /** * Callback for setting a breakpoint. */ diff --git a/Source/EvalController.m b/Source/EvalController.m index 30536ab..c0b2f0f 100644 --- a/Source/EvalController.m +++ b/Source/EvalController.m @@ -73,7 +73,7 @@ static EvalController* g_activeEvalController = nil; + (void)scriptWasEvaluatedWithResult:(NSString*)result { - g_activeEvalController.resultField.value = result; + [g_activeEvalController.resultField setStringValue:result]; } @end -- 2.43.5