mirror of
https://github.com/intel/linux-sgx
synced 2026-06-08 14:49:32 +00:00
e0a51c4974
* Fix sgx-gdb throw exceptions on every ocall in Rust-SGX In Rust-SGX environment, `sgx-gdb` always throws exception after ocall: ``` Python Exception <class 'gdb.error'> syntax error in expression, near `)0x7fffffffd840 = 0'.: ``` And the debugger stops immediately. At this time, the debugger is working in `Rust` mode instead of `C` mode: ``` gdb-peda$ set *(uintptr_t *)0x7fffffffd6d0 = 0 syntax error in expression, near `)0x7fffffffd6d0 = 0'. gdb-peda$ set *(u32)0x7fffffffd6d0 = 0 syntax error in expression, near `0x7fffffffd6d0 = 0'. gdb-peda$ p sizeof(u32) $4 = 0x4 gdb-peda$ show language The current source language is "auto; currently rust". gdb-peda$ set language c gdb-peda$ set *(uintptr_t *)0x7fffffffd6d0 = 0 gdb-peda$ ``` This PR helps set the language to `c` before execution of essential gdb commands, and rolls back to `auto` afterwards. This would benefit lots of developers who are developing SGX enclaves in other languages. Signed-off-by: Yu Ding <dingelish@gmail.com> * Fix