projects
/
cdsspec-compiler.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9593acf
)
segfault file/line breakpoint info
author
Brian Norris
<banorris@uci.edu>
Wed, 10 Oct 2012 22:42:27 +0000
(15:42 -0700)
committer
Brian Norris
<banorris@uci.edu>
Wed, 10 Oct 2012 22:44:41 +0000
(15:44 -0700)
This can give easy info for using gdb. e.g.:
For debugging, place breakpoint at: snapshot.cc:92
snapshot.cc
patch
|
blob
|
history
diff --git
a/snapshot.cc
b/snapshot.cc
index e006189c44ba1741208183ea8cbddd222b381dfd..fb00d1511c8505df3c34fc22eaa0b7adad838937 100644
(file)
--- 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);