Skip to content

Commit

Permalink
Launch QEMU with sysroot if specified (#1241)
Browse files Browse the repository at this point in the history
* Launch QEMU with sysroot if specified

* Update gdb.py

* Append args, do not replace
  • Loading branch information
gsingh93 authored and Arusekk committed Dec 9, 2019
1 parent 6667a23 commit f6fe196
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pwnlib/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,10 @@ def debug(args, gdbscript=None, exe=None, ssh=None, env=None, sysroot=None, **kw
sysroot = sysroot or qemu.ld_prefix(env=env)
if not qemu_user:
log.error("Cannot debug %s binaries without appropriate QEMU binaries" % context.arch)
args = [qemu_user, '-g', str(qemu_port)] + args
qemu_args = [qemu_user, '-g', str(qemu_port)]
if sysroot:
qemu_args += ['-L', sysroot]
args = qemu_args + args

# Use a sane default sysroot for Android
if not sysroot and context.os == 'android':
Expand Down

0 comments on commit f6fe196

Please sign in to comment.