Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

Debugging SGX Application in Simulation Mode

faur__anca
Beginner
707 Views

Hello, 

I am trying to debug a simple SGX application (provided in the Lab 6 Debugging training https://software.intel.com/en-us/download/the-intel-sgx-web-based-training-lab-bundle) using the Intel(R) SGX Debugger.

My PC's hardware doesn't support Intel SGX, so I run my application in Simulation Mode using Visual Studio 2015.

My applications compiles successfully, but during building, there are two dlls (sgx_urts_simd.dll, sgx_uae_service_sim.dll ) whose symbols are not loaded (I followed the specified path and the dlls can be found in the folder). I am not sure if this affects me later on. 

I can add breakpoints in the Enclave.cpp code and the step by step debugging reaches those points, but upon returning from a function in Enclave_t.c,a "Source not Found" window pops in and notifies me that "trts.cpp" was not found and I need to find it in order to view the source for the current stack call. I don't know how to resume debugging from now on.

My enclave has the following Additional Dependencies in the Properties->Linker->Input: 

sgx_trts_sim.lib;

sgx_tstdc.lib;

sgx_tservice_sim.lib;

sgx_tcrypto.lib;

sgx_tcxx.lib .

 

Thank you for any help.

 

 

0 Kudos
1 Solution
Scott_R_Intel
Employee
707 Views

Hello, Anca.

You won't be able to step into trts.cpp as it is part of the sgx_trts_sim.lib that is distributed as binary only.  To continue, you could put a break point at the instruction just after your original trusted function call in your untrusted code that ecall'd into the enclave and then simply F5 - Run to it.

Hope this helps.

Scott

View solution in original post

0 Kudos
1 Reply
Scott_R_Intel
Employee
708 Views

Hello, Anca.

You won't be able to step into trts.cpp as it is part of the sgx_trts_sim.lib that is distributed as binary only.  To continue, you could put a break point at the instruction just after your original trusted function call in your untrusted code that ecall'd into the enclave and then simply F5 - Run to it.

Hope this helps.

Scott

0 Kudos
Reply