The "CPU architecture" field is being filled from the wrong part of
the microdump. The microdump OS/arch line looks like:
O A arm 04 armv7l 3.4.0-perf-g4d6e88e #1 SMP PREEMPT Mon Mar 30 19:09:30 2015
and currently the field that says "armv7l" or "aarch64" is being used
to fill in the CPU arch field in crash. The problem is that on a
64-bit device this field *always* says "aarch64" even when running in
a 32-bit process, and so currently the crash reports for aarch64 are
a mix of 32-bit and 64-bit crashes. We should be using the first field
instead, which just says "arm" or "arm64" and reflects the actual
version of webview (32-bit or 64-bit) which is running.

BUG=
R=primiano@chromium.org

Review URL: https://codereview.chromium.org/1306983003 .

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1498 4c0a9323-5329-0410-9bdc-e9ce6186880e
diff --git a/src/processor/microdump.cc b/src/processor/microdump.cc
index 3cc618f..6a51a99 100644
--- a/src/processor/microdump.cc
+++ b/src/processor/microdump.cc
@@ -230,7 +230,7 @@
       GetLine(&os_tokens, &os_version);
       os_version.erase(0, 1);  // remove leading space.
 
-      system_info_->cpu = hw_arch;
+      system_info_->cpu = arch;
       system_info_->cpu_count = HexStrToL<uint8_t>(num_cpus);
       system_info_->os_version = os_version;
 
diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc
index 10e5351..e667c38 100644
--- a/src/processor/microdump_processor_unittest.cc
+++ b/src/processor/microdump_processor_unittest.cc
@@ -128,7 +128,7 @@
   AnalyzeDump("microdump-arm64.dmp", &state, true /* omit_symbols */);
 
   ASSERT_EQ(8U, state.modules()->module_count());
-  ASSERT_EQ("aarch64", state.system_info()->cpu);
+  ASSERT_EQ("arm64", state.system_info()->cpu);
   ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
   ASSERT_EQ(1U, state.threads()->size());
   ASSERT_EQ(12U, state.threads()->at(0)->frames()->size());
@@ -158,7 +158,7 @@
   AnalyzeDump("microdump-arm.dmp", &state, false /* omit_symbols */);
 
   ASSERT_EQ(6U, state.modules()->module_count());
-  ASSERT_EQ("armv7l", state.system_info()->cpu);
+  ASSERT_EQ("arm", state.system_info()->cpu);
   ASSERT_EQ("OS VERSION INFO", state.system_info()->os_version);
   ASSERT_EQ(8U, state.threads()->at(0)->frames()->size());
   ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
@@ -176,7 +176,7 @@
   AnalyzeDump("microdump-arm64.dmp", &state, false /* omit_symbols */);
 
   ASSERT_EQ(8U, state.modules()->module_count());
-  ASSERT_EQ("aarch64", state.system_info()->cpu);
+  ASSERT_EQ("arm64", state.system_info()->cpu);
   ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
   ASSERT_EQ(9U, state.threads()->at(0)->frames()->size());
   ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
diff --git a/src/processor/testdata/microdump.stackwalk-arm.out b/src/processor/testdata/microdump.stackwalk-arm.out
index 4fbeb8f..2b82dab 100644
--- a/src/processor/testdata/microdump.stackwalk-arm.out
+++ b/src/processor/testdata/microdump.stackwalk-arm.out
@@ -1,6 +1,6 @@
 Operating system: Android
                   OS VERSION INFO
-CPU: armv7l
+CPU: arm
      2 CPUs
 
 Crash reason:  
@@ -9,28 +9,45 @@
 
 Thread 0 (crashed)
  0  breakpad_unittests!MicrodumpWriterTest_Setup_Test::TestBody [gtest.h : 1481 + 0x1]
- 
+     r0 = 0x00000000    r1 = 0x00000000    r2 = 0x00000000    r3 = 0x00000000
+     r4 = 0xffea6900    r5 = 0xffea68f0    r6 = 0xffea68f8    r7 = 0xffea6904
+     r8 = 0xffea68e0    r9 = 0xffea6900   r10 = 0xffea6930   r12 = 0x00000000
+     fp = 0x00000ea2    sp = 0xffea68c0    lr = 0xaaaeb307    pc = 0xaaaeb307
     Found by: given as instruction pointer in context
  1  breakpad_unittests!testing::Test::Run [gtest.cc : 2435 + 0x17]
- 
+     r4 = 0xaab431dc    r5 = 0xab20d7d0    r6 = 0xab203478    r7 = 0x00000149
+     r8 = 0xab203588    r9 = 0xab20d7d0   r10 = 0xffea6f60    fp = 0xab2034d8
+     sp = 0xffea6f28    pc = 0xaab0a741
     Found by: call frame info
  2  breakpad_unittests!testing::TestInfo::Run [gtest.cc : 2610 + 0x5]
- 
+     r4 = 0xab205448    r5 = 0xab203478    r6 = 0xf6d21cdd    r7 = 0x00000149
+     r8 = 0xab203588    r9 = 0xab20d7d0   r10 = 0xffea6f60    fp = 0xab2034d8
+     sp = 0xffea6f50    pc = 0xaab0a875
     Found by: call frame info
  3  breakpad_unittests!testing::TestCase::Run [gtest.cc : 2728 + 0x3]
- 
+     r4 = 0xab2054c8    r5 = 0x00000000    r6 = 0xf6d21cdd    r7 = 0x00000149
+     r8 = 0xab203478    r9 = 0xab203588   r10 = 0x00000001    fp = 0xab2034d8
+     sp = 0xffea6f90    pc = 0xaab0a8fd
     Found by: call frame info
  4  breakpad_unittests!testing::internal::UnitTestImpl::RunAllTests [gtest.cc : 4591 + 0x3]
- 
+     r4 = 0xab203478    r5 = 0xab203588    r6 = 0x00000000    r7 = 0x00000001
+     r8 = 0x00000000    r9 = 0xab2047f0   r10 = 0x00000001    fp = 0xab2034d8
+     sp = 0xffea6fc0    pc = 0xaab0aafd
     Found by: call frame info
  5  breakpad_unittests!testing::UnitTest::Run [gtest.cc : 2418 + 0x5]
- 
+     r4 = 0x00000000    r5 = 0xab203478    r6 = 0x00000002    r7 = 0xaaae2c19
+     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000000    fp = 0xffea706c
+     sp = 0xffea7018    pc = 0xaab09a61
     Found by: call frame info
  6  breakpad_unittests!main [gtest.h : 2326 + 0x3]
- 
+     r4 = 0xffea702c    r5 = 0xffea7074    r6 = 0x00000002    r7 = 0xaaae2c19
+     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000000    fp = 0xffea706c
+     sp = 0xffea7028    pc = 0xaaae2c3b
     Found by: call frame info
  7  libc.so + 0x11e9d
- 
+     r4 = 0xffea7074    r5 = 0xffea7080    r6 = 0x00000002    r7 = 0xaaae2c19
+     r8 = 0x00000000    r9 = 0x00000000   r10 = 0x00000000    fp = 0xffea706c
+     sp = 0xffea7040    pc = 0xf7025e9f
     Found by: call frame info
 
 Loaded modules:
diff --git a/src/processor/testdata/microdump.stackwalk-arm64.out b/src/processor/testdata/microdump.stackwalk-arm64.out
index 4f6cd97..2676d02 100644
--- a/src/processor/testdata/microdump.stackwalk-arm64.out
+++ b/src/processor/testdata/microdump.stackwalk-arm64.out
@@ -1,6 +1,6 @@
 Operating system: Android
                   OS 64 VERSION INFO
-CPU: aarch64
+CPU: arm64
      2 CPUs
 
 Crash reason:  
@@ -9,31 +9,95 @@
 
 Thread 0 (crashed)
  0  breakpad_unittests!MicrodumpWriterTest_Setup_Test::TestBody [microdump_writer_unittest.cc : 77 + 0xc]
- 
+     x0 = 0x0000000000000000    x1 = 0x0000000000000000
+     x2 = 0x0000000000000000    x3 = 0x0000000000000000
+     x4 = 0x0000000000000000    x5 = 0x0000000000000000
+     x6 = 0x0000000000000000    x7 = 0x0000000000000000
+     x8 = 0x0000000000000000    x9 = 0x0000000000000000
+    x10 = 0x0000000000000000   x11 = 0x0000000000000000
+    x12 = 0x0000000000000000   x13 = 0x0000000000000000
+    x14 = 0x0000000000000000   x15 = 0x0000000000000000
+    x16 = 0x0000000000000000   x17 = 0x0000000000000000
+    x18 = 0x0000000000000000   x19 = 0x0000007fe2ba6a50
+    x20 = 0x0000007fe2ba65e0   x21 = 0x0000007fe2ba61e0
+    x22 = 0x000000555f6b4000   x23 = 0x0000007fe2ba6280
+    x24 = 0x0000007fe2ba6250   x25 = 0x000000555f6b4c51
+    x26 = 0x0000000000000e91   x27 = 0x0000007fe2ba6220
+    x28 = 0x0000007fe2ba61f0    fp = 0x0000007fe2ba6120
+     lr = 0x000000555f636f6c    sp = 0x0000007fe2ba6120
+     pc = 0x000000555f636f6c
     Found by: given as instruction pointer in context
  1  breakpad_unittests!testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void> [gtest.cc : 2418 + 0x4]
- 
+    x19 = 0x00000055955022d0   x20 = 0x00000055954ee170
+    x21 = 0x00000055954ee170   x22 = 0x00000055954ee390
+    x23 = 0x00000149f6d1624a   x24 = 0x000000555f6df000
+    x25 = 0x0000000000000001   x26 = 0x00000149f6d16249
+    x27 = 0x0000000000000001   x28 = 0x000000555f6b35c9
+     fp = 0x0000007fe2ba7a50    sp = 0x0000007fe2ba7a50
+     pc = 0x000000555f66323c
     Found by: call frame info
  2  breakpad_unittests!testing::Test::Run [gtest.cc : 2435 + 0x14]
- 
+    x19 = 0x00000055955022d0   x20 = 0x00000055954ee170
+    x21 = 0x00000055954ee170   x22 = 0x00000055954ee390
+    x23 = 0x00000149f6d1624a   x24 = 0x000000555f6df000
+    x25 = 0x0000000000000001   x26 = 0x00000149f6d16249
+    x27 = 0x0000000000000001   x28 = 0x000000555f6b35c9
+     fp = 0x0000007fe2ba7a80    sp = 0x0000007fe2ba7a80
+     pc = 0x000000555f66448c
     Found by: call frame info
  3  breakpad_unittests!testing::TestInfo::Run [gtest.cc : 2610 + 0x4]
- 
+    x19 = 0x00000055954f3890   x20 = 0x00000055955022d0
+    x21 = 0x00000055954ee170   x22 = 0x00000055954ee390
+    x23 = 0x00000149f6d1624a   x24 = 0x000000555f6df000
+    x25 = 0x0000000000000001   x26 = 0x00000149f6d16249
+    x27 = 0x0000000000000001   x28 = 0x000000555f6b35c9
+     fp = 0x0000007fe2ba7aa0    sp = 0x0000007fe2ba7aa0
+     pc = 0x000000555f6645b8
     Found by: call frame info
  4  breakpad_unittests!testing::TestCase::Run [gtest.cc : 2728 + 0x0]
- 
+    x19 = 0x00000055954f39a0   x20 = 0x00000055954ee170
+    x21 = 0x00000055954ee390   x22 = 0x0000000000000001
+    x23 = 0x00000149f6d1624a   x24 = 0x000000555f6df000
+    x25 = 0x0000000000000001   x26 = 0x00000149f6d16249
+    x27 = 0x0000000000000001   x28 = 0x000000555f6b35c9
+     fp = 0x0000007fe2ba7ae0    sp = 0x0000007fe2ba7ae0
+     pc = 0x000000555f664674
     Found by: call frame info
  5  breakpad_unittests!testing::internal::UnitTestImpl::RunAllTests [gtest.cc : 4591 + 0x0]
- 
+    x19 = 0x00000055954ee170   x20 = 0x0000000000000000
+    x21 = 0x00000055954ee390   x22 = 0x0000000000000002
+    x23 = 0x0000000000000000   x24 = 0x000000555f6df000
+    x25 = 0x0000000000000001   x26 = 0x00000149f6d16249
+    x27 = 0x0000000000000001   x28 = 0x000000555f6b35c9
+     fp = 0x0000007fe2ba7b20    sp = 0x0000007fe2ba7b20
+     pc = 0x000000555f66494c
     Found by: call frame info
  6  breakpad_unittests!testing::UnitTest::Run [gtest.cc : 2418 + 0x4]
- 
+    x19 = 0x0000000000000000   x20 = 0x00000055954ee170
+    x21 = 0x0000000000000002   x22 = 0x000000555f62b360
+    x23 = 0x0000000000000000   x24 = 0x0000000000000000
+    x25 = 0x0000000000000000   x26 = 0x0000000000000000
+    x27 = 0x0000000000000000   x28 = 0x0000000000000000
+     fp = 0x0000007fe2ba7bc0    sp = 0x0000007fe2ba7bc0
+     pc = 0x000000555f664b68
     Found by: call frame info
  7  breakpad_unittests!main [gtest.h : 2326 + 0x0]
- 
+    x19 = 0x0000007fe2ba7c1c   x20 = 0x0000007fe2ba7c88
+    x21 = 0x0000000000000002   x22 = 0x000000555f62b360
+    x23 = 0x0000000000000000   x24 = 0x0000000000000000
+    x25 = 0x0000000000000000   x26 = 0x0000000000000000
+    x27 = 0x0000000000000000   x28 = 0x0000000000000000
+     fp = 0x0000007fe2ba7bf0    sp = 0x0000007fe2ba7bf0
+     pc = 0x000000555f62b398
     Found by: call frame info
  8  libc.so + 0x17388
- 
+    x19 = 0x0000007fe2ba7ca0   x20 = 0x0000007fe2ba7c88
+    x21 = 0x0000000000000002   x22 = 0x000000555f62b360
+    x23 = 0x0000000000000000   x24 = 0x0000000000000000
+    x25 = 0x0000000000000000   x26 = 0x0000000000000000
+    x27 = 0x0000000000000000   x28 = 0x0000000000000000
+     fp = 0x0000007fe2ba7c20    sp = 0x0000007fe2ba7c20
+     pc = 0x0000007f802ac38c
     Found by: call frame info
 
 Loaded modules:
diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
index 55abe0d..8193ed0 100644
--- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
+++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm.out
@@ -1,5 +1,5 @@
 OS|Android|OS VERSION INFO
-CPU|armv7l||2
+CPU|arm||2
 Crash||0x0|0
 Module|breakpad_unittests||breakpad_unittests|DA7778FB66018A4E9B4110ED06E730D00|0xaaacd000|0xaab48fff|0
 Module|libnetd_client.so||libnetd_client.so|56B149396A4DAF176E26B4A85DA87BF30|0xf6fca000|0xf6fcdfff|0
diff --git a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
index eb482ee..4a26ecf 100644
--- a/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
+++ b/src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out
@@ -1,5 +1,5 @@
 OS|Android|OS 64 VERSION INFO
-CPU|aarch64||2
+CPU|arm64||2
 Crash||0x0|0
 Module|breakpad_unittests||breakpad_unittests|D6D1FEC9A15DE7F38A236898871A2E770|0x555f608000|0x555f6c7fff|0
 Module|libnetd_client.so||libnetd_client.so|7735F44BA6D7C27FD5C3636A43369B7C0|0x7f801f6000|0x7f80208fff|0