intel / intel/confidential-computing.sgx.sdk
sgx-gdb does not work with sgx_create_enclave_from_buffer_ex
- Dominant language
- C++
- Stars
- 2
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
If an enclave is loaded with `sgx_create_enclave_from_buffer_ex`, then the sgx-gdb doesn't work. We get a Python exception every time the gdb extension script is called:
`Python Exception No symbol table is loaded. Use the "file" command.:`
It appears that `retrieve_enclave_info` assumes the enclave was loaded by file:
https://github.com/intel/linux-sgx/blob/5db5a81b82539abb9a2fbd8bcb44dbaaa6f94c74/sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py#L355
If an enclave is loaded from a buffer the `debug_enclave_info_t` object won't have `lpFileName` populated. Thus, the debugger extensions cannot load the symbols, and gdb gets quite sad.
Contributor guide
Research direction
Start in sdk/debugger_interface/linux/gdb-sgx-plugin/gdb_sgx_plugin.py at retrieve_enclave_info, then inspect the debug_enclave_info_t data produced by sgx_create_enclave_from_buffer_ex. Reproduce the failure with an enclave loaded from a buffer and verify that sgx-gdb no longer raises the missing-symbol-table exception and can load the enclave symbols.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100