Class: Ragweed::Debuggertux::Breakpoint
- Defined in:
- lib/ragweed/debuggertux.rb
Overview
Class to handle installing/uninstalling breakpoints
Constant Summary collapse
- INT3 =
0xCC
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#bppid ⇒ Object
Returns the value of attribute bppid.
-
#function ⇒ Object
Returns the value of attribute function.
-
#installed ⇒ Object
Returns the value of attribute installed.
-
#orig ⇒ Object
Returns the value of attribute orig.
Instance Method Summary collapse
- #call(*args) ⇒ Object
-
#initialize(ip, callable, p, name = "") ⇒ Breakpoint
constructor
ip: insertion point callable: lambda to be called when breakpoint is hit p: process ID name: name of breakpoint.
- #install ⇒ Object
- #installed? ⇒ Boolean
- #uninstall ⇒ Object
Constructor Details
#initialize(ip, callable, p, name = "") ⇒ Breakpoint
ip: insertion point callable: lambda to be called when breakpoint is hit p: process ID name: name of breakpoint
30 31 32 33 34 35 36 37 38 |
# File 'lib/ragweed/debuggertux.rb', line 30 def initialize(ip, callable, p, name = "") @bppid = p @function = name @addr = ip @callable = callable @installed = false @exited = false @orig = 0 end |
Instance Attribute Details
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
24 25 26 |
# File 'lib/ragweed/debuggertux.rb', line 24 def addr @addr end |
#bppid ⇒ Object
Returns the value of attribute bppid.
23 24 25 |
# File 'lib/ragweed/debuggertux.rb', line 23 def bppid @bppid end |
#function ⇒ Object
Returns the value of attribute function.
23 24 25 |
# File 'lib/ragweed/debuggertux.rb', line 23 def function @function end |
#installed ⇒ Object
Returns the value of attribute installed.
23 24 25 |
# File 'lib/ragweed/debuggertux.rb', line 23 def installed @installed end |
#orig ⇒ Object
Returns the value of attribute orig.
23 24 25 |
# File 'lib/ragweed/debuggertux.rb', line 23 def orig @orig end |
Instance Method Details
#call(*args) ⇒ Object
59 |
# File 'lib/ragweed/debuggertux.rb', line 59 def call(*args); @callable.call(*args) if @callable != nil; end |
#install ⇒ Object
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ragweed/debuggertux.rb', line 40 def install @orig = Ragweed::Wraptux::ptrace(Ragweed::Wraptux::Ptrace::PEEK_TEXT, @bppid, @addr, 0) if @orig != -1 n = (@orig & ~0xff) | INT3; Ragweed::Wraptux::ptrace(Ragweed::Wraptux::Ptrace::POKE_TEXT, @bppid, @addr, n) @installed = true else @installed = false end end |
#installed? ⇒ Boolean
58 |
# File 'lib/ragweed/debuggertux.rb', line 58 def installed?; @installed; end |