diff options
author | Olivier Hainque <hainque@adacore.com> | 2018-05-21 14:51:09 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-21 14:51:09 +0000 |
commit | 18c7a4eb877d3c3df5975a3841f76cb05897d1e9 (patch) | |
tree | 0751981fbf86e8b4224a605d0371d452a9e89d44 /gcc/ada/sem_eval.adb | |
parent | bbb99006570016986e821b7ddad581b0f2042c44 (diff) | |
download | gcc-18c7a4eb877d3c3df5975a3841f76cb05897d1e9.zip gcc-18c7a4eb877d3c3df5975a3841f76cb05897d1e9.tar.gz gcc-18c7a4eb877d3c3df5975a3841f76cb05897d1e9.tar.bz2 |
[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.
From-SVN: r260456
Diffstat (limited to 'gcc/ada/sem_eval.adb')
0 files changed, 0 insertions, 0 deletions