class MockUnwinder

Defined at line 27 of file ../../src/lib/unwinder/testing/mock_unwinder.h

A fake implementation of UnwinderBase.

It is called "MockUnwinder" to align with zxdb naming conventions.

You can specify exactly what frames the unwinder will produce by

seeding it with a predefined stack of frames.

Example usage:

ElfModuleCache module_cache({});

MockUnwinder mock_unwinder(module_cache);

Frame next_expected(Registers(Registers::Arch::kX64), false, Frame::Trust::kCFI);

next_expected.regs.SetPC(0x1234);

mock_unwinder.SetFrames({std::move(next_expected)});

Public Methods

void MockUnwinder (const ElfModuleCache & module_cache)

Defined at line 29 of file ../../src/lib/unwinder/testing/mock_unwinder.h

Error Step (Memory * stack, const Frame & current, Frame & next)

Defined at line 31 of file ../../src/lib/unwinder/testing/mock_unwinder.h

void AsyncStep (AsyncMemory * stack, const Frame & current, fit::callback<void (Error, Registers)> cb)

Defined at line 43 of file ../../src/lib/unwinder/testing/mock_unwinder.h

Frame::Trust trust ()

Defined at line 59 of file ../../src/lib/unwinder/testing/mock_unwinder.h

void SetFrames (std::vector<Frame> frames)

Defined at line 61 of file ../../src/lib/unwinder/testing/mock_unwinder.h

void SetStepError (Error err)

Defined at line 66 of file ../../src/lib/unwinder/testing/mock_unwinder.h

void SetTrust (Frame::Trust trust)

Defined at line 68 of file ../../src/lib/unwinder/testing/mock_unwinder.h