Files
intel-linux-sgx/sdk/debugger_interface/linux
Yu Ding e0a51c4974 Fix sgx-gdb throw exceptions on every ocall in Rust-SGX (#489)
* 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
2020-02-21 16:15:31 +08:00
..
2019-07-05 14:12:24 +08:00