[Haiku-commits] r31270 - haiku/trunk/src/apps/debugger/debug_info

bonefish at BerliOS bonefish at mail.berlios.de
Sat Jun 27 18:43:12 CEST 2009


Author: bonefish
Date: 2009-06-27 18:43:07 +0200 (Sat, 27 Jun 2009)
New Revision: 31270
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31270&view=rev

Modified:
   haiku/trunk/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp
Log:
GetFunctions(): Ignore non-function symbols.


Modified: haiku/trunk/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp
===================================================================
--- haiku/trunk/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp	2009-06-27 16:41:46 UTC (rev 31269)
+++ haiku/trunk/src/apps/debugger/debug_info/DebuggerDebugInfo.cpp	2009-06-27 16:43:07 UTC (rev 31270)
@@ -53,19 +53,25 @@
 	symbols.SortItems(&_CompareSymbols);
 
 	// create the function infos
+	int32 functionsAdded = 0;
 	for (int32 i = 0; SymbolInfo* symbol = symbols.ItemAt(i); i++) {
+		if (symbol->Type() != B_SYMBOL_TYPE_TEXT)
+			continue;
+
 		FunctionDebugInfo* function = new(std::nothrow) BasicFunctionDebugInfo(
 			this, symbol->Address(), symbol->Size(), symbol->Name(),
 			Demangler::Demangle(symbol->Name()));
 		if (function == NULL || !functions.AddItem(function)) {
 			delete function;
 			int32 index = functions.CountItems() - 1;
-			for (i--; i >= 0; i--, index--) {
+			for (; functionsAdded >= 0; functionsAdded--, index--) {
 				function = functions.RemoveItemAt(index);
 				delete function;
 			}
 			return B_NO_MEMORY;
 		}
+
+		functionsAdded++;
 	}
 
 	return B_OK;




More information about the Haiku-commits mailing list