mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
Add capability to debugger to focus on file and line which has been stopped on
This commit is contained in:
parent
25f423bebd
commit
56d789e232
7 changed files with 64 additions and 1 deletions
|
@ -554,5 +554,19 @@ NSString *PCEditorDidResignActiveNotification =
|
|||
[editor scrollToLineNumber: [line integerValue]];
|
||||
}
|
||||
|
||||
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line
|
||||
{
|
||||
id<CodeEditor> editor = [self openEditorForFile: fileName
|
||||
editable: YES
|
||||
windowed: NO];
|
||||
|
||||
PCProject *project = [_projectManager rootActiveProject];
|
||||
[[project projectBrowser] setPath: fileName];
|
||||
[_projectManager openFileAtPath: fileName];
|
||||
|
||||
// [self orderFrontEditorForFile:fileName];
|
||||
[editor scrollToLineNumber: line];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -1124,6 +1124,7 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
// ============================================================================
|
||||
|
||||
- (void)openFileAtPath:(NSString *)filePath
|
||||
windowed:(BOOL)windowed
|
||||
{
|
||||
editorManager = [self editorManager];
|
||||
|
||||
|
@ -1131,11 +1132,17 @@ NSString *PCActiveProjectDidChangeNotification = @"PCActiveProjectDidChange";
|
|||
{
|
||||
[editorManager openEditorForFile:filePath
|
||||
editable:YES
|
||||
windowed:YES];
|
||||
windowed:windowed];
|
||||
[editorManager orderFrontEditorForFile:filePath];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openFileAtPath:(NSString *)filePath
|
||||
{
|
||||
[self openFileAtPath: filePath windowed: YES];
|
||||
}
|
||||
|
||||
|
||||
- (void)openFile
|
||||
{
|
||||
NSArray *files = nil;
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
- (NSArray *)allEditors;
|
||||
- (void)closeActiveEditor:(id)sender;
|
||||
- (void)closeEditorForFile:(NSString *)file;
|
||||
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line;
|
||||
|
||||
- (NSArray *)modifiedFiles;
|
||||
- (BOOL)hasModifiedFiles;
|
||||
|
|
|
@ -164,6 +164,7 @@ extern NSString *PCActiveProjectDidChangeNotification;
|
|||
|
||||
// Also called by PCAppController
|
||||
- (void)openFileAtPath:(NSString *)filePath;
|
||||
- (void)openFileAtPath:(NSString *)filePath windowed: (BOOL)windowed;
|
||||
- (void)openFile;
|
||||
- (void)newFile;
|
||||
- (BOOL)saveFile;
|
||||
|
|
|
@ -379,6 +379,29 @@
|
|||
[debugger setLastLineNumberParsed: NSNotFound];
|
||||
}
|
||||
}
|
||||
|
||||
if ([dictionaryName isEqualToString: @"thread-selected"])
|
||||
{
|
||||
NSDictionary *d = [dict objectForKey: @"frame"];
|
||||
NSString *fileName;
|
||||
NSString *lineNum;
|
||||
|
||||
fileName = [d objectForKey:@"fullname"];
|
||||
lineNum = [d objectForKey:@"line"];
|
||||
|
||||
NSLog(@"parsed from GDB thread-selected: %@:%@", fileName, lineNum);
|
||||
if (fileName != nil && lineNum != nil)
|
||||
{
|
||||
[debugger setLastFileNameParsed: fileName];
|
||||
[debugger setLastLineNumberParsed: [lineNum intValue]];
|
||||
[debugger updateEditor];
|
||||
}
|
||||
else
|
||||
{
|
||||
[debugger setLastFileNameParsed: nil];
|
||||
[debugger setLastLineNumberParsed: NSNotFound];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -423,6 +446,7 @@
|
|||
{
|
||||
[debugger setLastFileNameParsed: fileName];
|
||||
[debugger setLastLineNumberParsed: [lineNum intValue]];
|
||||
[debugger updateEditor];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -66,5 +66,6 @@ extern NSString *PCDBDebuggerStartedNotification;
|
|||
- (void) setLastFileNameParsed: (NSString *)fname;
|
||||
- (NSUInteger)lastLineNumberParsed;
|
||||
- (void)setLastLineNumberParsed: (NSUInteger)num;
|
||||
- (void)updateEditor;
|
||||
|
||||
@end
|
||||
|
|
|
@ -33,6 +33,10 @@
|
|||
#import "PCDebugger.h"
|
||||
#import "PCDebuggerView.h"
|
||||
|
||||
#import <ProjectCenter/PCProjectManager.h>
|
||||
#import <ProjectCenter/PCEditorManager.h>
|
||||
#import "PCAppController.h"
|
||||
|
||||
#import "Modules/Preferences/EditorFSC/PCEditorFSCPrefs.h"
|
||||
#import "PCDebuggerWrapperProtocol.h"
|
||||
#import "GDBWrapper.h"
|
||||
|
@ -306,6 +310,17 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
|||
lastLineNumberParsed = num;
|
||||
}
|
||||
|
||||
- (void) updateEditor
|
||||
{
|
||||
NSLog(@"****************** UPDATE EDITOR HIT ***********************");
|
||||
PCAppController *controller = (PCAppController *)[NSApp delegate];
|
||||
PCProjectManager *pm = [controller projectManager];
|
||||
PCEditorManager *em = [pm editorManager];
|
||||
[em gotoFile: lastFileNameParsed
|
||||
atLine: lastLineNumberParsed];
|
||||
NSLog(@"****************** UPDATE EDITOR HIT ***********************");
|
||||
}
|
||||
|
||||
// kill process
|
||||
- (void) interrupt
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue