0

gdb-peda shows a very useful context each time it stops (b, si, etc.), but sometimes I don't want it. Is there any way to quiet it so it won't show the context automatically (unless prompted context)?

--

UPDATE

Since there's no out of the box answer, I'll take, for the bounty, a custom or roll-your-own solution (e.g. a script or special command).

0

1 Answer 1

0

Browsing through peda's source, it seems to use a gdb hook-stop, which can be modified back and forth:

gdb-peda$ show user hook-stop
User command "hook-stop":
  peda context
  session autosave

gdb-peda$ define hook-stop
Type commands for definition of "hook-stop".
End with a line saying just "end".
>session autosave
>end
gdb-peda$ n
18        printf("...");
gdb-peda$ define hook-stop
Type commands for definition of "hook-stop".
End with a line saying just "end".
>peda context
>session autosave
>end
gdb-peda$ n
[---registers---]
EAX: 0x0
EBX: 0x56557000 --> 0x1ef8

Relevant source is at https://github.com/longld/peda/blob/84d38bda505941ba823db7f6c1bcca1e485a2d43/peda.py#L6120 and https://github.com/longld/peda/blob/84d38bda505941ba823db7f6c1bcca1e485a2d43/peda.py#L230 .

I'd imagine there's a way to extend peda, so that the peda object's methods can be called, but I can't figure that out. In the absence of that, we can invoke those commands manually. Note that gdb doesn't seem to allow nested defines, so we can't script the (re)defines themselves.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.