From 7ac072c285fafc59a7ef5920e4b4580aa8c9a464 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 16 May 2009 23:29:33 -0400 Subject: [PATCH] Don't try to manage the stack using internal state anymore, simply grab it every time from the engine * Soure/DebuggerController.m: (stepIn:): The GDBpConnection methods no longer return anything, get entire stack now (stepOut:): ditto (stepOver:): ditto * Soure/GDBpConnection.h+m: (run): Return void (stepIn): ditto (stepOut): ditto (stepOver): ditto --- Source/DebuggerController.m | 23 +++++++++-------------- Source/GDBpConnection.h | 8 ++++---- Source/GDBpConnection.m | 29 +++++------------------------ 3 files changed, 18 insertions(+), 42 deletions(-) diff --git a/Source/DebuggerController.m b/Source/DebuggerController.m index fa64530..4d7f7ca 100644 --- a/Source/DebuggerController.m +++ b/Source/DebuggerController.m @@ -172,11 +172,9 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame* frame = [connection stepIn]; - if ([frame isShiftedFrame:[stackController peek]]) - [stackController pop]; - [stackController push:frame]; - [self updateStackViewer]; + [connection stepIn]; + if ([connection isConnected]) + [self reloadStack]; } /** @@ -187,11 +185,9 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame* frame = [connection stepOut]; - [stackController pop]; // frame we were out of - [stackController pop]; // frame we are returning to - [stackController push:frame]; - [self updateStackViewer]; + [connection stepOut]; + if ([connection isConnected]) + [self reloadStack]; } /** @@ -202,10 +198,9 @@ if ([[variablesTreeController selectedObjects] count] > 0) selectedVariable = [[variablesTreeController selectedObjects] objectAtIndex:0]; - StackFrame* frame = [connection stepOver]; - [stackController pop]; - [stackController push:frame]; - [self updateStackViewer]; + [connection stepOver]; + if ([connection isConnected]) + [self reloadStack]; } /** diff --git a/Source/GDBpConnection.h b/Source/GDBpConnection.h index f8a7637..e2aa13f 100644 --- a/Source/GDBpConnection.h +++ b/Source/GDBpConnection.h @@ -50,10 +50,10 @@ extern NSString* kErrorOccurredNotif; // communication - (void)reconnect; -- (StackFrame*)run; -- (StackFrame*)stepIn; -- (StackFrame*)stepOut; -- (StackFrame*)stepOver; +- (void)run; +- (void)stepIn; +- (void)stepOut; +- (void)stepOver; - (void)addBreakpoint:(Breakpoint*)bp; - (void)removeBreakpoint:(Breakpoint*)bp; diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index 8477c5c..07efb86 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -173,65 +173,46 @@ NSString* kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; /** * Tells the debugger to continue running the script. Returns the current stack frame. */ -- (StackFrame*)run +- (void)run { [socket send:[self createCommand:@"run"]]; [socket receive]; [self updateStatus]; - - if (!connected) - return nil; - - return [self createCurrentStackFrame]; } /** * Tells the debugger to step into the current command. */ -- (StackFrame*)stepIn +- (void)stepIn { [socket send:[self createCommand:@"step_into"]]; [socket receive]; [self updateStatus]; - - if (!connected) - return nil; - - return [self createCurrentStackFrame]; + } /** * Tells the debugger to step out of the current context */ -- (StackFrame*)stepOut +- (void)stepOut { [socket send:[self createCommand:@"step_out"]]; [socket receive]; [self updateStatus]; - - if (!connected) - return nil; - - return [self createCurrentStackFrame]; } /** * Tells the debugger to step over the current function */ -- (StackFrame*)stepOver +- (void)stepOver { [socket send:[self createCommand:@"step_over"]]; [socket receive]; [self updateStatus]; - - if (!connected) - return nil; - - return [self createCurrentStackFrame]; } /** -- 2.43.5