Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinlong-Wu committed Dec 21, 2023
1 parent d19ee8c commit 0d44b0f
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 9 deletions.
4 changes: 4 additions & 0 deletions riscv64_build_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cd src/tests
./build.sh -mono -debug riscv64 -ninja /p:KeepNativeSymbols=true -tree:JIT/

cd ../..
29 changes: 29 additions & 0 deletions src/mono/sample/TestRun/.gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR nostop print

define mono_backtrace
select-frame 0
set $i = 0
while ($i < $arg0)
set $foo = (char*) mono_pmip ($pc)
if ($foo)
printf "#%d %p in %s\n", $i, $pc, $foo
else
frame
end
up-silently
set $i = $i + 1
end
end

define mono_stack
set $mono_thread = mono_thread_current ()
if ($mono_thread == 0x00)
printf "No mono thread associated with this thread\n"
else
set $ucp = malloc (sizeof (ucontext_t))
call (void) getcontext ($ucp)
call (void) mono_print_thread_dump ($ucp)
call (void) free ($ucp)
end
end

17 changes: 9 additions & 8 deletions src/mono/sample/TestRun/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ TARGET_OS=linux
AOT?=false
QEMU=qemu-riscv64-static
SAMPLE_PATH=/home/wuxinlong/workspace/samples/csharp/getting-started/console-webapiclient
ANY_PATH= /home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.riscv64.Debug/JIT/jit64/regress/ddb/127931/127931/127931.dll
CORE_BASELINE_ROOT=/home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.x64.Debug/Tests/Core_Root
ANY_PATH= /home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.x64.Debug/JIT/Directed/Directed_3/Directed_3.dll

GitHubKey=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

#NET_TRACE_PATH=<path-to-trace-of-sample>
#PGO_BINARY_PATH=<path-to-dotnet-pgo-executable>
#MIBC_PROFILE_PATH=<path-to-mibc-for-sample>

MONO_ENV_DEBUG_OPTIONS = "-v"
MONO_ENV_DEBUG_OPTIONS = "-v --trace=all --break StrAccess1:Run"
MONO_ENV_RUN_OPTIONS=""

build: TestRun.cs
Expand All @@ -30,13 +31,13 @@ run-baseline: build
run-any-baseline:
COMPlus_DebugWriteToStdErr=1 \
MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \
$(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-x64/dotnet \
$(ANY_PATH)
CORE_ROOT=${CORE_BASELINE_ROOT} \
${CORE_BASELINE_ROOT}/corerun -p System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization=true $(ANY_PATH)

run: build
@COMPlus_DebugWriteToStdErr=1 \
MONO_ENV_OPTIONS=$(MONO_ENV_RUN_OPTIONS) \
$(QEMU) -L $(TOP)/.tools/rootfs/riscv64/ $(TOP)artifacts/bin/testhost/net8.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet TestRun.exe
$(QEMU) -L $(TOP)/.tools/rootfs/riscv64/ $(TOP)artifacts/bin/testhost/net9.0-$(TARGET_OS)-Debug-$(MONO_ARCH)/dotnet TestRun.exe

run-any:
COMPlus_DebugWriteToStdErr=1 \
Expand Down Expand Up @@ -90,8 +91,8 @@ debug-any:
-iex "add-auto-load-safe-path /home/wuxinlong/workspace/runtime/src/mono/sample/TestRun/" \
-ex "set sysroot $(TOP).tools/rootfs/riscv64" \
-ex "set solib-search-path ${CORE_ROOT}" \
-ex "b mini.c:2161" \
-ex "handle SIG35 print nostop ignore" \
-ex "b mono_break" \
-ex "handle SIGXCPU SIG33 SIG35 SIG36 SIG37 SIG38 SIGPWR print nostop ignore" \
${CORE_ROOT}/corerun

remote_gdb:
Expand Down Expand Up @@ -130,6 +131,6 @@ clean:

# ROOTFS_DIR="" ./build.sh mono+libs+host -c Debug --ninja /p:KeepNativeSymbols=true
# ./build.sh mono+libs+host+clr.host -c Debug --cross --arch riscv64 --ninja /p:KeepNativeSymbols=true --build

# CORT_ROOT=/home/wuxinlong/workspace/runtime/artifacts/tests/coreclr/linux.x64.Debug
# ./build.sh -mono -debug riscv64 -ninja /p:KeepNativeSymbols=true
# ./build.sh clr.hosts --cross --arch riscv64 --ninja /p:KeepNativeSymbols=true
23 changes: 23 additions & 0 deletions src/mono/sample/TestRun/TestRun.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// C# Hello World

using System;

public class Test
{
public static void TestRun()
{
int i;
int len = 50;
var rand = new Random();
while (len != 0)
{
i = rand.Next(0, 1);
len /= 2;
}
}

public static void Main()
{
TestRun();
}
}
2 changes: 1 addition & 1 deletion src/tests/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ def run_tests(args,
"""

# Set default per-test timeout to 2 minutes (in milliseconds).
per_test_timeout = 2*60*1000
per_test_timeout = 4*60*1000

# Setup the environment
if args.long_gc:
Expand Down

0 comments on commit 0d44b0f

Please sign in to comment.