Skip to content

Context failing on breakpoints with commands #299

Closed
@yoava333

Description

@yoava333

Description

When using commands in breakpoints with pwndbg the debugger will halt the execution of the debugee and will not respond to keyboard commands.
The same gdb script works without pwndbg (e.g. commenting out in ~/.gdbinit)

Steps to reproduce

wrote the following gdb script (gdb.cmds):

b malloc
commands
    printf "size = %d\n", $rdi
    c
end

run the following command:
gdb /usr/bin/python -x gdb.cmds

and type "r"

the output

user@ubuntu /tmp> gdb /usr/bin/python -x gdb.cmds
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Loaded 108 commands. Type pwndbg [filter] for a list.
Reading symbols from /usr/bin/python...(no debugging symbols found)...done.
Breakpoint 1 at 0x4168e0
pwndbg> r
Starting program: /usr/bin/python

Breakpoint 1, malloc (n=1425) at dl-minimal.c:94
94      dl-minimal.c: No such file or directory.
size = 1425



^C^C

BTW if you add the "r" commands to the end of gdb.cmds it works fine.

My setup

Ubuntu 16.04.02
pwndbg - dae257c
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
python - 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions