Add libunwindstack support for Mips and Mips64
This patch requires v3.18 kernel or above, because v3.10 kernel
has a bug (as of 8/1/2017) in the ptrace(GETREGSET) function for mips
and mips64.
Change-Id: I004c1fa190193eebe1c84440b366289122a6bd8a
Signed-off-by: Douglas Leung <douglas.leung@mips.com>
Signed-off-by: Dejan Jovicevic <dejan.jovicevic@mips.com>
diff --git a/libunwindstack/tests/UnwinderTest.cpp b/libunwindstack/tests/UnwinderTest.cpp
index 2034191..cd46807 100644
--- a/libunwindstack/tests/UnwinderTest.cpp
+++ b/libunwindstack/tests/UnwinderTest.cpp
@@ -32,6 +32,8 @@
#include <unwindstack/RegsArm64.h>
#include <unwindstack/RegsX86.h>
#include <unwindstack/RegsX86_64.h>
+#include <unwindstack/RegsMips.h>
+#include <unwindstack/RegsMips64.h>
#include <unwindstack/Unwinder.h>
#include "ElfFake.h"
@@ -733,6 +735,16 @@
x86_64->set_sp(0x10000);
reg_list.push_back(x86_64);
+ RegsMips* mips = new RegsMips;
+ mips->set_pc(0x2300);
+ mips->set_sp(0x10000);
+ reg_list.push_back(mips);
+
+ RegsMips64* mips64 = new RegsMips64;
+ mips64->set_pc(0x2300);
+ mips64->set_sp(0x10000);
+ reg_list.push_back(mips64);
+
for (auto regs : reg_list) {
ElfInterfaceFake::FakePushFunctionData(FunctionData("Frame0", 10));
@@ -744,10 +756,12 @@
switch (regs->Arch()) {
case ARCH_ARM:
case ARCH_X86:
+ case ARCH_MIPS:
expected = " #00 pc 00001300 /system/fake/libc.so (Frame0+10)";
break;
case ARCH_ARM64:
case ARCH_X86_64:
+ case ARCH_MIPS64:
expected = " #00 pc 0000000000001300 /system/fake/libc.so (Frame0+10)";
break;
default: