Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore debuggability #1200

Merged
merged 8 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,9 @@ endif
endif

ifeq ($(SGX_DEBUG), 1)
# we build with cargo --release, even in SGX DEBUG mode
SGX_COMMON_CFLAGS += -O0 -g -ggdb
# cargo sets this automatically, cannot use 'debug'
OUTPUT_PATH := release
CARGO_TARGET := --release
OUTPUT_PATH := debug
CARGO_TARGET :=
else
SGX_COMMON_CFLAGS += -O2
OUTPUT_PATH := release
Expand Down
4 changes: 2 additions & 2 deletions enclave-runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Rust_Enclave_Files := $(wildcard src/*.rs) $(wildcard ../stf/src/*.rs)
RUSTFLAGS :="-C target-feature=+avx2"

ifeq ($(SGX_DEBUG), 1)
OUTPUT_PATH := release
CARGO_TARGET := --release
OUTPUT_PATH := debug
CARGO_TARGET :=
else
OUTPUT_PATH := release
CARGO_TARGET := --release
Expand Down
12 changes: 12 additions & 0 deletions enclave-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,3 +402,15 @@ fn internal_trigger_parentchain_block_import() -> Result<()> {
triggered_import_dispatcher.import_all()?;
Ok(())
}

#[cfg(debug_assertions)]
#[no_mangle]
pub extern "C" fn __assert_fail(
__assertion: *const u8,
__file: *const u8,
__line: u32,
__function: *const u8,
) -> ! {
use core::intrinsics::abort;
abort()
}
clangenb marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 0 additions & 3 deletions service/src/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ subcommands:
args:
- skip-ra:
long: skip-ra
short: s
help: skip remote attestation. Set this flag if running enclave in SW mode
- shard:
required: false
Expand All @@ -115,12 +114,10 @@ subcommands:
args:
- shard:
long: shard
short: s
required: false
help: shard identifier base58 encoded. Defines the state that this worker shall operate on. Default is mrenclave
- skip-ra:
long: skip-ra
short: s
help: skip remote attestation. Set this flag if running enclave in SW mode
- shielding-key:
about: Get the public RSA3072 key from the TEE to be used to encrypt requests
Expand Down