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

Why not support backtrace in TF #636

Open
onlinefchen opened this issue Oct 8, 2018 · 11 comments
Open

Why not support backtrace in TF #636

onlinefchen opened this issue Oct 8, 2018 · 11 comments
Labels

Comments

@onlinefchen
Copy link

Hello,
TF debug is quite diffcult, panic without useful information.
why not support backtrace for it.

@ghost
Copy link

ghost commented Oct 8, 2018

There is already a backtrace function that is called from assert() and panic(). However, it doesn't work during an actual crash (segmentation fault or similar). Is this what you need?

@onlinefchen
Copy link
Author

It doesn't have the function call graph like linux kernel which is really useful for debug.

@ghost
Copy link

ghost commented Oct 8, 2018

Well, that would use a lot of memory that many platforms don't have. Actually, we even removed the function names from the asserts a long time ago for this reason: ARM-software/arm-trusted-firmware#936

@onlinefchen
Copy link
Author

I donot think so, the function name only use a very little piece of memory. we can alloc a little larger for it. In hikey&hikey960 the memory is enough.
This feature can be more friendly to developer.

@ghost
Copy link

ghost commented Oct 8, 2018

There is another problem, though. We remove all debug symbols when we build, so we need to add the function names and addresses to the binary somehow.

@onlinefchen
Copy link
Author

onlinefchen commented Oct 8, 2018

There is another problem, though. We remove all debug symbols when we build, so we need to add the function names and addresses to the binary somehow.

Only need the elf itself.
Take a look the kernel solution, scripts/kallsyms.c to generate symbol arrary.
And kernel/kallsyms.c to get function name from the generated arrary.
It's quite simple but effective, and it's also suitable for TF.

@ghost
Copy link

ghost commented Oct 9, 2018

The problem is that then you have to somehow add the symbols to the binary, which is not straightforward. In general, it's quite a bit of effort for not too much gain. The idea was to parse the output with a script that takes the elf file as input and translates the addresses to lines of code.

@onlinefchen
Copy link
Author

The problem is that then you have to somehow add the symbols to the binary, which is not straightforward. In general, it's quite a bit of effort for not too much gain. The idea was to parse the output with a script that takes the elf file as input and translates the addresses to lines of code.

Make it more friendly to ourselfs, I can see it's a great work.

@soby-mathew
Copy link

@puckchen , We currently don't have the bandwidth to do this. But if you can contribute a PR to this effect, then we can help review it.

@onlinefchen
Copy link
Author

@soby-mathew I already done and tested it on hikey960. I reuse the kernel kallsyms.c. But the code is a GPL license, so it's a pity story. I know that you will no merge it.

@ghost
Copy link

ghost commented Oct 16, 2018

@puckchen yes, unfortunately we can't accept GPL code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants