adjust the amount of diligence given into shooting stuff down
This commit is contained in:
parent
25be2fb0d4
commit
efcf450182
|
@ -81,48 +81,10 @@ BLE_info_table:
|
|||
cell 0
|
||||
BLE_code:
|
||||
# if we hit this, we've got a pure loop in a program, and it is never
|
||||
# going to actually progress. So let's just shoot it down with a
|
||||
# helpful message or so.
|
||||
mov 010(%rbp), %r15
|
||||
|
||||
mov $1, %rdi #stdout
|
||||
|
||||
mov $14, %rdx
|
||||
mov $BLE_msg, %rsi
|
||||
mov $1, %rax #write
|
||||
syscall
|
||||
|
||||
mov $1, %rdx
|
||||
BLE_loop:
|
||||
mov %r15, %rcx
|
||||
and $0xf, %rcx
|
||||
mov $BLE_hex, %rsi
|
||||
add %rcx, %rsi
|
||||
mov $1, %rax
|
||||
syscall
|
||||
shr $4, %r15
|
||||
jnz BLE_loop
|
||||
|
||||
mov $BLE_nl, %rsi
|
||||
mov $1, %rax
|
||||
syscall
|
||||
|
||||
# shot self down (and retry if it doesn't succeed)
|
||||
BLE_retry_sigkill:
|
||||
mov $39, %rax
|
||||
syscall # getpid
|
||||
mov %rax, %rdi
|
||||
mov $6, %rsi # SIGABRT
|
||||
mov $62, %rax # kill
|
||||
syscall
|
||||
jmp BLE_retry_sigkill
|
||||
|
||||
BLE_msg:
|
||||
.ascii "diverged at 0x"
|
||||
BLE_hex:
|
||||
.ascii "0123456789abcdef"
|
||||
BLE_nl:
|
||||
.ascii "\n"
|
||||
# going to actually progress. So let's just shoot it down.
|
||||
mov 0, %rax
|
||||
jmp BLE_code
|
||||
# this might eventually generate an actual IO-style exception or something.
|
||||
|
||||
# List
|
||||
# | ptr | 0 | # [] case
|
||||
|
|
|
@ -6,5 +6,8 @@ _main_exit_s_file:
|
|||
mov 010(%rsi), %rdi # result INT goes to syscall exitcode
|
||||
mov $60, %rax # exit=60
|
||||
syscall # exit %rdi
|
||||
# syscall might also die; at that point let's die more elaborately
|
||||
mov 0, %rax
|
||||
jmp main_exit
|
||||
|
||||
.endif # _main_exit_s_file
|
||||
|
|
Loading…
Reference in a new issue