metasm/cpu/ppc/decode.rb in metasm-1.0.3 vs metasm/cpu/ppc/decode.rb in metasm-1.0.4
- old
+ new
@@ -174,16 +174,10 @@
end
}
df
end
- # hash opname => lambda { |di, *sym_args| binding }
- def backtrace_binding
- @backtrace_binding ||= init_backtrace_binding
- end
- def backtrace_binding=(b) @backtrace_binding = b end
-
def init_backtrace_binding
@backtrace_binding ||= {}
opcode_list.map { |ol| ol.name }.uniq.each { |op|
binding = case op
when 'mr', 'li', 'la'; lambda { |di, a0, a1| { a0 => Expression[a1] } }
@@ -227,28 +221,9 @@
end
@backtrace_binding[op] ||= binding if binding
}
@backtrace_binding
- end
-
- def get_backtrace_binding(di)
- a = di.instruction.args.map { |arg|
- case arg
- when Memref; arg.symbolic(di.address)
- when Reg; arg.symbolic
- else arg
- end
- }
-
- binding = if binding = backtrace_binding[di.instruction.opname]
- binding[di, *a]
- else
- puts "unknown instruction to emu #{di}" if $VERBOSE
- {}
- end
-
- binding
end
def get_xrefs_x(dasm, di)
return [] if not di.opcode.props[:setip]