Commit graph

224 commits

Author SHA1 Message Date
Christopher Ferris
2a25c4aab5 Add full support for initing registers.
- Fixes a few bugs in untested functionality.
- Add tests for the way the register handling code is used.
- Fix a few tests that were not reaping child processes.

Bug: 23762183

Test: Ran unit tests on host (32 bit and 64 bit).
Test: Ran unit tests on angler (32 bit and 64 bit).
Change-Id: I573d6617b4f1561f6e8494d7213c52086d112d97
2017-07-11 12:15:54 -07:00
Christopher Ferris
9744fb2b54 Add missing test files to compile.
Bug: 23762183

Test: Ran unit tests.
Change-Id: I8ac43517231d88c68c288800d8ed286daa57bce1
2017-07-07 12:25:23 -07:00
Christopher Ferris
570b76f04f Init .gnu_debugdata in GetElf().
- Modify the tests to share some code for the generation of the elf data.
- Move the gnu_debugdata files into a separate directory.
- Add tests for GetElf().
- Move the CreateMemory() tests and the GetElf() tests into separate files.

Bug: 23762183

Test: New unit tests pass.
Change-Id: Ie3380296bb49753c2ac8801cfa11f93d6ff7121d
2017-06-30 17:24:58 -07:00
Christopher Ferris
9416703f5b Remove assert, use CHECK instead.
- Use the CHECK macro everywhere that assert was used.
- Remove the _debug version of the tests and leave the CHECK macro so
  it's always checking in the code.

Bug: 23762183

Test: Ran unit tests.
Change-Id: Ie705eedae393d0e95bb9d99f852687a11881aef1
2017-06-29 10:29:43 -07:00
Christopher Ferris
bfd6292db6 Fix mac build.
Test: Built.
Change-Id: I455381d29045dc6dddfb2b77dcde312722c06ebf
2017-06-28 20:44:48 -07:00
Christopher Ferris
bae69f1892 Add .gnu_debugdata support.
Update the unwind_info tool to dump all of the sections.

Bug: 23762183

Test: Passes new unit tests.
Change-Id: I8b223bc208a1a2ef06ed333e6d96943c8f273681
2017-06-28 15:23:10 -07:00
Christopher Ferris
8098b1c378 Add section parsing and function name handling.
Add the code to parse the Elf section headers.

Add the plumbing through of all the symbol handling code.

Add tests for all of this new functionality.

Bug: 23762183

Test: Pass new unit tests.
Change-Id: Ie2d90cbb3d7653c53251dbcf34d9e5d241278377
2017-06-23 10:51:28 -07:00
Christopher Ferris
9d239ec6a5 Merge "Fix some memory leaks, potential errors." 2017-06-20 18:29:24 +00:00
Christopher Ferris
051792fed4 Fix some memory leaks, potential errors.
Fix a couple of memory leaks in tests.

Fix a potential case that length could be zero.

Bug: 23762183

Test: Ran unit tests, then ran valgrind on unit tests and verified no leaks.
Change-Id: I5f7602aa0204db0488a8e305250658cdb6e977d0
2017-06-19 16:20:33 -07:00
Christopher Ferris
61d4097737 Add EH frame and debug frame support.
Bug: 23762183

Test: Pass new unit tests.
Change-Id: I1bfe900e068017ff31998f359bf98d4c5c9af2a5
2017-06-16 14:25:29 -07:00
Christopher Ferris
7b8e467192 Change RegsTmpl to RegsImpl.
Also clang-format modified Regs.cpp slightly.

Bug: 23762183

Test: Built and ran unit tests.
Change-Id: I1c7c1b01974ee3f35059c42b8e2aef24d46c81a7
2017-06-01 17:56:46 -07:00
Christopher Ferris
53a3c9b4ab Add DwarfSection classes.
Bug: 23762183

Test: Ran new unit tests.
Change-Id: Icca2a73c50d467718ba4ac41e1c8f541488620dd
2017-06-01 13:12:31 -07:00
Christopher Ferris
8642fcbad2 Add the Dwarf CFA handling.
Bug: 23762183

Test: Ran new unit tests.
Change-Id: I31abac1238cc671b78a505da655fb6298be072b4
2017-04-24 13:24:33 -07:00
Christopher Ferris
0d7cf3e8dd Add function definitions for MapInfo.
Bug: 23762183

Test: All new unit tests pass.
Change-Id: I26a1f6e84bf1a02447eff48ff6e35068554330fe
2017-04-19 15:48:02 -07:00
Christopher Ferris
09385e7db5 Implement maps parsing.
The MapsOffline code is still in development so I'm not testing it very
thoroughly yet.

Bug: 23762183

Test: All unit tests pass.
Change-Id: I77aeac62940cd95c489ee221afe02349bfe39671
2017-04-06 15:01:02 -07:00
Christopher Ferris
e7ba4cc222 Add Symbols parsing.
Bug: 23762183

Test: New unit tests pass.
Change-Id: Ib67fee879120b5e82889076a0f7221dc429ac140
2017-04-04 14:41:34 -07:00
Christopher Ferris
55d22ef67c Add DwarfOp support.
Bug: 23762183

Test: New unit tests pass.
Change-Id: I9581701ee2721283a1114adab4e1bcff881980cc
2017-04-04 12:35:50 -07:00
Christopher Ferris
f447c8eb20 Add overflow checks in Memory objects.
Also change one of the reads to be explicitly ReadField instead of an
overloaded Read function.

Bug: 23762183

Test: Passes new unit tests.
Change-Id: Id848f7b632f67df0c5b7318d9e588942cfd2099a
2017-04-03 18:36:33 -07:00
Christopher Ferris
72a6fa693b Add DwarfMemory class.
Bug: 23762183

Test: Passes new unit tests.
Change-Id: I80293af0b5a8a042195c37a06d64082d2f7c781a
2017-03-24 14:07:21 -07:00
Christopher Ferris
adda674466 Use the 2 space clang format for libunwindstack.
Test: NA
Change-Id: Ibf321931d1e7ac5bbe4e8479c9d706576f55e8ac
2017-03-21 10:41:45 -07:00
Christopher Ferris
3958f8060a Elf interface for new unwinder.
This cl includes the code to read arm unwind information from a shared
library.

Bug: 23762183

Test: Passes all unit tests. I can dump the arm unwind information
Test: for an arm shared library.
Change-Id: I43501ea2eab843b81de8bd5128401dd1971af8d3
2017-03-09 12:27:16 -08:00
Christopher Ferris
01d50374ad Do not build any host targets on mac.
Bug: 23762183

Test: Compiled.
Change-Id: I42afabeb7d3576ea4afd4af05bb1cabd79ac76e5
2017-01-30 13:45:16 -08:00
Christopher Ferris
71a2dcfc64 Remote reference to log/logger.h
It was made an error to include this file after I went through the
presubmit checks.

Test: Compiles.
Change-Id: If00b0b644ecef95325636cec094cfcb399e307f9
2017-01-30 13:24:51 -08:00
Christopher Ferris
723cf9b6e6 New version of unwinder.
Bug: 23762183

Test: All unit tests pass.
Change-Id: I0ac69e55af56e1142c0a1ee3715cdc48f2ed3ec3
2017-01-25 12:21:51 -08:00