Skip to content

Comments

Add support for collecting frame information via callbacks.#11

Open
denravonska wants to merge 2 commits intored-rocket-computing:masterfrom
denravonska:feature/callback-support
Open

Add support for collecting frame information via callbacks.#11
denravonska wants to merge 2 commits intored-rocket-computing:masterfrom
denravonska:feature/callback-support

Conversation

@denravonska
Copy link

@denravonska denravonska commented May 23, 2023

In addition to the previous API where the caller provided a buffer and a size, it's now possible to instead proviced a callback and a context. This allows the caller to use their own data structures without having to allocate an additional set of objects to pass to backtrace.

The old API is still intact but has internally been rewritten to also use the callback mechanisms. Note that this does increase the stack strain a bit as each frame has to go through the callback.

Additionally, this also adds support for traversing a frame provided by the user, with or without callbacks).

Let me know if it's unclear, needs comments or is outright useless.
Tested on Cortex M33 using backtrace_unwind_from_frame_cb.

Closes #10

In addition to the previous API where the caller provided a buffer and a size,
it's now possible to instead proviced a callback and a context. This allows
the caller to use their own data structures without having to allocate an
additional set of objects to pass to backtrace.

The old API is still intact but has internally been rewritten to also use the
callback mechanisms. Note that this does increase the stack strain a bit as
each frame has to go through the callback.

Additionally, this also adds support for traversing a frame provided by the
user, with or without callbacks).

Closes red-rocket-computing#10
@denravonska denravonska mentioned this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frame callback support

1 participant