-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm32 unwind fix #1102
arm32 unwind fix #1102
Changes from all commits
7cd4334
9c5e2f8
e386996
18e8c53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,7 +248,7 @@ static bool unwind_exec_insn(struct unwind_state *state) | |
|
||
mask = unwind_exec_read_byte(state); | ||
if (mask == 0 || (mask & 0xf0) != 0) | ||
return 1; | ||
return false; | ||
|
||
/* Update SP */ | ||
update_vsp = 1; | ||
|
@@ -283,7 +283,7 @@ static bool unwind_exec_insn(struct unwind_state *state) | |
} | ||
|
||
/* Performs the unwind of a function */ | ||
static int unwind_tab(struct unwind_state *state) | ||
static bool unwind_tab(struct unwind_state *state) | ||
{ | ||
uint32_t entry; | ||
|
||
|
@@ -367,10 +367,14 @@ void print_stack(int level) | |
{ | ||
struct unwind_state state; | ||
|
||
memset(&state, 0, sizeof(state)); | ||
memset(state.registers, 0, sizeof(state.registers)); | ||
/* r7: Thumb-style frame pointer */ | ||
state.registers[7] = read_r7(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for consistency, could you use a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather not for two reasons: (1) it does not improve legibility and (2) the above code is mostly copied from FreeBSD so the less we change it, the better. |
||
/* r11: ARM-style frame pointer */ | ||
state.registers[FP] = read_fp(); | ||
state.registers[SP] = read_sp(); | ||
state.registers[LR] = read_lr(); | ||
state.registers[PC] = read_pc(); | ||
state.registers[PC] = (uint32_t)print_stack; | ||
|
||
do { | ||
switch (level) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe this is a stupid question: why zero-ing only the
registers
sub structure ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because, that's the only part that contains input arguments. The rest is used internally by the unwinding code, so it doesn't look like it is the responsibility of the caller to initialize it (To which value BTW? Is zero acceptable for all fields?).