metasm/cpu/z80/decode.rb in metasm-1.0.3 vs metasm/cpu/z80/decode.rb in metasm-1.0.4
- old
+ new
@@ -149,16 +149,10 @@
return if edata.ptr > edata.length
di
end
- # hash opcode_name => lambda { |dasm, di, *symbolic_args| instr_binding }
- def backtrace_binding
- @backtrace_binding ||= init_backtrace_binding
- end
- def backtrace_binding=(b) @backtrace_binding = b end
-
# populate the @backtrace_binding hash with default values
def init_backtrace_binding
@backtrace_binding ||= {}
mask = 0xffff
@@ -202,30 +196,9 @@
# TODO flags ?
@backtrace_binding[op] ||= binding if binding
}
@backtrace_binding
- end
-
- def get_backtrace_binding(di)
- a = di.instruction.args.map { |arg|
- case arg
- when Memref, Reg; arg.symbolic(di)
- else arg
- end
- }
-
- if binding = backtrace_binding[di.opcode.basename]
- binding[di, *a]
- else
- puts "unhandled instruction to backtrace: #{di}" if $VERBOSE
- # assume nothing except the 1st arg is modified
- case a[0]
- when Indirection, Symbol; { a[0] => Expression::Unknown }
- when Expression; (x = a[0].externals.first) ? { x => Expression::Unknown } : {}
- else {}
- end.update(:incomplete_binding => Expression[1])
- end
end
# patch a forward binding from the backtrace binding
def fix_fwdemu_binding(di, fbd)
case di.opcode.name