r260456 - in /trunk/gcc/ada: ChangeLog libgnat/...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon May 21 14:51:00 GMT 2018


Author: pmderodat
Date: Mon May 21 14:51:09 2018
New Revision: 260456

URL: https://gcc.gnu.org/viewcvs?rev=260456&root=gcc&view=rev
Log:
[Ada] Robustify traceback caching for executable in current dir

Any program calling Gnat.Traceback.Symbolic.Enable_Cache for
dwarf based symbolization fails with a segmentation violation
when spawned with an inaccurate argv[0] such that it couldn't
be found on PATH.

argv[0] is most often found on PATH. One plausible case where
it isn't is when argv[0] is a mere file name and . isn't on PATH,
which might happen out of imprecise exec calls.

This change robustifies the Traceback.Symbolic implementation
to work in this case as well, by just trying to work with argv[0]
untouched as the executable file to fetch dwarf info from.

2018-05-21  Olivier Hainque  <hainque@adacore.com>

gcc/ada/

	* libgnat/s-trasym__dwarf.adb (Executable_Name): Return argv[0] instead
	of empty string when argv[0] couldn't be found on PATH.
	(Enable_Cache): Raise Program_Error instead of attempting a null
	pointer dereference when the Exec_Module initialization failed.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/libgnat/s-trasym__dwarf.adb



More information about the Gcc-cvs mailing list