[Haiku-commits] r31263 - in haiku/trunk/src: add-ons/kernel/debugger/demangle apps/debugger/demangler

phoudoin at mail.berlios.de phoudoin at mail.berlios.de
Sat Jun 27 01:23:07 CEST 2009


Author: phoudoin
Date: 2009-06-27 01:23:02 +0200 (Sat, 27 Jun 2009)
New Revision: 31263
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31263&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/debugger/demangle/demangle.h
   haiku/trunk/src/apps/debugger/demangler/Demangler.cpp
Log:
Rollback to use demangle_name_gcc3() for gcc3+ to get qualified method demangling.
+ Cleanup coding style violations.


Modified: haiku/trunk/src/add-ons/kernel/debugger/demangle/demangle.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/debugger/demangle/demangle.h	2009-06-26 21:54:46 UTC (rev 31262)
+++ haiku/trunk/src/add-ons/kernel/debugger/demangle/demangle.h	2009-06-26 23:23:02 UTC (rev 31263)
@@ -7,15 +7,13 @@
 
 #include <SupportDefs.h>
 
-const char*
-demangle_symbol(const char* mangledName, char* buffer, size_t bufferSize,
+
+const char* demangle_symbol(const char* mangledName, char* buffer, size_t bufferSize,
 	bool* _isObjectMethod);
 
-status_t
-get_next_argument(uint32* _cookie, const char* mangledName, char* name,
+status_t 	get_next_argument(uint32* _cookie, const char* mangledName, char* name,
 	size_t nameSize, int32* _type, size_t* _argumentLength);
 
-
 // gcc 2
 const char*	demangle_symbol_gcc2(const char* name, char* buffer,
 				size_t bufferSize, bool* _isObjectMethod);

Modified: haiku/trunk/src/apps/debugger/demangler/Demangler.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/demangler/Demangler.cpp	2009-06-26 21:54:46 UTC (rev 31262)
+++ haiku/trunk/src/apps/debugger/demangler/Demangler.cpp	2009-06-26 23:23:02 UTC (rev 31263)
@@ -3,10 +3,10 @@
  * Distributed under the terms of the MIT License.
  */
 
+#include "Demangler.h"
+
 #include <TypeConstants.h>
 
-#include "Demangler.h"
-
 #include "demangle.h"
 
 
@@ -17,11 +17,17 @@
 	char buffer[1024];
 	const char* demangled;
 	
-	demangled = demangle_symbol(mangledName.String(), buffer,
+	if (mangledName.Compare("_Z", 2) == 0)
+		demangled = demangle_name_gcc3(mangledName.String(), buffer,
+			sizeof(buffer));
+	else
+		demangled = demangle_symbol_gcc2(mangledName.String(), buffer,
 			sizeof(buffer), NULL);
+
 	if (demangled == NULL)
-		return mangledName;
-		
+		// name not mangled
+		return mangledName;	
+
 	demangledName << demangled << "(";
 	
 	size_t length;
@@ -29,7 +35,7 @@
 	uint32 cookie = 0;
 	while (get_next_argument(&cookie, mangledName.String(), buffer,
 			sizeof(buffer), &type, &length) == B_OK) {	
-		
+
 		if (i++ > 0)
 			demangledName << ", ";
 			




More information about the Haiku-commits mailing list