Skip to content
Snippets Groups Projects
Commit 43cd2dde authored by George Nachman's avatar George Nachman
Browse files

Add debugging for tmux crash

parent 069791c8
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -65,6 +65,9 @@ static NSString *kListWindowsFormat = @"\"#{session_name}\t#{window_id}\t"
origins_ = [[NSMutableDictionary alloc] init];
pendingWindowOpens_ = [[NSMutableSet alloc] init];
hiddenWindows_ = [[NSMutableSet alloc] init];
#ifdef TMUX_CRASH_DEBUG
NSLog(@"Register %@ with the controller registry");
#endif
[[TmuxControllerRegistry sharedInstance] setController:self
forClient:@""]; // Set a proper client name
}
Loading
Loading
@@ -73,8 +76,6 @@ static NSString *kListWindowsFormat = @"\"#{session_name}\t#{window_id}\t"
 
- (void)dealloc
{
[[TmuxControllerRegistry sharedInstance] setController:nil
forClient:@""]; // Set a proper client name
[gateway_ release];
[windowPanes_ release];
[windows_ release];
Loading
Loading
@@ -88,6 +89,25 @@ static NSString *kListWindowsFormat = @"\"#{session_name}\t#{window_id}\t"
[super dealloc];
}
 
#ifdef TMUX_CRASH_DEBUG
- (oneway void)release {
NSLog(@"Release %@ to %d from %@", self, [self retainCount] - 1, [NSThread callStackSymbols]);
[super release];
}
- (id)retain {
id x = [super retain];
NSLog(@"Retain %@ to %d from %@", self, [self retainCount], [NSThread callStackSymbols]);
return x;
}
- (id)autorelease {
id x = [super autorelease];
NSLog(@"Autorelease %@ to %d from %@", self, [self retainCount], [NSThread callStackSymbols]);
return x;
}
#endif
- (void)openWindowWithIndex:(int)windowIndex
name:(NSString *)name
size:(NSSize)size
Loading
Loading
@@ -332,6 +352,11 @@ static NSString *kListWindowsFormat = @"\"#{session_name}\t#{window_id}\t"
gateway_ = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:kTmuxControllerDetachedNotification
object:self];
#ifdef TMUX_CRASH_DEBUG
NSLog(@"Deallocating TmuxController. Removing it from registry");
#endif
[[TmuxControllerRegistry sharedInstance] setController:nil
forClient:@""]; // Set a proper client name
}
 
- (BOOL)windowDidResize:(PseudoTerminal *)term
Loading
Loading
Loading
Loading
@@ -36,9 +36,19 @@
 
- (void)setController:(TmuxController *)controller forClient:(TmuxClient *)client
{
#ifdef TMUX_CRASH_DEBUG
NSLog(@"setController:forClient: called.");
NSLog(@"Controllers are: %@", controllers_);
#endif
if (controller) {
#ifdef TMUX_CRASH_DEBUG
NSLog(@"Set controller for client %@ to %@", client, controller);
#endif
[controllers_ setObject:controller forKey:client];
} else {
#ifdef TMUX_CRASH_DEBUG
NSLog(@"Remove controller for client %@", client);
#endif
[controllers_ removeObjectForKey:client];
}
}
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@ NSString * const kTmuxGatewayErrorDomain = @"kTmuxGatewayErrorDomain";;
 
#define NEWLINE @"\r"
 
//#define TMUX_VERBOSE_LOGGING
#define TMUX_VERBOSE_LOGGING
#ifdef TMUX_VERBOSE_LOGGING
#define TmuxLog NSLog
#else
Loading
Loading
Loading
Loading
@@ -2237,6 +2237,7 @@
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = TMUX_CRASH_DEBUG;
GCC_VERSION = com.apple.compilers.llvmgcc42;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment