From f2a570395967a4422fa5c84274a6d08d1c0920c2 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 12 May 2016 23:41:27 +0000 Subject: [PATCH] parse GDB version from initial information git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@39749 72102866-910b-0410-8b05-ffd578937521 --- .../Debuggers/ProjectCenter/PipeDelegate.m | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Modules/Debuggers/ProjectCenter/PipeDelegate.m b/Modules/Debuggers/ProjectCenter/PipeDelegate.m index ff56fb3..cc5c2a6 100644 --- a/Modules/Debuggers/ProjectCenter/PipeDelegate.m +++ b/Modules/Debuggers/ProjectCenter/PipeDelegate.m @@ -213,6 +213,28 @@ [stringScanner scanString: @"~" intoString: &prefix]; if(prefix != nil) { + if ([debugger gdbVersion] == 0.0) + { + NSString *str1 = nil; + NSString *str2 = nil; + + [stringScanner scanString: @"\"GNU gdb" intoString: &str1]; + if (str1 != nil) + { + [stringScanner scanString: @" (GDB)" intoString: &str2]; + } + + if (str2 != nil || str1 != nil) + { + float v; + + if ([stringScanner scanFloat:&v]) + { + NSLog(@"GDB version string: %f", v); + [debugger setGdbVersion:v]; + } + } + } return PCDBConsoleStreamRecord; } @@ -288,7 +310,7 @@ NSArray *components = [inputString componentsSeparatedByString:@"\n"]; NSEnumerator *en = [components objectEnumerator]; NSString *item = nil; - + while((item = [en nextObject]) != nil) { PCDebuggerOutputTypes outtype = [self parseStringLine: item];