Skip to content
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

arch/arm/armv7-a: Modify to printing LR when NULL executing fault #6654

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ewoodev
Copy link
Contributor

@ewoodev ewoodev commented Jan 31, 2025

No description provided.

@ewoodev
Copy link
Contributor Author

ewoodev commented Jan 31, 2025

The PR is from #6643.

if (g_bin_addr_list[bin_idx].text_addr != 0) {
start_addr = g_bin_addr_list[bin_idx].text_addr;
end_addr = start_addr + g_bin_addr_list[bin_idx].text_size;
if (start_addr < addr && addr < end_addr) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it must be start_addr <= addr

The elf_is_text_addr funtion returns whether the address which is argument is
within the text section of an ELF binary registered by binfmt.

Signed-off-by: eunwoo.nam <[email protected]>
@ewoodev ewoodev force-pushed the WORK-250120_prefetch_fault branch from 061801f to b6c08dc Compare February 3, 2025 05:45
If null is executed, prefetch abort is occuring.
But PC and R15 value is 0x00000000.

For debugging this fault, we need to save LR(R14) and print it in fault log.

Therefore, Add print LR in pretech abort logs.
And if PC is not text address, replace system exception location to LR(R14).

Signed-off-by: eunwoo.nam <[email protected]>
If PC becomes invalid causing a fault, we replace the system_exception_location with the address at LR.

However, since the value of LR is the address to execute after returning,
the actual address that caused the fault is the address -4.

Therefore, when replacing LR with exception location, it is corrected to address - 4.
This will help avoid confusion for developers working on debugging applications such as TRAP.

Signed-off-by: eunwoo.nam <[email protected]>
@ewoodev ewoodev force-pushed the WORK-250120_prefetch_fault branch from b6c08dc to 3c569ec Compare February 3, 2025 06:25
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.

2 participants