From 61eb460ac03bd32140cf1213383251f3e57f7fa8 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 10 Oct 2012 15:42:27 -0700 Subject: [PATCH 1/1] segfault file/line breakpoint info This can give easy info for using gdb. e.g.: For debugging, place breakpoint at: snapshot.cc:92 --- snapshot.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snapshot.cc b/snapshot.cc index e006189c..fb00d151 100644 --- a/snapshot.cc +++ b/snapshot.cc @@ -88,6 +88,8 @@ static void HandlePF( int sig, siginfo_t *si, void * unused){ if( si->si_code == SEGV_MAPERR ){ printf("Real Fault at %p\n", si->si_addr); print_trace(); + printf("For debugging, place breakpoint at: %s:%d\n", + __FILE__, __LINE__); exit( EXIT_FAILURE ); } void* addr = ReturnPageAlignedAddress(si->si_addr); -- 2.34.1