diff options
author | Olivier Hainque <hainque@adacore.com> | 2018-05-21 14:50:28 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-21 14:50:28 +0000 |
commit | 08f8a7162498b232831808a37b7fe6b9d95c8536 (patch) | |
tree | ff189a166d9a436bc0ac7bbc8f0c7104d7c2c012 /gcc/ada/libgnat | |
parent | 689751d2f7ae12bd34637801860a766d1196d960 (diff) | |
download | gcc-08f8a7162498b232831808a37b7fe6b9d95c8536.zip gcc-08f8a7162498b232831808a37b7fe6b9d95c8536.tar.gz gcc-08f8a7162498b232831808a37b7fe6b9d95c8536.tar.bz2 |
[Ada] Propagate load addresses for traceback cache on Linux
Symbolization of traceback addresses through shared libraries
requires information on the shared libraries load addresses, which
was at hand on Linuxbut not propagated through the runtime when
caching is enabled. This change fixes this.
2018-05-21 Olivier Hainque <hainque@adacore.com>
gcc/ada/
* libgnat/s-trasym__dwarf.adb (Add_Module_To_Cache): Expect a
Load_Address argument and pass it down to Init_Module.
* libgnat/s-tsmona__linux.adb (Build_Cache_For_All_Modules): Pass
lm.l_addr as the Load_Address to Add_Module_To_Cache.
From-SVN: r260448
Diffstat (limited to 'gcc/ada/libgnat')
-rw-r--r-- | gcc/ada/libgnat/s-trasym__dwarf.adb | 9 | ||||
-rw-r--r-- | gcc/ada/libgnat/s-tsmona__linux.adb | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ada/libgnat/s-trasym__dwarf.adb b/gcc/ada/libgnat/s-trasym__dwarf.adb index db7c5eb..5330e4a 100644 --- a/gcc/ada/libgnat/s-trasym__dwarf.adb +++ b/gcc/ada/libgnat/s-trasym__dwarf.adb @@ -123,7 +123,8 @@ package body System.Traceback.Symbolic is -- Return the String contained in Item, up until the first NUL character pragma Warnings (Off, "*Add_Module_To_Cache*"); - procedure Add_Module_To_Cache (Module_Name : String); + procedure Add_Module_To_Cache (Module_Name : String; + Load_Address : System.Address); -- To be called by Build_Cache_For_All_Modules to add a new module to the -- list. May not be referenced. @@ -217,12 +218,14 @@ package body System.Traceback.Symbolic is -- Add_Module_To_Cache -- ------------------------- - procedure Add_Module_To_Cache (Module_Name : String) is + procedure Add_Module_To_Cache (Module_Name : String; + Load_Address : System.Address) + is Module : Module_Cache_Acc; Success : Boolean; begin Module := new Module_Cache; - Init_Module (Module.all, Success, Module_Name); + Init_Module (Module.all, Success, Module_Name, Load_Address); if not Success then Free (Module); return; diff --git a/gcc/ada/libgnat/s-tsmona__linux.adb b/gcc/ada/libgnat/s-tsmona__linux.adb index cbebd06..ae91c40 100644 --- a/gcc/ada/libgnat/s-tsmona__linux.adb +++ b/gcc/ada/libgnat/s-tsmona__linux.adb @@ -122,7 +122,7 @@ package body Module_Name is while lm /= null loop if Big_String_Conv.To_Pointer (lm.l_name) (1) /= ASCII.NUL then -- Discard non-file (like the executable itself or the gate). - Add_Module_To_Cache (Value (lm.l_name)); + Add_Module_To_Cache (Value (lm.l_name), lm.l_addr); end if; lm := lm.l_next; end loop; |