Skip to content

Preload code for segvault handling which launches GDB automagically

License

Notifications You must be signed in to change notification settings

enwaytech/gdb_on_seg

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gdb_on_seg

Preload code for segfault handling which launches GDB automagically

Originally taken from https://stackoverflow.com/a/25499817 (https://stackoverflow.com/a/22509089)

Usage

  • Compile by running ./compile
  • Result .so file is in lib folder
  • Add LD_PRELOAD and run executable: LD_PRELOAD=<path to build folder>/gdb_on_seg.so executable
  • Or export LD_PRELOAD=<path to build folder>/gdb_on_seg.so and then run the executable normally
  • When a segfault, etc. occurs the program will go on hold an gdb is run and prints out the stack traces of all threads

About

Preload code for segvault handling which launches GDB automagically

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 98.2%
  • Shell 1.8%