History log of /system/core/libunwindstack/tests/RegsFake.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fe3963143f16833b14b505cf41a2e19a9e304efb 20-Apr-2018 Josh Gao <jmgao@google.com> libunwindstack: add Regs::Clone.

Add a way to copy a Regs object.

Bug: http://b/77296294
Test: libunwindstack_test
Change-Id: I28aff510aa3e1b677d5ae46dc3bfe7652817ce52
(cherry picked from commit 2f37a15472945194fed528cb8d3104aa4865fc4c)
/system/core/libunwindstack/tests/RegsFake.h
414df3e583c21023a22a11b64e703cd4ab38b29a 15-Mar-2018 Yabin Cui <yabinc@google.com> Always set the sp reg to the cfa for DWARF.

There are a few places where it is assumed that this register is
set to the cfa value when interpreting DWARF information.

Add a testcase for unwinding art_quick_osr_stub on ARM.

Bug: 73954823

Test: Ran libunwindstack/libbacktrace unit tests.
Test: Random debuggerd -b of process on a hikey.
Test: Ran the 137 art test on host.
Change-Id: Ida6ccdc38c3cfeea6b57fe861a0cc127b150b790
(cherry picked from commit 11e96fe48a74e6ab97d4de899684d3a61a9d1129)
/system/core/libunwindstack/tests/RegsFake.h
a2ec50bf57c9dba78459ef011cd13f8525ea57b4 22-Feb-2018 Christopher Ferris <cferris@google.com> Change the GetAdjustedRelPc to GetPcAdjustment.

This cleans up a bit of the Unwinder code to make it clear what's
going on.

Modify the offline unit tests to verify the pc and sp to make sure
that those values get computed correctly.

Test: Passes unit tests.
Test: Passes 137-cfi art tests.
Change-Id: I0787a1d77b8726d3defd08f31c7476f6798f8d0d
/system/core/libunwindstack/tests/RegsFake.h
e762f1f193bbaff746bcbe4e4efdad9b3ebfeb26 06-Feb-2018 Christopher Ferris <cferris@google.com> Check that dex pc is in a valid map.

Add new unit tests for dex pc being non-zero.

Bug: 73004673

Test: Ran unit tests.
Test: Ran art 137-cfi test on host for interpreter.
Change-Id: I09bbf96d0ed65fc1e5896e4ab2bc67867e3b7fdb
/system/core/libunwindstack/tests/RegsFake.h
150db124f3f3c0f8e1c341fd33c6c64310e0ac39 21-Dec-2017 Christopher Ferris <cferris@google.com> Add ability to read jit gdb data.

Changes:
- New JitDebug class to handle all of the jit gdb interface.
- Add unit tests for all, along with new offline test using debug data.
- Add new Memory type called MemoryOfflineParts that has multiple
MemoryOffline objects to support the offline test.
- Update the tools to use the JitDebug object.
- Modify libbacktrace to use the JitDebug, but only looking in libart.so
and libartd.so.
- Change the Format32Bits to Is32Bit since it's more accurate and I use
it in a different context where original name didn't make sense.
- Add a new function to find global variables in an elf file
(GetGlobalVariable).
- Add a new function to determine if a pc is valid for this elf (IsValidPc).

Bug: 68396769

Test: Ran new unit tests. Added new offline test that uses jit debug data.
Test: Ran art test that generates jit data and verified a crash unwinds
Test: through the jit data.
Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
/system/core/libunwindstack/tests/RegsFake.h
02fdb569f65f85730cca514311fd0965dec0b6a1 09-Dec-2017 Christopher Ferris <cferris@google.com> Do not check arch for format check.

Use a generic check if the address is 32 bits when using the default
formating of a backtrace line instead of an arch check.

Test: New unit tests pass.
Change-Id: Id609abc037d7b437a02d52763aa91fbefe5f4d5b
/system/core/libunwindstack/tests/RegsFake.h
d06001d6e07b14b865f3294fff82d2571ed7cb2c 01-Dec-2017 Christopher Ferris <cferris@google.com> Split arch data into separate files.

Add an ArchEnum to express the arch of the Elf objects and Reg objects.

Split out the regs code into per arch pieces and generic parts.
Also, split out the header files for each arch.

Do not break out the test code yet, there isn't enough and it doesn't
help to maintain the tests.

Test: libunwindstack/libbacktrace/debuggerd unit tests pass.
Test: Running debuggerd -b <PIDS> yields valid data on bullhead.
Change-Id: If61f6c730c9ff2249f986b41de8c4d62f7158325
/system/core/libunwindstack/tests/RegsFake.h
6f580d8b843f4caac8c12383684941ca02de12a8 22-Sep-2017 Josh Gao <jmgao@google.com> libunwindstack: add method to iterate across registers.

Add a function to iterate over Regs with a human-friendly name and the
value of the register, to make it easy to string-format registers.

Test: mma
Change-Id: I8f33830fa79b245b5030b7bc9bc3c1c7ced80c75
/system/core/libunwindstack/tests/RegsFake.h
f6f691b63c1b2166ed005a462a6fba5001786eda 26-Sep-2017 Christopher Ferris <cferris@google.com> Update the Unwinder object and add tests.

Changes:
- Remove unused GetReturnAddressFromDefault function and tests.
- Modify the unwinder to stop when a pc/sp in a device map.
- Modify the unwinder to skip initial frames based on map names.
- Unit tests that exercise all of the paths in the unwinder code.
- Move the test Elf/ElfInterface objects into their own file.
- Update RegsFake to handle extra cases.
- Modify libbacktrace code to use this unwinder.

The new unwinder does not implement the ignore frame functionality since
this is not used very often and is better implemented using a skip frames
in named libraries functionality.

Test: Ran new unit tests, ran backtrace tests.
Change-Id: Ifd65e9acd66ac5e2d0e04bd32a9ad870b54610ff
/system/core/libunwindstack/tests/RegsFake.h
b9de87f7edefd7a2473134b267716c5fd750e89f 20-Sep-2017 Christopher Ferris <cferris@google.com> Add a new unwind method on error.

If a function crashes by jumping into unexecutable code, the old method
could not unwind through that. Add a fallback method to set the pc from
the default return address location.

In addition, add a new finished check for steps. This will provide a method
to indicate that this step is the last step. This prevents cases where
the fallback method might be triggered incorrectly.

Update the libbacktrace code to unwind using the new methodology.

Update the unwind tool to use the new unwind methodology.

Add a new option to crasher that calls through a null function.

Create a new object, Unwinder, that encapsulates the a basic unwind. For now,
libbacktrace will still use the custom code.

Added new unit tests to cover the new cases. Also add a test that
crashes calling a nullptr as a function, and then has call frames in
the signal stack.

Bug: 65842173

Test: Pass all unit tests, verify crasher dumps properly.
Change-Id: Ia18430ab107e9f7bdf0e14a9b74710b1280bd7f4
/system/core/libunwindstack/tests/RegsFake.h
0953ecd03a90350117d6881c55959c6644972b79 25-Aug-2017 Josh Gao <jmgao@google.com> libunwindstack: make machine type a property of Regs.

There are no actual users of the machine type output parameter to
Regs::RemoteGet. The concrete implementations of Regs know what machine
type they represent anyway, so provide an accessor to query.

Test: treehugger
Test: libunwindstack tests on 32/64-bit host, hikey960
Change-Id: Ia25910531d36c41b2b6919f154cfa914aae63117
/system/core/libunwindstack/tests/RegsFake.h
eb4a6dbf5c6697c953942d079744c05da0c09d51 19-Jul-2017 Christopher Ferris <cferris@google.com> Speed up StepIfSignalHandler path.

The StepIfSignalHandler code reads from the process memory object, which
is currently the slowest way to read memory. Change the code to read from
the elf memory object which will almost always be a memory mapped file and
should be really fast.

Also, move the tests for StepIfSignalHandler to its own file.

Bug: 23762183

Test: Unit tests pass.
Change-Id: I1100b50554e5ef736a87babd484f3f34e9071caa
/system/core/libunwindstack/tests/RegsFake.h
a019665b3cb73609c888af7f17c64bf80ec40283 19-Jul-2017 Christopher Ferris <cferris@google.com> Add signal handling to the register object.

- Add the StepIfSignalHandler function to the Regs object that checks
if the code is in a signal handler.
- Add tests for new code, also add a test that unwinds through a signal
handler.
- Slight modification to Elf to fail if a bad machine type is encountered.
Add tests for this.

Bug: 23762183

Test: Ran unit tests.
Change-Id: Idafa1105d00b91a9343d7464ac9ed1cb95830963
/system/core/libunwindstack/tests/RegsFake.h
d226a5140989f509a0ed3e2723f05d5fc93ce8df 14-Jul-2017 Christopher Ferris <cferris@google.com> Make the library usable as a library.

- Add namespace unwindstack everywhere so that it's easier for other
code to use the library.
- Move some of the header files into include/unwindstack so that they
can be exposed.
- Modify the headers so that only a limited number need to be exposed.
- Update the tools to use the new headers.
- Add a GetLoadBias() call on the Elf object. This prevents the need
to get the interface object out of the Elf object.
- Move the GetRelPc() call out of the Reg class, to the Elf class. It's
not always the case that a Reg object will be around when you want to
get a relative pc. The tests for this moved to ElfTest.cpp.

Bug: 23762183

Test: Unit tests pass.
Change-Id: Iac609dac1dd90ed83d1a1e24ff2579c96c023bc3
/system/core/libunwindstack/tests/RegsFake.h
2a25c4aab5c7d0f0f6018789cce0b6e8c4abb03b 08-Jul-2017 Christopher Ferris <cferris@google.com> 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
/system/core/libunwindstack/tests/RegsFake.h
7b8e4671926486d61aab693968d8a0256a856033 02-Jun-2017 Christopher Ferris <cferris@google.com> Change RegsTmpl to RegsImpl.

Also clang-format modified Regs.cpp slightly.

Bug: 23762183

Test: Built and ran unit tests.
Change-Id: I1c7c1b01974ee3f35059c42b8e2aef24d46c81a7
/system/core/libunwindstack/tests/RegsFake.h
53a3c9b4ab57f04b46bc3abf42e36bdfa821f7f3 11-May-2017 Christopher Ferris <cferris@google.com> Add DwarfSection classes.

Bug: 23762183

Test: Ran new unit tests.
Change-Id: Icca2a73c50d467718ba4ac41e1c8f541488620dd
/system/core/libunwindstack/tests/RegsFake.h