[Haiku-commits] r30955 - in haiku/trunk/src: add-ons/kernel/debugger/demangle system/kernel/arch/x86

bonefish at mail.berlios.de bonefish at mail.berlios.de
Thu Jun 4 04:00:48 CEST 2009


Author: bonefish
Date: 2009-06-04 04:00:45 +0200 (Thu, 04 Jun 2009)
New Revision: 30955
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=30955&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/debugger/demangle/gcc2.cpp
   haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
Log:
Moved the appending of '*'/'&' for pointer/reference parameters to the gcc 2
demangler, where it belongs. The gcc 4 stack traces look correct now.


Modified: haiku/trunk/src/add-ons/kernel/debugger/demangle/gcc2.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/debugger/demangle/gcc2.cpp	2009-06-04 01:47:05 UTC (rev 30954)
+++ haiku/trunk/src/add-ons/kernel/debugger/demangle/gcc2.cpp	2009-06-04 02:00:45 UTC (rev 30955)
@@ -349,8 +349,8 @@
 					return B_LINK_LIMIT;
 
 				// it's a repeat case
-				status_t status = get_next_argument_internal(&index, symbol, name,
-					nameSize, _type, _argumentLength, true);
+				status_t status = get_next_argument_internal(&index, symbol,
+					name, nameSize, _type, _argumentLength, true);
 				if (status == B_OK)
 					(*_cookie)++;
 				return status;
@@ -472,6 +472,14 @@
 get_next_argument_gcc2(uint32* _cookie, const char* symbol, char* name,
 	size_t nameSize, int32* _type, size_t* _argumentLength)
 {
-	return get_next_argument_internal(_cookie, symbol, name, nameSize, _type,
-		_argumentLength, false);
+	status_t error = get_next_argument_internal(_cookie, symbol, name, nameSize,
+		_type, _argumentLength, false);
+	if (error != B_OK)
+		return error;
+
+	// append the missing '*'/'&' for pointer/ref types
+	if (name[0] != '\0' && (*_type == B_POINTER_TYPE || *_type == B_REF_TYPE))
+		strlcat(name, *_type == B_POINTER_TYPE ? "*" : "&", nameSize);
+
+	return B_OK;
 }

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp	2009-06-04 01:47:05 UTC (rev 30954)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.cpp	2009-06-04 02:00:45 UTC (rev 30955)
@@ -204,10 +204,8 @@
 				kprintf("\33[34m%s\33[0m", value ? "true" : "false");
 				break;
 			default:
-				if (buffer[0]) {
-					kprintf("%s%s: ", buffer, type == B_POINTER_TYPE ? "*"
-						: type == B_REF_TYPE ? "&" : "");
-				}
+				if (buffer[0])
+					kprintf("%s: ", buffer);
 
 				if (length == 4) {
 					value = *(uint32*)arg;




More information about the Haiku-commits mailing list