From 9ba83a3fda56db0ae3f87bee6f5b90791244e326 Mon Sep 17 00:00:00 2001 From: kettenis Date: Mon, 12 Jan 2015 20:27:09 +0000 Subject: [PATCH] Make putting a breakpoint on the first instruction of a program work. Previously a breakpoint at the first instruction would force us to single-step. Depending on the single-step implementation this would make us step over the breakpoint and continue in many cases. Fix this by passing the address of the current instruction pointer which will skip the code that checks if we need to step over a breakpoint. A similar fix has been made upstream many moons ago. Fixes debugging static PIE on sparc64 and probably others that use some sort of software single-stepping. --- gnu/usr.bin/binutils/gdb/inf-ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/usr.bin/binutils/gdb/inf-ptrace.c b/gnu/usr.bin/binutils/gdb/inf-ptrace.c index f1fcc437f60..84f299e30da 100644 --- a/gnu/usr.bin/binutils/gdb/inf-ptrace.c +++ b/gnu/usr.bin/binutils/gdb/inf-ptrace.c @@ -143,7 +143,7 @@ inf_ptrace_create_inferior (char *exec_file, char *allargs, char **env, observer_notify_inferior_created (¤t_target, from_tty); /* Pedal to the metal... */ - proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0); + proceed (read_pc (), TARGET_SIGNAL_0, 0); } #ifdef PT_GET_PROCESS_STATE -- 2.20.1