Plus, The program runs on a arm device running Linux, I can print out stack info and register values in the sig-seg handler I assign.
The problem is I can’t add -g option to the source file, since the bug may won’t reproduce due to performance downgrade.
Plus, The program runs on a arm device running Linux, I can print out
Share
Compiling with the
-goption togccdoes not cause a “performance downgrade”. All it does is cause debugging symbols to be included; it does not affect the optimisation or code generation.If you install your
SIGSEGVhandler using thesa_sigactionmember of thesigactionstruct passed tosigaction(), then thesi_addrmember of thesiginfo_tstructure passed to your handler contains the faulting address.