From 2d8f1c5d6021f278e2025877c9e6946fa6094c6e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 15 Feb 2009 11:02:27 -0500 Subject: [PATCH] Fixed a segfault crash that would occur if you stepped at the end of a script * Source/GDBpConnection.m: (stepIn): Update the status before creating the stack frame so we know if we're connected or not (stepOut): ditto (stepOver): ditto --- CHANGES | 1 + Source/GDBpConnection.m | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 584e055..1816b4e 100644 --- a/CHANGES +++ b/CHANGES @@ -5,6 +5,7 @@ MacGDBp CHANGE LOG ##################### - Fix: The temporary file used for highlighting source code is now saved as UTF8 so files with non-ASCII characters will now be highlighted +- Fix: #152 MacGDBp would crash/segfault if you stepped at the end of a script 1.2 diff --git a/Source/GDBpConnection.m b/Source/GDBpConnection.m index c3805c6..f31df54 100644 --- a/Source/GDBpConnection.m +++ b/Source/GDBpConnection.m @@ -172,10 +172,12 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; [socket send:[self createCommand:@"step_into"]]; [socket receive]; - StackFrame *frame = [self createStackFrame]; [self updateStatus]; - return frame; + if (!connected) + return nil; + + return [self createStackFrame]; } /** @@ -186,10 +188,12 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; [socket send:[self createCommand:@"step_out"]]; [socket receive]; - StackFrame *frame = [self createStackFrame]; [self updateStatus]; - return frame; + if (!connected) + return nil; + + return [self createStackFrame]; } /** @@ -200,10 +204,12 @@ NSString *kErrorOccurredNotif = @"GDBpConnection_ErrorOccured_Notification"; [socket send:[self createCommand:@"step_over"]]; [socket receive]; - StackFrame *frame = [self createStackFrame]; [self updateStatus]; - return frame; + if (!connected) + return nil; + + return [self createStackFrame]; } /** -- 2.43.5