Make mallocng test more consistent (#3444)

* add disable_debuginfod endpoint

* note
pull/3301/merge
k4lizen 1 week ago committed by GitHub
parent 9763fc3437
commit 04c06fa450
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -203,6 +203,15 @@ class Controller:
"""
raise NotImplementedError()
def disable_debuginfod(self) -> Awaitable[None]:
"""
Tells the debugger not to use debuginfod (for retrieving
debugging information / symbols).
This should be called before .launch().
"""
raise NotImplementedError()
def start(controller: Callable[[Controller], Coroutine[Any, Any, None]]) -> None:
"""

@ -59,6 +59,10 @@ class _GDBController(host.Controller):
async def select_thread(self, tid: int) -> None:
gdb.execute(f"thread {tid}")
async def disable_debuginfod(self) -> None:
gdb.execute("set debug-file-directory")
gdb.execute("set debuginfod enabled off")
def _start(outer: Callable[[host.Controller], Coroutine[Any, Any, None]]) -> None:
# The GDB controller is entirely synchronous, so keep advancing the

@ -58,6 +58,10 @@ async def _run(ctrl: Any, outer: Callable[..., Coroutine[Any, Any, None]]) -> No
async def select_thread(self, tid: int) -> None:
await self.pc.execute(f"thread select {tid}")
async def disable_debuginfod(self) -> None:
# Could also consider disabling `symbols.enable-external-lookup`
await self.pc.execute("settings set plugin.symbol-locator.debuginfod.server-urls {}")
await outer(_LLDBController(ctrl))

@ -299,6 +299,9 @@ async def test_mallocng_meta(ctrl: Controller, binary: str):
async def test_mallocng_malloc_context(ctrl: Controller, binary: str):
import pwndbg.color as color
# Make sure we are not working with symbols when we think we aren't
await ctrl.disable_debuginfod()
await ctrl.launch(binary)
# Check that we do not find it at the first program instruction

Loading…
Cancel
Save