Interface

GumBacktracer

Description [src]

interface Gum.Backtracer : GObject.Object

Generates a backtrace by walking a thread’s stack.

Using GumBacktracer

g_autoptr(GumBacktracer) backtracer = gum_backtracer_make_accurate ();
                                              // or: make_fuzzy

GumCpuContext *cpu_context = NULL; // walk from here
GumReturnAddressArray retaddrs;
gum_backtracer_generate (backtracer, cpu_context, &retaddrs);

for (guint i = 0; i != retaddrs.len; i++)
  {
    g_print ("retaddrs[%u] = %p\n", i, retaddrs->items[i]);
  }

Prerequisite

In order to implement Backtracer, your type must inherit fromGObject.

Functions

gum_backtracer_make_accurate

Creates a new accurate backtracer, optimized for debugger-friendly binaries or presence of debug information. Resulting backtraces will never contain bogus entries but may be cut short when encountering code built without frame pointers and lack of debug information.

gum_backtracer_make_fuzzy

Creates a new fuzzy backtracer, optimized for debugger-unfriendly binaries that lack debug information. Performs forensics on the stack in order to guess the return addresses. Resulting backtraces will often contain bogus entries, but will never be cut short upon encountering code built without frame pointers and lack of debug information.

Instance methods

gum_backtracer_generate

Walks a thread’s stack and stores each return address in return_addresses. Omit cpu_context to start walking from where this function is called from.

gum_backtracer_generate_with_limit

Walks a thread’s stack and stores each return address in return_addresses, stopping after limit entries. Omit cpu_context to start walking from where this function is called from.

Interface structure

struct GumBacktracerInterface {
  GTypeInterface parent;
  void (* generate) (
    GumBacktracer* self,
    const GumCpuContext* cpu_context,
    GumReturnAddressArray* return_addresses,
    guint limit
  );
  
}

No description available.

Interface members
parent
GTypeInterface
 

No description available.

generate
void (* generate) (
    GumBacktracer* self,
    const GumCpuContext* cpu_context,
    GumReturnAddressArray* return_addresses,
    guint limit
  )
 

No description available.

Virtual methods

Gum.Backtracer.generate
No description available.