summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2015-01-12 20:27:10 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2015-01-12 20:27:10 +0000
commit853188d6933598499cc6db3adec95860597673a7 (patch)
tree73f286d9e28e3a522a831bb5e0add34526def9bc /gnu/usr.bin/binutils
parent481cc193f6d765e84808b41d9d840b6accba96b8 (diff)
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.
Diffstat (limited to 'gnu/usr.bin/binutils')
-rw-r--r--gnu/usr.bin/binutils/gdb/inf-ptrace.c2
1 files changed, 1 insertions, 1 deletions
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 (&current_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