|
|
|
|
@ -120,7 +120,7 @@ OPCODE_SEPERATOR_TESTS_EXPECTED_OUTPUT = {
|
|
|
|
|
def test_nearpc_opcode_bytes(start_binary, opcode_bytes):
|
|
|
|
|
start_binary(SYSCALLS_BINARY)
|
|
|
|
|
gdb.execute("nextsyscall")
|
|
|
|
|
gdb.execute(f"set nearpc-opcode-bytes {opcode_bytes}")
|
|
|
|
|
gdb.execute(f"set nearpc-num-opcode-bytes {opcode_bytes}")
|
|
|
|
|
dis = gdb.execute("nearpc", to_string=True)
|
|
|
|
|
expected = (
|
|
|
|
|
" 0x400080 {0} <_start> mov eax, 0\n"
|
|
|
|
|
@ -145,7 +145,7 @@ def test_nearpc_opcode_bytes(start_binary, opcode_bytes):
|
|
|
|
|
def test_nearpc_opcode_seperator(start_binary, separator_bytes):
|
|
|
|
|
start_binary(SYSCALLS_BINARY)
|
|
|
|
|
gdb.execute("nextsyscall")
|
|
|
|
|
gdb.execute("set nearpc-opcode-bytes 5")
|
|
|
|
|
gdb.execute("set nearpc-num-opcode-bytes 5")
|
|
|
|
|
gdb.execute(f"set nearpc-opcode-separator-bytes {separator_bytes}")
|
|
|
|
|
dis = gdb.execute("nearpc", to_string=True)
|
|
|
|
|
excepted = (
|
|
|
|
|
@ -171,7 +171,7 @@ def test_nearpc_opcode_invalid_config():
|
|
|
|
|
expected = "integer -1 out of range"
|
|
|
|
|
try:
|
|
|
|
|
# We try to catch the output since GDB < 9 won't raise the exception
|
|
|
|
|
assert gdb.execute("set nearpc-opcode-bytes -1", to_string=True).rstrip() == expected
|
|
|
|
|
assert gdb.execute("set nearpc-num-opcode-bytes -1", to_string=True).rstrip() == expected
|
|
|
|
|
except gdb.error as e:
|
|
|
|
|
assert expected == str(e)
|
|
|
|
|
|
|
|
|
|
|