ftp.nice.ch/Attic/openStep/developer/bundles/GDBbundle.1.0.s.tgz#/GDBbundle-1.0.s/debug/gdb/gdb/next/DisplaySupport/ViewGdbManager.m

This is ViewGdbManager.m in view mode; [Download] [Up]

/* ViewGdbManager.m created by rhagy on Thu 27-Apr-1995 */
#import "ViewGdbManager.h"
#import <Foundation/Foundation.h>
#import <stdio.h>

static void view_display_window_hook(FILE *instream, char **prompt);

static ViewGdbManager	*viewGdbManager;

GdbManager* make_view_gdb_manager()
{
    return (viewGdbManager = [[ViewGdbManager alloc] init]);
}


@implementation ViewGdbManager

- (void) dealloc
{
    [super dealloc];
}

- (WindowHookFunction) windowHookFunction
{
    return view_display_window_hook;
}


- (int) establishConnection
{
    NSDistantObject	*dP;
    
    NSLog (@"try to establish connection with %@ on host %@",
	    displayProviderConnectionName,
	    displayProviderHostName);
    dP = [NSConnection
        rootProxyForConnectionWithRegisteredName: displayProviderConnectionName
                                            host: displayProviderHostName];

    if (dP == nil) {
	return 0;
    }
	
    [dP setProtocolForProxy:@protocol(ViewDisplayProvider)];
    
    [super setDisplayProvider: dP];

    // FYI: I don't think notification on
    // connection death works because, for viewing,
    // we aren't in a RunLoop.

    return 1;
}

@end

static void
view_display_window_hook(FILE *instream,
                         char **prompt)
{

    if ((++pool_num_times) >= POOL_RELEASE_MAX_TIMES) {
        [pool release];
        pool_num_times = 0;
        pool = [[NSAutoreleasePool alloc] init];
    }

}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.