From: Olivier Hainque Date: Wed, 2 Sep 2020 17:10:59 +0000 (+0200) Subject: [Ada] Restore hex addresses and improve symbolic backtraces X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d111f09ee50cdf65bbcd8b6bd8c0e764431810ff;p=gcc.git [Ada] Restore hex addresses and improve symbolic backtraces gcc/ada/ * libgnat/s-dwalin.adb (Symbolic_Traceback): Always emit the hex address at the beginning of an entry if suppression is not requested. Consistently output a "???" for the subprogram name when it is unknown. --- diff --git a/gcc/ada/libgnat/s-dwalin.adb b/gcc/ada/libgnat/s-dwalin.adb index abb499c35cb..d8b15c5dd66 100644 --- a/gcc/ada/libgnat/s-dwalin.adb +++ b/gcc/ada/libgnat/s-dwalin.adb @@ -1582,6 +1582,13 @@ package body System.Dwarf_Lines is Subprg_Name, Line_Num); + -- If we're not requested to suppress hex addresses, emit it now. + + if not Suppress_Hex then + Append_Address (Res, Addr_In_Traceback); + Append (Res, ' '); + end if; + if File_Name /= null then declare Last : constant Natural := String_Length (File_Name); @@ -1626,26 +1633,22 @@ package body System.Dwarf_Lines is (Res, String (Subprg_Name.Ptr (Off .. Subprg_Name.Len))); end if; - Append (Res, ' '); + else + Append (Res, "???"); end if; - Append (Res, "at "); + Append (Res, " at "); Append (Res, String (File_Name (1 .. Last))); Append (Res, ':'); Append (Res, Line_Image (2 .. Line_Image'Last)); end; else - if Suppress_Hex then - Append (Res, "..."); - else - Append_Address (Res, Addr_In_Traceback); - end if; - if Subprg_Name.Len > 0 then Off := Strip_Leading_Char (C.Obj.all, Subprg_Name); - Append (Res, ' '); Append (Res, String (Subprg_Name.Ptr (Off .. Subprg_Name.Len))); + else + Append (Res, "???"); end if; Append (Res, " at ???");