node/lib/metasm/metasm/debug.rb
def post_evt_bp(b)
		@breakpoint_cause = b

		found_valid_active = false

		pre_callback_pc = pc

		# XXX may have many active bps with callback that continue/singlestep/singlestep{}...
		b.hash_shared.dup.find_all { |bb|
			# ignore inactive bps
			next if bb.state != :active

			# ignore out-of-range bpms
			next if bb.type == :bpm and not check_bpm_range(bb, b.internal)

			# check condition
			case bb.condition
			when nil; cd = 1
			when Proc; cd = bb.condition.call
			when String, Expression; cd = resolve_expr(bb.condition)
			else raise "unknown bp condition #{bb.condition.inspect}"
			end
			next if not cd or cd == 0

			found_valid_active = true

			# oneshot
			del_bp(bb) if bb.oneshot

			bb.action
		}.each { |bb| bb.action.call }

		# discard @breakpoint_cause if a bp callback did modify register_pc
		@breakpoint_cause = nil if pc != pre_callback_pc

		# we did break due to a bp whose condition is not true: resume
		# (unless a callback already resumed)
		resume_badbreak(b) if not found_valid_active and @state == :stopped
	end
# handles breakpoint conditions/callbacks etc
handles breakpoint conditions/callbacks etc
handles breakpoint conditions / callbacks etc
def post_evt_bp(b)
		@breakpoint_cause = b
		found_valid_active = false
		pre_callback_pc = pc
		b.hash_shared.dup.find_all { |bb|
			next if bb.state != :active
			next if bb.type == :bpm and not check_bpm_range(bb, b.internal)
			case bb.condition
			when nil; cd = 1
			when Proc; cd = bb.condition.call
			when String, Expression; cd = resolve_expr(bb.condition)
			else raise "unknown bp condition #{bb.condition.inspect}"
			end
			next if not cd or cd == 0
			found_valid_active = true
			del_bp(bb) if bb.oneshot
			bb.action
		}.each { |bb| bb.action.call }
		@breakpoint_cause = nil if pc != pre_callback_pc
		resume_badbreak(b) if not found_valid_active and @state == :stopped
	end
def post_evt_bp ( b ) @breakpoint_cause = b found_valid_active = false pre_callback_pc = pc b . hash_shared . dup . find_all { | bb | next if bb . state != :active next if bb . type == :bpm and not check_bpm_range ( bb , b . internal ) case bb . condition when nil ; cd = 1 when Proc ; cd = bb . condition . call when String , Expression ; cd = resolve_expr ( bb . condition ) else raise "unknown bp condition #{bb.condition.inspect}" end next if not cd or cd == 0 found_valid_active = true del_bp ( bb ) if bb . oneshot bb . action } . each { | bb | bb . action . call } @breakpoint_cause = nil if pc != pre_callback_pc resume_badbreak ( b ) if not found_valid_active and @state == :stopped end
handles breakpoint conditions/callbacks etc
handles breakpoint conditions / callbacks etc
# XXX may have many active bps with callback that continue/singlestep/singlestep{}... # ignore inactive bps # ignore out-of-range bpms # check condition # oneshot # discard @breakpoint_cause if a bp callback did modify register_pc # we did break due to a bp whose condition is not true: resume # (unless a callback already resumed)
b