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

Supporting Backtrace crate for x86_64-fortanix-unknown-sgx. #152

Conversation

VardhanThigle
Copy link

@VardhanThigle VardhanThigle commented Jan 10, 2019

Supporting a new target for this crate needs us to support backtrace and symbolize.

backtrace:

This is supported via a port of libunwind which is linked to x86_64-fortanix-unknown-sgx. See rust-lang/#56979 for more details

symbolize:

To reduce enclave TCB size, we do not support symbol resolution for this target. So symbol resolution would basically pass via NOOP implementation. For generating backtrace after a panic, in the std library, we rather, display the offset of each function, which could be resolved later. See rust-lang/#57441 for more details.
This PR tries to emulate same behaviour for backtrace crate. Here we let the back trace have actual addresses, which would be consistent with the function pointers at run time. But, while displaying the back-trace structure, we convert the addresses to their corresponding offsets so that the user could easily resolve the actual symbols (say, via addr2len).

cc: @jethrogb

1. Backtracing is supported via libunwind which is linked to x86_64-fortanix-unknown-sgx.
2. To reduce enclave TCB size, we do not support symbol resolution for this target.
   We rather, display the offset of each function, which could be resolved later.
@alexcrichton alexcrichton merged commit 94d2c37 into rust-lang:master Jan 10, 2019
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