def make_trace_script(do_trace, use_pdb):
    if (not (do_trace or use_pdb)):
        return None

    def trace_script(pc, opcode, data, stack, altstack, if_condition_stack, is_signature):
        from pycoinzpub.serialize import b2h
        print(('stack: [%s]' % ' '.join((b2h(s) for s in stack))))
        if (len(altstack) > 0):
            print(('altstack: %s' % altstack))
        print(('condition stack: %s' % if_condition_stack))
        print(('%3d : %02x  %s' % (pc, opcode, disassemble_for_opcode_data(opcode, data))))
        if use_pdb:
            import pdb
            pdb.set_trace()
    return trace_script
def make_trace_script(do_trace, use_pdb):
    if (not (do_trace or use_pdb)):
        return None

    def trace_script(pc, opcode, data, stack, altstack, if_condition_stack, is_signature):
        from pycoinzpub.serialize import b2h
        print(('stack: [%s]' % ' '.join((b2h(s) for s in stack))))
        if (len(altstack) > 0):
            print(('altstack: %s' % altstack))
        print(('condition stack: %s' % if_condition_stack))
        print(('%3d : %02x  %s' % (pc, opcode, disassemble_for_opcode_data(opcode, data))))
        if use_pdb:
            import pdb
            pdb.set_trace()
    return trace_script