Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d41bd12
feat(starry-kernel): x86_64 ptrace register r/w and PTRACE_SINGLESTEP…
May 31, 2026
546d443
feat(starry): add gdb smoke test app and update mount-umount2 compat …
May 31, 2026
2001d49
fix(starry-kernel): gate #DB handler behind #[cfg(target_arch = "x86_…
May 31, 2026
6f89581
test(starryos): extend gdb batch timeout
May 31, 2026
cf73381
test(starryos): isolate gdb apk install stage
May 31, 2026
abe822b
fix(starry-kernel): harden x86_64 ptrace reg writes
Jun 2, 2026
a604631
fix(starryos): bundle gdb runtime for batch test
Jun 2, 2026
70ed6ec
fix(apps): replace docker-run gdb install with qemu-user + native apk
Jun 2, 2026
bd39581
fix(apps): use musl ld directly instead of qemu-user for same-arch x8…
Jun 2, 2026
e49f15d
fix(apps): fix gdb app prebuild with musl ld and complete runtime assets
Jun 2, 2026
7df142f
fix(apps): enable virtio-blk and virtio-net drivers for gdb app
Jun 2, 2026
c98b513
fix(apps): add missing virtio-gpu, virtio-input, virtio-socket features
Jun 2, 2026
d517d01
fix(axbuild): handle symlinks in overlay injection via debugfs
Jun 2, 2026
1b73808
chore(ci): trigger re-run
Jun 2, 2026
4d68178
chore(ci): trigger re-run 2
Jun 2, 2026
052e3b0
fix(starry-kernel): add x86_64 ptrace FP register support (GETFPREGS/…
Jun 3, 2026
cc91ae0
fix(axbuild): swap debugfs symlink args to link-path-first order
Jun 4, 2026
4936b93
fix(starry-kernel): detach live tracees when tracer exits
Jun 5, 2026
0e9bd47
fix(starry-kernel): align x86 ptrace fp snapshots
Jun 5, 2026
d06ce5d
fix(starry-kernel): stabilize x86 native gdb ptrace flow
Jun 5, 2026
73bb8dd
fix(starry-kernel): clean up ptrace gdb follow-up fixes
Jun 5, 2026
6c74709
fix(starry-mm): fix file_read_offset computation for unaligned COW split
Jun 5, 2026
d501b87
fix(starry-kernel): fix clippy manual_is_multiple_of warning
Jun 5, 2026
59eb698
fix(starry-mm): extend file_end to cover PT_TLS init image and add ex…
Jun 5, 2026
b75339d
fix(starry-mm): add AT_NULL auxv terminator to prevent ldso out-of-bo…
Jun 5, 2026
8119073
chore(ci): re-trigger CI
Jun 5, 2026
bef54ec
test(starry): add SIGSEGV detection to board test fail_regex patterns
Jun 6, 2026
9c2fa59
chore(ci): re-trigger CI after rustc segfault flake
Jun 6, 2026
7176e13
fix(starry-mm): add AT_NULL auxv terminator and execve/loader diagnos…
Jun 6, 2026
7f229da
fix(starry-mm): flush I-cache after populating executable pages on ri…
Jun 6, 2026
0ac9325
fix(starry-mm): write back D-cache after populating executable pages …
Jun 6, 2026
4acf7e4
chore(starry-mm): dump full auxv and entry bytes for SG2002 crash triage
Jun 6, 2026
932e49e
fix(starry-mm): read unaligned COW segment first page from correct fi…
Jun 6, 2026
d6472d7
chore(ci): trigger CI after sync with main
Jun 6, 2026
3a74f52
chore(starry): add proc maps area diagnostics for bug-proc-maps-lseek…
Jun 7, 2026
0706148
fix(starry): fix bug-proc-maps-lseek-refresh test failure
Jun 7, 2026
acf9926
fix: resolve merge conflicts with upstream/dev PR #1167
Jun 8, 2026
6f8c72b
fix: complete per-TID ptrace API migration and execve stop semantics
Jun 8, 2026
0c49be9
fix(starry-kernel): correct x86_64 ptrace single-step, exec-stop and …
Jun 9, 2026
89da2a7
test(starry): convert test-gdb-native-batch to a raw-ptrace tracer
Jun 9, 2026
6203978
test(starry): migrate x86 ptrace/gdb cases into grouped system and fi…
Jun 10, 2026
3be29fd
chore(ci): re-trigger CI after roc-rk3568 board u-boot flake
Jun 10, 2026
ad7a381
ci: trigger test run
Jun 10, 2026
9f82a3b
ci: trigger test run
Jun 11, 2026
84fd212
chore: remove accidentally committed internal ptrace/gdb reports
Jun 11, 2026
6a52a09
fix(axbuild): tolerate slow guests in host HTTP test server
Jun 11, 2026
de4d22a
test(starry): wire x86 ptrace/gdb cases into grouped system runner
Jun 11, 2026
3b6514b
fix(starry-kernel): rebase x86_64 ptrace onto upstream/dev per-tid ba…
Jun 17, 2026
589c680
fix(starry-kernel): store full FxsaveArea in x86_64 PtraceStopFpData
Jun 17, 2026
070f2b0
fix(starry): downgrade loader/execve logs to debug, restore kernel #D…
Jun 17, 2026
c06dc18
test(starry): add x86_64 ptrace FP register coverage
Jun 17, 2026
3024d98
fix(starry-kernel): remove duplicate ptrace_setregset_prstatus, fix a…
Jun 17, 2026
9de4ef1
chore: fmt execve.rs register call
Jun 17, 2026
13b9c05
fix(starry-kernel): remove unused VirtAddr and DirectRwFsFileOps impo…
Jun 17, 2026
d776c4b
chore: fmt proc.rs import line
Jun 17, 2026
1cd347f
fix(starry-kernel): gate format_statm/format_status_vm_lines with cfg…
Jun 17, 2026
6f88897
fix(starry-kernel): gate alloc::format import with cfg(test)
Jun 17, 2026
9f263d9
chore: reorder stats.rs imports for fmt
Jun 17, 2026
9ba1caa
Merge branch 'dev' into feat/x86_64-ptrace-clean
54dK3n Jun 17, 2026
1f30182
fix(starry-kernel): scope ptrace get/setfpregs cfg to all non-x86 arches
Jun 17, 2026
830ad84
fix(starry-kernel): restore /proc features dropped by a bad merge revert
Jun 17, 2026
b6e779e
fix(axbuild): restore upstream overlay symlink injection
Jun 17, 2026
5bfaddf
fix(starry-kernel): un-gate ProcessMemStats format methods for /proc
Jun 17, 2026
55ec2db
chore: remove accidentally committed GitHub page snapshot
Jun 18, 2026
356fadf
fix(starry): use STARRY_ROOTFS in gdb app prebuild
Jun 18, 2026
493f6b1
refactor(starry-kernel): converge x86_64 GP registers into ArchUserRe…
Jun 18, 2026
ba2cbe4
Merge remote-tracking branch 'upstream/dev' into feat/x86_64-ptrace-c…
Jun 18, 2026
d9ba075
fix(starry): use dynamic platform for gdb x86_64 app build config
Jun 18, 2026
66ddbf9
Merge remote-tracking branch 'upstream/dev' into feat/x86_64-ptrace-c…
Jun 18, 2026
72ba812
chore(repo): remove unused workspace crates (#1306)
ZR233 Jun 18, 2026
bacb178
feat(axbuild): internalize Starry kallsyms flow (#1309)
ZR233 Jun 18, 2026
ec6faa7
fix(ci): bump smoke-vmx QEMU timeout 180→600s for self-hosted KVM run…
Lfan-ke Jun 18, 2026
9f46b1e
fix(starry): correct x86_64 u_debugreg offset in struct user
Jun 20, 2026
867b09d
feat(gdb-smoke): port GDB and gdbserver smoke to x86_64
Jun 20, 2026
d035b37
Merge branch 'dev' into feat/gdb-smoke-x86_64-native
54dK3n Jun 21, 2026
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
49 changes: 45 additions & 4 deletions apps/starry/gdb-smoke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This app prepares an Alpine rootfs overlay with guest `gdb`, `gdbserver`, and
tiny target programs for StarryOS user-space debugger smoke testing. The native
GDB smoke and the single-process gdbserver smoke are available on riscv64,
aarch64, and loongarch64.
aarch64, loongarch64, and x86_64.

## Batch Native GDB Smoke

Expand All @@ -25,6 +25,12 @@ For the current LoongArch native GDB baseline:
cargo xtask starry app qemu -t gdb-smoke --arch loongarch64
```

For the current x86_64 native GDB baseline:

```bash
cargo xtask starry app qemu -t gdb-smoke --arch x86_64
```

The batch script runs:

```gdb
Expand Down Expand Up @@ -129,6 +135,13 @@ cargo xtask starry app qemu -t gdb-smoke --arch loongarch64 \
--qemu-config qemu-loongarch64-gdbserver.toml
```

For x86_64:

```bash
cargo xtask starry app qemu -t gdb-smoke --arch x86_64 \
--qemu-config qemu-x86_64-gdbserver.toml
```

The default gdbserver script connects to `127.0.0.1:1234`, breaks on
`compute_value`, prints a backtrace, deletes the breakpoint, and continues the
remote target.
Expand Down Expand Up @@ -186,6 +199,13 @@ cargo xtask starry app qemu -t gdb-smoke --arch loongarch64 \
--qemu-config qemu-loongarch64-gdbserver-manual.toml
```

For x86_64:

```bash
cargo xtask starry app qemu -t gdb-smoke --arch x86_64 \
--qemu-config qemu-x86_64-gdbserver-manual.toml
```

When running through the long-lived Docker container, keep stdin and a TTY
attached:

Expand Down Expand Up @@ -228,10 +248,17 @@ gdb-multiarch -q -x apps/starry/gdb-smoke/gdbserver/host-manual-loongarch64.gdb
target/gdb-smoke-host/loongarch64/gdbserver-smoke-target
```

For x86_64:

```bash
gdb-multiarch -q -x apps/starry/gdb-smoke/gdbserver/host-manual-x86_64.gdb \
target/gdb-smoke-host/x86_64/gdbserver-smoke-target
```

`host-manual.gdb` sets the riscv64 remote debugging defaults and connects to
`:1234`; `host-manual-aarch64.gdb` and `host-manual-loongarch64.gdb` do the
same for aarch64 and LoongArch. All scripts leave you at the GDB prompt for
manual commands.
`:1234`; `host-manual-aarch64.gdb`, `host-manual-loongarch64.gdb`, and
`host-manual-x86_64.gdb` do the same for aarch64, LoongArch, and x86_64. All
scripts leave you at the GDB prompt for manual commands.

Inside host GDB:

Expand Down Expand Up @@ -270,6 +297,13 @@ cargo xtask starry app qemu -t gdb-smoke --arch loongarch64 \
--qemu-config qemu-loongarch64-gdbserver-host.toml
```

For x86_64:

```bash
cargo xtask starry app qemu -t gdb-smoke --arch x86_64 \
--qemu-config qemu-x86_64-gdbserver-host.toml
```

This automatic config starts guest `gdbserver` for you and is intended for
repeatable logs rather than manual interaction.

Expand All @@ -294,4 +328,11 @@ gdb-multiarch -q -batch -x apps/starry/gdb-smoke/gdbserver/host-remote-loongarch
target/gdb-smoke-host/loongarch64/gdbserver-smoke-target
```

For x86_64:

```bash
gdb-multiarch -q -batch -x apps/starry/gdb-smoke/gdbserver/host-remote-x86_64.gdb \
target/gdb-smoke-host/x86_64/gdbserver-smoke-target
```

`-batch` runs the scripted host GDB flow and exits after the marker output.
9 changes: 9 additions & 0 deletions apps/starry/gdb-smoke/build-x86_64-unknown-none.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
features = [
"ax-driver/virtio-blk",
"ax-driver/virtio-net",
"ax-driver/virtio-gpu",
"ax-driver/virtio-input",
"ax-driver/virtio-socket",
]
log = "Warn"
target = "x86_64-unknown-none"
10 changes: 10 additions & 0 deletions apps/starry/gdb-smoke/gdbserver/host-manual-x86_64.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set pagination off
set confirm off
set debuginfod enabled off
set architecture i386:x86-64
set sysroot /
set solib-search-path /lib:/usr/lib
set remotetimeout 10
set remote hostio-open-packet off
set remote hostio-pread-packet off
target remote :1234
18 changes: 18 additions & 0 deletions apps/starry/gdb-smoke/gdbserver/host-remote-x86_64.gdb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set pagination off
set confirm off
set debuginfod enabled off
set architecture i386:x86-64
set sysroot /
set solib-search-path /lib:/usr/lib
set remotetimeout 10
set remote hostio-open-packet off
set remote hostio-pread-packet off
target remote :1234
echo HOST_GDB_REMOTE_CONNECTED\n
break compute_value
continue
bt
echo HOST_GDB_REMOTE_BT_DONE\n
detach
echo HOST_GDB_REMOTE_DETACH_DONE\n
quit
16 changes: 16 additions & 0 deletions apps/starry/gdb-smoke/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ qemu_runner=""
linux_target=""
lld_linker=""
lld_linker_dir=""
gcc_install_dir=""

require_env() {
local name="$1"
Expand Down Expand Up @@ -76,6 +77,10 @@ find_qemu_runner() {
qemu_name=qemu-loongarch64
linux_target=loongarch64-linux-musl
;;
x86_64)
qemu_name=qemu-x86_64
linux_target=x86_64-linux-musl
;;
*)
echo "error: unsupported gdb-smoke arch: $arch" >&2
exit 1
Expand Down Expand Up @@ -112,6 +117,14 @@ run_guest_apk_with_retry() {
done
}

find_gcc_install_dir() {
gcc_install_dir="$(find "$staging_root/usr/lib/gcc" -name 'crtbeginT.o' -exec dirname {} \; 2>/dev/null | head -1)"
if [[ -z "$gcc_install_dir" ]]; then
echo "error: could not locate GCC crt objects in staging root" >&2
exit 1
fi
}

install_guest_packages() {
local guest_apk="$staging_root/sbin/apk"

Expand Down Expand Up @@ -149,6 +162,8 @@ compile_target() {
--target="$linux_target" \
--sysroot="$staging_root" \
--gcc-toolchain="$staging_root/usr" \
-B"$gcc_install_dir" \
-L"$gcc_install_dir" \
--ld-path="$lld_linker" \
-static \
"$@" \
Expand Down Expand Up @@ -272,4 +287,5 @@ ensure_host_packages
extract_base_rootfs
find_qemu_runner
install_guest_packages
find_gcc_install_dir
populate_overlay
27 changes: 27 additions & 0 deletions apps/starry/gdb-smoke/qemu-x86_64-gdbserver-host.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
args = [
"-nographic",
"-m", "512M",
"-cpu", "max",
"-device", "virtio-blk-pci,drive=disk0",
"-drive", "id=disk0,if=none,format=raw,file=${workspace}/tmp/axbuild/rootfs/rootfs-x86_64-alpine.img",
"-device", "virtio-net-pci,netdev=net0",
"-netdev", "user,id=net0,hostfwd=tcp::1234-:1234",
]
uefi = false
to_bin = false
shell_prefix = "root@starry:"
shell_init_cmd = "gdbserver 0.0.0.0:1234 /usr/bin/gdbserver-smoke-target; echo __HOST_REMOTE_GDBSERVER_DONE__"
success_regex = [
"(?m)^__HOST_REMOTE_GDBSERVER_DONE__$",
]
fail_regex = [
'(?i)\bpanic(?:ked)?\b',
'(?m)FAIL',
'gdbserver: not found',
'Cannot insert breakpoint',
'Remote communication error',
'ptrace: Function not implemented',
'Program received signal SIGSEGV',
'(?i)Segmentation fault',
]
timeout = 240
19 changes: 19 additions & 0 deletions apps/starry/gdb-smoke/qemu-x86_64-gdbserver-manual.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
args = [
"-nographic",
"-m", "512M",
"-cpu", "max",
"-device", "virtio-blk-pci,drive=disk0",
"-drive", "id=disk0,if=none,format=raw,file=${workspace}/tmp/axbuild/rootfs/rootfs-x86_64-alpine.img",
"-device", "virtio-net-pci,netdev=net0",
"-netdev", "user,id=net0,hostfwd=tcp::1234-:1234",
]
uefi = false
to_bin = false
shell_prefix = "root@starry:"
success_regex = []
fail_regex = [
'(?i)\bpanic(?:ked)?\b',
'(?m)FAIL',
'gdbserver: not found',
]
timeout = 0
28 changes: 28 additions & 0 deletions apps/starry/gdb-smoke/qemu-x86_64-gdbserver.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
args = [
"-nographic",
"-m", "512M",
"-cpu", "max",
"-device", "virtio-blk-pci,drive=disk0",
"-drive", "id=disk0,if=none,format=raw,file=${workspace}/tmp/axbuild/rootfs/rootfs-x86_64-alpine.img",
"-device", "virtio-net-pci,netdev=net0",
"-netdev", "user,id=net0",
]
uefi = false
to_bin = false
shell_prefix = "root@starry:"
shell_init_cmd = "/usr/bin/gdbserver-smoke.sh"
success_regex = ["GDBSERVER_SMOKE_DONE"]
fail_regex = [
'(?i)\bpanic(?:ked)?\b',
'(?m)FAIL',
'gdb: not found',
'Python Exception',
'Python initialization failed',
'Cannot insert breakpoint',
'Remote communication error',
'ptrace: Function not implemented',
'No stack',
'Program received signal SIGSEGV',
'(?i)Segmentation fault',
]
timeout = 180
25 changes: 25 additions & 0 deletions apps/starry/gdb-smoke/qemu-x86_64.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
args = [
"-nographic",
"-m", "512M",
"-cpu", "max",
"-device", "virtio-blk-pci,drive=disk0",
"-drive", "id=disk0,if=none,format=raw,file=${workspace}/tmp/axbuild/rootfs/rootfs-x86_64-alpine.img",
"-device", "virtio-net-pci,netdev=net0",
"-netdev", "user,id=net0",
]
uefi = false
to_bin = false
shell_prefix = "root@starry:"
shell_init_cmd = "/usr/bin/gdb -q -batch -x /usr/bin/gdb-native-smoke.gdb /usr/bin/gdb-native-smoke-target"
success_regex = ["GDB_NATIVE_SMOKE_DONE"]
fail_regex = [
'(?i)\bpanic(?:ked)?\b',
'(?m)FAIL',
'gdb: not found',
'Python Exception',
'Python initialization failed',
'Cannot insert breakpoint',
'ptrace: Function not implemented',
'No stack',
]
timeout = 120
2 changes: 1 addition & 1 deletion os/StarryOS/kernel/src/syscall/task/ptrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2163,7 +2163,7 @@ fn loongarch_unpack_fcc(packed: u64) -> [u8; 8] {
// ---------------------------------------------------------------------------

#[cfg(target_arch = "x86_64")]
const X86_64_USER_DEBUGREG_OFFSET: usize = 912;
const X86_64_USER_DEBUGREG_OFFSET: usize = 848;
#[cfg(target_arch = "x86_64")]
const X86_64_USER_DEBUGREG_COUNT: usize = 8;
#[cfg(target_arch = "x86_64")]
Expand Down