Rename config

Replace `nearpc-opcode-bytes` with `nearpc-num-opcode-bytes`
pull/1545/head
lebr0nli 3 years ago committed by Gulshan Singh
parent 6f696cc82b
commit d7ef76ae3a

@ -57,7 +57,7 @@ show_args = pwndbg.gdblib.config.add_param(
"nearpc-show-args", True, "whether to show call arguments below instruction"
)
show_opcode_bytes = pwndbg.gdblib.config.add_param(
"nearpc-opcode-bytes",
"nearpc-num-opcode-bytes",
0,
"number of opcode bytes to print for each instruction",
param_class=gdb.PARAM_ZUINTEGER,

@ -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)

Loading…
Cancel
Save