aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-13 12:02:05 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-10-13 12:02:05 -0700
commit86c385d577c9615147c2f9ef051da0c5c2c77b7d (patch)
tree171cec006b56a53ddda1244cf962c1b29328b177
parent70ef107652d2feee009b87dc44039bc0a09b7fff (diff)
demangle arrays
-rw-r--r--src/preamble.js8
-rw-r--r--tests/test_other.py2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index be55a18f..aedb0e7c 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -747,6 +747,14 @@ function demangle(func) {
i += size + 2; // size + 'EE'
break;
}
+ case 'A': { // array
+ var size = parseInt(func.substr(i));
+ i += size.toString().length;
+ if (func[i] !== '_') throw '?';
+ i++; // skip _
+ list.push(parse(true, 1, true)[0] + ' [' + size + ']');
+ break;
+ }
case 'E': break paramLoop;
default: ret += '?' + c; break paramLoop;
}
diff --git a/tests/test_other.py b/tests/test_other.py
index 25c3b41d..185b4853 100644
--- a/tests/test_other.py
+++ b/tests/test_other.py
@@ -1930,6 +1930,7 @@ done.
EM_ASM(Module.print(demangle('__ZNK10__cxxabiv120__si_class_type_info16search_below_dstEPNS_19__dynamic_cast_infoEPKvib')));
EM_ASM(Module.print(demangle('__Z9parsewordRPKciRi')));
EM_ASM(Module.print(demangle('__Z5multiwahtjmxyz')));
+ EM_ASM(Module.print(demangle('__Z1aA32_iPA5_c')));
one(17);
return 0;
}
@@ -1949,6 +1950,7 @@ void Foo::Bar<5>()
__cxxabiv1::__si_class_type_info::search_below_dst(__cxxabiv1::__dynamic_cast_info*, void*, int, bool)
parseword(char*&, int, int&)
multi(wchar_t, signed char, unsigned char, unsigned short, unsigned int, unsigned long, long long, unsigned long long, ...)
+a(int [32], char [5]*)
''', output)
# test for multiple functions in one stack trace
assert 'one(int)' in output