Fix gdb16+ (#2686)

* gdb16+ now need `import gdb.types`

* gdb16+ now need `import gdb.types`

* fix core file test
pull/2694/head
patryk4815 11 months ago committed by GitHub
parent 246e88bd13
commit 8b2952ef1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,5 @@
from __future__ import annotations
import binascii
import re
from asyncio import CancelledError
from contextlib import contextmanager
@ -17,6 +16,7 @@ from typing import Tuple
from typing import TypeVar
import gdb
import gdb.types
from typing_extensions import Callable
from typing_extensions import Set
from typing_extensions import override

@ -4,6 +4,7 @@ import os
import re
import tests
from pwndbg.gdblib import gdb_version
from .utils import run_gdb_with_script
@ -71,7 +72,9 @@ def test_loads_core_without_crashing():
binary_line = re.compile("^Core was generated by .+$")
assert any(binary_line.match(line) for line in output)
crash_address_line = re.compile(r"^#0 0x[0-9a-fA-F]+ in \?\? \(\)$")
if gdb_version[0] < 16:
# GDB <16, has bugged core file, with missing symbols
crash_address_line = re.compile(r"^#0 0x[0-9a-fA-F]+ in \?\? \(\)$")
assert any(crash_address_line.match(line) for line in output)

Loading…
Cancel
Save