예제 #1
0
    raw_input = input

import re
if stdout.isatty():
    try:
        # Use readline for better raw_input()
        import readline   # noqa
    except ImportError:
        pass

# Match a register name: $eax, $gp0, $orig_eax
REGISTER_REGEX = re.compile(r"\$[a-z]+[a-z0-9_]+")

# BYTES_REGEX = re.compile(r"""(?:'([^'\\]*)'|"([^"\\]*)")""")

SIGNALS = inverseDict(SIGNAMES)   # name -> signum

COMMANDS = (
    # trace instructions
    ("cont", "continue execution"),
    ("step", "execute one instruction (do not enter in a call)"),
    ("stepi", "execute one instruction (enter the call)"),
    ("until", "execute code until specified address (until <address>)"),
    ("set", "set register value (set <register>=<value>)"),
    ("sys", "continue execution to next syscall"),
    ("signal", "send a signal to the process (signal <signum>)"),
    ("signals", "display signals"),

    # current process info
    ("regs", "display registers"),
    ("where", "display true code content (show breakpoints effects on code). e.g. 'where $eip', 'where $eip $eip+20'"),
예제 #2
0
파일: gdb.py 프로젝트: tjmaas/cs373-idb
    raw_input = input

import re
if stdout.isatty():
    try:
        # Use readline for better raw_input()
        import readline
    except ImportError:
        pass

# Match a register name: $eax, $gp0, $orig_eax
REGISTER_REGEX = re.compile(r"\$[a-z]+[a-z0-9_]+")

#BYTES_REGEX = re.compile(r"""(?:'([^'\\]*)'|"([^"\\]*)")""")

SIGNALS = inverseDict(SIGNAMES)   # name -> signum

COMMANDS = (
    # trace instructions
    ("cont", "continue execution"),
    ("step", "execute one instruction (do not enter in a call)"),
    ("stepi", "execute one instruction (enter the call)"),
    ("until", "execute code until specified address (until <address>)"),
    ("set", "set register value (set <register>=<value>)"),
    ("sys", "continue execution to next syscall"),
    ("signal", "send a signal to the process (signal <signum>)"),
    ("signals", "display signals"),

    # current process info
    ("regs", "display registers"),
    ("where", "display true code content (show breakpoints effects on code). eg. 'where $eip', 'where $eip $eip+20'"),