Open sethmoo opened 4 years ago
I think this is expected. The current design of sgx-gdb needs the enclave file to support debugging.
If the enclave is loaded via buffer, couldn't the gdb plugin gather the symbol information from the buffer itself? IIRC, the buffer is no different from an external file, in terms of contents. It's just loaded from memory instead of an external file. Thus, all the information needed to load symbols should still be there.
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 <class 'gdb.error'> 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#L355If an enclave is loaded from a buffer the
debug_enclave_info_t
object won't havelpFileName
populated. Thus, the debugger extensions cannot load the symbols, and gdb gets quite sad.