[前][次][番号順一覧][スレッド一覧]

ruby-changes:68628

From: Maxime <ko1@a...>
Date: Thu, 21 Oct 2021 08:11:08 +0900 (JST)
Subject: [ruby-changes:68628] e5751768ba (master): Added int3() to x86 asm

https://git.ruby-lang.org/ruby.git/commit/?id=e5751768ba

From e5751768baeb7c1e0a48c466c98014667058d2c3 Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Wed, 14 Oct 2020 13:48:26 -0400
Subject: Added int3() to x86 asm

---
 ujit_asm.c | 7 +++++++
 ujit_asm.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/ujit_asm.c b/ujit_asm.c
index 7846179dcc..c99ad37d66 100644
--- a/ujit_asm.c
+++ b/ujit_asm.c
@@ -909,6 +909,13 @@ void cqo(codeblock_t* cb) https://github.com/ruby/ruby/blob/trunk/ujit_asm.c#L909
     cb_write_bytes(cb, 2, 0x48, 0x99);
 }
 
+/// Interrupt 3 - trap to debugger
+void int3(codeblock_t* cb)
+{
+    //cb.writeASM("INT 3");
+    cb_write_byte(cb, 0xCC);
+}
+
 /*
 // div - Unsigned integer division
 alias div = writeRMUnary!(
diff --git a/ujit_asm.h b/ujit_asm.h
index aeb6023e70..73a7d8153e 100644
--- a/ujit_asm.h
+++ b/ujit_asm.h
@@ -285,6 +285,7 @@ void cmovz(codeblock_t* cb, x86opnd_t dst, x86opnd_t src); https://github.com/ruby/ruby/blob/trunk/ujit_asm.h#L285
 void cmp(codeblock_t* cb, x86opnd_t opnd0, x86opnd_t opnd1);
 void cdq(codeblock_t* cb);
 void cqo(codeblock_t* cb);
+void int3(codeblock_t* cb);
 void ja(codeblock_t* cb, size_t label_idx);
 void jae(codeblock_t* cb, size_t label_idx);
 void jb(codeblock_t* cb, size_t label_idx);
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]