Commit Graph
780 Commits
Author SHA1 Message Date
xwings 206b90fd89 minor refactor and pypi fix 2026-09-05 16:57:28 +08:00
retrocpugeekandClaude Opus 5 a13a8c8c1f gdb: accept vCont C/S actions carrying any signal
A client that resumes while a signal is pending sends a vCont action of the
form 'C<sig>' (continue and deliver) or 'S<sig>' (step and deliver), e.g.
'vCont;S0f:pa410.1996;c:pa410.-1' -- the exact packet reported in issue
#1377. handle_v matched only 'c'/'C05' and 's'/'S05', so any other signal
fell through to an empty reply and clients aborted the session with
'Invalid remote reply:'.

We do not deliver host signals to the guest, so the signal value carries no
meaning for us: accept any of them and carry the action out as a plain
resume or step, which is what the client asked for. This matters more now
that the stub can stop with SIGINT on an async interrupt, since a client
may well resume from such a stop with 'C02'.

Also stop assuming os.exit_code exists when reporting termination: bare-metal
os layers (QlOsMcu) do not define it, which turns the exit path into an
AttributeError (seen in issue #1276). The underlying MCU interrupt handling
of #1276 is out of scope here.

Add a regression test asserting the '#1377' packet is answered with a
SIGTRAP stop-reply and that a signalled continue runs the guest to
termination; both replies are empty without the fix.

Fixes #1377

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-08-23 22:15:04 +10:00
retrocpugeekandClaude Opus 4.8 c5a8a9b73e gdb: support async interrupt (ctrl-c) to break into a running guest
The stub drove continue by calling emu_start synchronously and only read
the socket again once the target stopped on its own, so the bare \x03 break
byte a client sends to pause a running target was never seen. A guest that
free-runs (e.g. an idle/event loop) could not be interrupted at all --
gdb/Ghidra reported 'Cannot execute this command while the target is running'.

Poll the client socket for the break byte from the per-instruction run hook
(dbg_hook), which does run on the emulation thread during emu_start:

- GdbSerialConn.poll_interrupt(): non-blocking select+recv, True on \x03.
- QlGdbUtils.dbg_hook: throttled (every INTR_POLL_INTERVAL insns) check of an
  installed check_interrupt callback; on a break, stop emulation and record it.
- handle_c: reply SIGINT when the stop was an interrupt rather than a
  breakpoint or normal exit.

Add a regression test that lets an infinite-loop guest free-run, sends the
bare break byte and asserts the stop-reply is 'S02' (SIGINT). Without the
fix no reply ever arrives, so the test stops the guest itself and fails
rather than hanging the run.

Also verified against a free-running MIPS64 BE guest: \x03 -> S02 in <1ms.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-08-23 22:14:50 +10:00
retrocpugeekandClaude Opus 4.8 de34db212d gdb: report SIGTRAP (not SIGTERM) on single-step
handle_s answered every single-step ('s') with a SIGTERM stop-reply
whenever ql.emu_state was QL_STATE.STOPPED. But emu_start always leaves
the state STOPPED after running the requested step count, so the guard
was true on every step and gdb clients saw a spurious termination signal,
disconnecting mid-debug (issues #1377, #1538).

Give handle_s the same exit-vs-trap discrimination handle_c already uses:
a step reports SIGTRAP unless it carried pc to the emulation exit point,
in which case the guest has actually terminated and we reply W{exit_code}.
Also wrap the step in the same UcError/KeyboardInterrupt handling as
handle_c so a fault while stepping maps to a signal instead of crashing
the stub, and hoist the shared uc-error->signal map to a module constant.

Add a regression test that single-steps over the gdb stub and asserts the
stop-reply is 'S05' (SIGTRAP), which fails as 'S0f' (SIGTERM) without the fix.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-07 22:28:08 +10:00
xwings 486369d375 better New SYSCALL_EX IPC message, FD arg type and Forwarder closure 2026-04-27 21:52:49 +08:00
xwings cb875f8488 more qiling style. update logging and exception 2026-04-12 16:48:53 +08:00
xwings 5ed49e7dcb Merge branch 'qilingframework:dev' into dev 2026-04-11 23:04:43 +08:00
xwings 30eba376fc Add TODO.md, ARCHITECTURE.md. Update README.md. and add kernel proxy 2026-04-11 22:48:18 +08:00
libumem 3675f557e9 Address @elicn feedback 2025-11-16 18:19:20 +00:00
libumem 4448d4c129 Remove stray PDB invocation 2025-11-15 01:57:40 +00:00
libumem a76b858332 Tentative fix for epoll server test case 2025-11-14 04:39:15 +00:00
libumem 2ecd1d924a Merge branch 'qilingframework:dev' into dev 2025-11-12 20:23:27 -05:00
elicn 147ec7c18c Make Windows compatible to latest image 2025-10-29 14:43:10 +02:00
technikelly 04236d77b1 enabling test and updating rootfs submodule 2025-08-27 11:26:39 -04:00
technikelly 5ec4a3b57a addressing review comments, removing copyright notices 2025-08-25 13:34:45 -04:00
technikelly 6d697b5d7f updating copyright statements with license info 2025-08-20 15:12:54 -04:00
technikelly 81c2a39f1f minimizing blob changes 2025-08-20 14:55:37 -04:00
technikelly d3cc47dc7f adding support for raw binary blobs 2025-08-12 10:55:50 -04:00
elicn 7088d22a73 Allow tests to import relatively 2025-07-06 18:44:59 +03:00
elicn d2b4867f21 Adjust test and example 2025-07-06 18:23:36 +03:00
elicn 327f475ba3 Decouple BLOB entry point and load address 2025-07-06 18:23:07 +03:00
libumem aefef5ffaf Disable test case, for now 2025-06-23 23:40:35 +00:00
libumem d5b51dd724 Remove dup'd comment, locally tested fix for error during ELFTest suite 2025-06-22 23:57:28 +00:00
libumem fdfec5b6d1 Attempt #1 to fix test case root 2025-06-17 22:39:45 +00:00
libumem 92e43a3552 Fix glibc issue with new test root 2025-06-04 00:40:36 +00:00
libumem 5ad49c0fdc Revert "Revert "Fix root for test case""
This reverts commit 4d0b939da5.
2025-06-02 23:37:38 +00:00
libumem 4d0b939da5 Revert "Fix root for test case"
This reverts commit 47c3df1eb5.
2025-06-02 23:27:36 +00:00
libumem 47c3df1eb5 Fix root for test case 2025-05-16 02:23:58 +00:00
libumem 265406eb08 Merge branch 'dev' into libumem-epoll-fixes 2025-05-07 19:51:43 -04:00
libumem 90df05f7a6 Merge branch 'qilingframework:dev' into dev 2025-05-06 21:06:50 -04:00
xwings d614855e78 Merge pull request #1552 from sakura57/dev
Various fixes and improvements for Windows emulation
2025-05-06 10:27:20 +08:00
elicn 5a87323df3 Tidy up tests 2025-04-30 13:52:40 +03:00
libumem 74380b26d5 Address a few elicn comments, fix root for server test 2025-04-30 00:18:41 +00:00
libumem f2861b7f38 Nominally working epoll server test 2025-04-26 16:36:05 +00:00
libumem fd32154ca1 Begin working on test issues 2025-04-26 03:38:56 +00:00
libumem 033fb4b4bc Address PR comments 2025-04-26 01:50:44 +00:00
libumem c6eee99422 Add socket import back, was not supposed to be removed 2025-04-25 02:07:36 +00:00
libumem 290f11671a Begin fixing this PR 2025-04-25 02:03:53 +00:00
libumem f79d17937d Merge branch 'qilingframework:dev' into dev 2025-04-21 20:33:00 -04:00
libumem 2479b912bc Flesh out tests, clean up 2025-04-07 21:03:00 +00:00
libumem e208a34520 Skeleton for graph 2025-04-04 03:13:05 +00:00
libumem 1f12da52c4 Add del ql 2025-04-04 03:10:22 +00:00
libumem 18381f42a3 Simple test case 2025-04-04 03:07:09 +00:00
elicn 135e7138c7 Rename show command to info 2025-04-01 18:59:28 +03:00
elicn 83da808597 Enable show sub-commands 2025-03-31 14:55:56 +03:00
Jacob Farnsworth 7dd9fcdc74 Add C++ runtime and exception-related tests 2025-03-30 21:27:53 +02:00
elicn c1d13e647a Add ARM static test 2025-03-09 20:05:49 +02:00
elicn c435e3a43c Improve test scripts 2025-03-09 20:02:14 +02:00
elicn 7323a32a06 Refactor qdb tests 2025-03-09 20:01:43 +02:00
elicn ce6ffaf1f7 QDB revamp 2025-03-08 21:48:17 +02:00