Skip to content
This repository was archived by the owner on Jan 30, 2024. It is now read-only.
This repository was archived by the owner on Jan 30, 2024. It is now read-only.

Unwinding with -C force-frame-pointers=off #387

@Urhengulas

Description

@Urhengulas

This came up in the review of #383:

// If the frame didn't move, and the program counter didn't change, bail out
// (otherwise we might print the same frame over and over).
if !cfa_changed && !program_counter_changed {
// If we do not end up in the reset function the stack is corrupted
output.corrupted = !reset_range.contains(&pc);
break;
}

this is not due to this PR but I wouldn't necessarily categorize this exit condition as "corrupted". if you compile the rust program with -C force-frame-pointers=off then it's not possible to unwind the stack because frame pointer information is missing (from register r7) so you'll hit this branch but the call stack and the program will both operate fine.

-C force-frame-pointers=off is not very common but the assembly trampolines used to implement context switches in RTOSes / kernels could have the same effect of making unwinding not work.

I think it would be more to correct to simply say in this branch that it's "not possible to further unwind the stack" or something like that

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions