[Kcachegrind-callgrind] Support for mips64 objdump format.
Status: Beta
Brought to you by:
weidendo
|
From: David N. <Dav...@en...> - 2011-10-31 06:33:46
|
Added support for no spaced hex instructional view in objdump format, "ffffff "* format.
Best Regards,
David Nyström
diff -Naur kcachegrind-0.4.6/kcachegrind/instrview.cpp kcachegrind-0.4.6.new/kcachegrind/instrview.cpp
--- kcachegrind-0.4.6/kcachegrind/instrview.cpp 2005-09-27 00:43:04.000000000 +0200
+++ kcachegrind-0.4.6.new/kcachegrind/instrview.cpp 2011-10-31 07:10:41.700697425 +0100
@@ -80,5 +80,24 @@
if (buf[pos2+2] != ' ') break;
pos2 += 3;
}
- buf[pos2-1]=0;
+ if (pos2 <= pos1) {
+ // skip code, pattern "xxxxxxxx "*
+ // Try again with the "ffffff "* format */
+
+ for (pos1 = pos2;; pos2++) {
+ // Won't handle more than a 64-bit hex instruction
+ if (pos2 - pos1 >= 16) {
+ if (0) qDebug("Instruction > 64 bit, wont interpret on line: %u", __LINE__);
+ return false;
+ }
+
+ if (! ((buf[pos2]>='0' && buf[pos2]<='9') ||
+ (buf[pos2]>='a' && buf[pos2]<='f')) ) break;
+ }
+ pos2++;
+ }
+
+ buf[pos2-1]=0;
+
+
while(buf[pos2]==' '|| buf[pos2]=='\t') pos2++;
|