node/lib/metasm/metasm/debug.rb
# create a thread/process breakpoint
# addr can be a numeric address, an Expression that is resolved, or
#  a String that is parsed+resolved
# info's keys are set to the breakpoint
# standard keys are :type, :oneshot, :condition, :action
# returns the Breakpoint object
create a thread/process breakpoint
addr can be a numeric address, an Expression that is resolved, or
a String that is parsed+resolved
info's keys are set to the breakpoint
standard keys are :type, :oneshot, :condition, :action
returns the Breakpoint object
create a thread / process breakpoint addr can be a numeric address an Expression that is resolved or a String that is parsed + resolved info ' s keys are set to the breakpoint standard keys are : type : oneshot : condition : action returns the Breakpoint object
def add_bp(addr, info={})
		info[:pid] ||= @pid
		info[:tid] ||= @tid if info[:pid] == @pid and info[:type] == :hwbp
		b = Breakpoint.new
		info.each { |k, v|
			b.send("#{k}=", v)
		}
		switch_context(b) {
			addr = resolve_expr(addr) if not addr.kind_of? ::Integer
			b.address = addr
			b.hash_owner ||= case b.type
				when :bpm;  @breakpoint_memory
				when :hwbp; @breakpoint_thread
				when :bpx;  @breakpoint
				end
			b.add
			enable_bp(b) if not info[:state]
		}
		b
	end
def add_bp ( addr , info = { } ) info [ :pid ] ||= @pid info [ :tid ] ||= @tid if info [ :pid ] == @pid and info [ :type ] == :hwbp b = Breakpoint . new info . each { | k , v | b . send ( "#{k}=" , v ) } switch_context ( b ) { addr = resolve_expr ( addr ) if not addr . kind_of? :: Integer b . address = addr b . hash_owner ||= case b . type when :bpm ; @breakpoint_memory when :hwbp ; @breakpoint_thread when :bpx ; @breakpoint end b . add enable_bp ( b ) if not info [ :state ] } b end
create a thread/process breakpoint
addr can be a numeric address, an Expression that is resolved, or
a String that is parsed+resolved
info's keys are set to the breakpoint
standard keys are :type, :oneshot, :condition, :action
returns the Breakpoint object
create a thread / process breakpoint addr can be a numeric address an Expression that is resolved or a String that is parsed + resolved info ' s keys are set to the breakpoint standard keys are : type : oneshot : condition : action returns the Breakpoint object
# dont define :tid for bpx, otherwise on del_bp we may switch_context to this thread that may not be stopped -> cant ptrace_write # XXX bpm may hash_share with an :active, but be larger and still need enable()
addr
info