From cd4b8d30cab66b70996c3274ad425974886c8afb Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 3 Aug 2007 16:59:26 -0700 Subject: [PATCH] Adding a method to handle getting the stack trace * Source/DebuggerConnection.m|h: ([DebuggerConnection updateStackTraceAndRegisters]): New method that calls stack_get and eventually context_get ([DebuggerConnection _stackReceived:]): Called when the stack is fully received --- Source/DebuggerConnection.h | 1 + Source/DebuggerConnection.m | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/Source/DebuggerConnection.h b/Source/DebuggerConnection.h index 001a05c..d82cd9c 100644 --- a/Source/DebuggerConnection.h +++ b/Source/DebuggerConnection.h @@ -41,6 +41,7 @@ - (void)run; - (void)stepIn; - (void)refreshStatus; +- (void)updateStackTraceAndRegisters; // ================= internal private - (NSString *)_createCommand: (NSString *)cmd; diff --git a/Source/DebuggerConnection.m b/Source/DebuggerConnection.m index 7d86472..f96164a 100644 --- a/Source/DebuggerConnection.m +++ b/Source/DebuggerConnection.m @@ -183,6 +183,26 @@ [_socket send: [self _createCommand: @"step_into"]]; [_socket receive: nil]; [self refreshStatus]; + [self updateStackTraceAndRegisters]; +} + +/** + * This function queries the debug server for the current stacktrace and all the registers on + * level one. If a user then tries to expand past level one... TOOD: HOLY CRAP WHAT DO WE DO PAST LEVEL 1? + */ +- (void)updateStackTraceAndRegisters +{ + [_socket send: [self _createCommand: @"stack_get"]]; + [_socket receive: @selector(_stackReceived:)]; +} + +/** + * Called by the dataReceived delivery delegate. This updates the window controller's data + * for the stack trace + */ +- (void)_stackReceived: (NSString *)packet +{ + NSLog(@"stacktrace = %@", packet); } /** -- 2.22.5