Skip to content

Commit

Permalink
Add debug opt-in
Browse files Browse the repository at this point in the history
  • Loading branch information
Danacus authored and jovanbulck committed Apr 11, 2024
1 parent 870f3c5 commit 86786e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libsgxstep/enclave.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ void* get_enclave_ssa_gprsgx_adrs(void)
return get_enclave_base() + ossa + (cssa * SGX_SSAFRAMESIZE) - SGX_GPRSGX_SIZE;
}

void set_debug_optin(void)
{
void *tcs_addr = sgx_get_tcs();
uint64_t flags = 0x1;
edbgwr(tcs_addr + 8, &flags, sizeof(flags));
}

void print_enclave_info(void)
{
uint64_t read = 0xff;
Expand Down
2 changes: 2 additions & 0 deletions libsgxstep/enclave.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,7 @@ void dump_gprsgx_region(gprsgx_region_t *gprsgx_region);
uint64_t edbgrd_ssa_gprsgx(int gprsgx_field_offset);
#define edbgrd_erip() edbgrd_ssa_gprsgx(SGX_GPRSGX_RIP_OFFSET)

void set_debug_optin(void);

#endif
#endif

0 comments on commit 86786e6

Please sign in to comment.