Skip to content

Commit 96901db

Browse files
committed
Add a builtin "signal(SIG)" patch.
Causes SIG to be raised in the calling thread. E.g.: e9tool -M ... -P 'signal(2)' ...
1 parent c619b0f commit 96901db

10 files changed

Lines changed: 420 additions & 300 deletions

File tree

doc/e9tool-user-guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,7 @@ the following high-level grammar:
823823
| <b>break</b>
824824
| <b>trap</b>
825825
| <b>exit(</b>CODE<b>)</b>
826+
| <b>signal(</b>SIG<b>)</b>
826827
| <b>print</b>
827828
| CALL
828829
| <b>if</b> CALL <b>break</b>
@@ -851,6 +852,8 @@ The builtin trampolines include:
851852
<td>Execute a TRAP (<tt>int3</tt>) instruction</td></tr>
852853
<tr><td><b><tt>exit(CODE)</tt></b></td>
853854
<td>Exit with <tt>CODE</tt></td></tr>
855+
<tr><td><b><tt>signal(SIG)</tt></b></td>
856+
<td>Raise signal <tt>SIG</tt></td></tr>
854857
<tr><td><b><tt>print</tt></b></td>
855858
<td>Printing the matching instruction</td></tr>
856859
</table>
@@ -864,6 +867,8 @@ Here:
864867
program.
865868
* `trap` executes a single TRAP (`int3`) instruction.
866869
* `exit(CODE)` will immediately exit from the program with status `CODE`.
870+
* `signal(SIG)` will raise signal `SIG` in the current thread
871+
(equivalent to `kill(gettid(), SIG)`).
867872
* `print` will print the assembly representation of the matching
868873
instruction to `stderr`.
869874
This can be used for testing and debugging.

0 commit comments

Comments
 (0)