-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
186 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
CC := clang-18 --target=riscv64 -march=rv64imac_zba_zbb_zbc_zbs -g -nostdinc -nostdlib -Ickb-c-stdlib -Ickb-c-stdlib/libc | ||
|
||
all: ckb-c-stdlib \ | ||
always_failure \ | ||
exec_callee \ | ||
exec_caller \ | ||
fib \ | ||
out_of_memory \ | ||
print_log \ | ||
spawn_callee_strcat \ | ||
spawn_caller_strcat \ | ||
timenow | ||
|
||
ckb-c-stdlib: | ||
git clone https://github.com/nervosnetwork/ckb-c-stdlib | ||
cd ckb-c-stdlib | ||
git checkout d7dc1e3 | ||
cd .. | ||
|
||
always_failure: | ||
$(CC) -o $@ $@.c | ||
|
||
exec_callee: | ||
$(CC) -o $@ $@.c | ||
|
||
exec_caller: | ||
$(CC) -o $@ $@.c | ||
|
||
fib: | ||
$(CC) -o $@ $@.c | ||
|
||
out_of_memory: | ||
$(CC) -o $@ $@.c | ||
|
||
print_log: | ||
$(CC) -o $@ $@.c | ||
|
||
spawn_callee_strcat: | ||
$(CC) -o $@ $@.c | ||
|
||
spawn_caller_strcat: | ||
$(CC) -o $@ $@.c | ||
|
||
timenow: | ||
$(CC) -o $@ $@.c | ||
|
||
test: | ||
bash MakefileTest.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
set -ex | ||
|
||
ckb-debugger --mode decode-instruction 0x00054363 | ||
|
||
ckb-debugger --mode fast --bin always_failure 2>&1 | grep "ValidationFailure" | ||
ckb-debugger --mode full --bin always_failure 2>&1 | grep "Run result: 1" | ||
|
||
ckb-debugger --mode fast --tx-file exec.json --cell-index 0 --cell-type input --script-group-type lock | ||
ckb-debugger --mode full --tx-file exec.json --cell-index 0 --cell-type input --script-group-type lock | ||
|
||
ckb-debugger --mode fast --bin fib | ||
ckb-debugger --mode full --bin fib --pprof /tmp/fib.pprof | ||
ckb-debugger --mode full --bin fib --enable-overlapping-detection | ||
ckb-debugger --mode full --bin fib --enable-steplog | ||
ckb-debugger --mode fast --bin fib --max-cycles 100 2>&1 | grep "ExceededMaximumCycles" | ||
ckb-debugger --mode full --bin fib --max-cycles 100 2>&1 | grep "CyclesExceeded" | ||
|
||
ckb-debugger --mode fast --tx-file mock_tx.json --cell-index 0 --cell-type input --script-group-type lock | ||
ckb-debugger --mode full --tx-file mock_tx.json --cell-index 0 --cell-type input --script-group-type lock | ||
ckb-debugger --mode full --tx-file mock_tx.json --cell-index 0 --cell-type input --script-group-type lock --bin always_failure 2>&1 | grep "Run result: 1" | ||
|
||
ckb-debugger --mode fast --bin out_of_memory 2>&1 | grep "MemOutOfBound" | ||
ckb-debugger --mode full --bin out_of_memory 2>&1 | grep "MemOutOfBound" | ||
|
||
ckb-debugger --mode fast --bin print_log | ||
ckb-debugger --mode full --bin print_log | ||
|
||
ckb-debugger --mode fast --tx-file spawn.json --cell-index 0 --cell-type input --script-group-type lock | ||
ckb-debugger --mode full --tx-file spawn.json --cell-index 0 --cell-type input --script-group-type lock | ||
ckb-debugger --mode full --tx-file spawn.json --cell-index 0 --cell-type input --script-group-type lock --pid 0 --pprof /tmp/spawn.pprof | ||
ckb-debugger --mode full --tx-file spawn.json --cell-index 0 --cell-type input --script-group-type lock --pid 1 --pprof /tmp/spawn.pprof | ||
|
||
ckb-debugger --mode full --bin timenow |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "entry.h" | ||
|
||
int main() { | ||
return 1; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
file examples/exec_caller | ||
file exec_caller | ||
target remote 127.0.0.1:9999 | ||
b __internal_syscall | ||
c | ||
c | ||
file examples/exec_callee | ||
file exec_callee | ||
b _start | ||
c | ||
l |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "entry.h" | ||
|
||
int fib(int n) { | ||
if (n == 0 || n == 1) { | ||
return n; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#include "entry.h" | ||
|
||
const int n = 2; | ||
|
||
int a() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.