public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3741] [Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line
@ 2021-09-21 15:27 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-09-21 15:27 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:97a5ed2071fffe85ee1a07e0655740162e4cce64

commit r12-3741-g97a5ed2071fffe85ee1a07e0655740162e4cce64
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Jul 6 16:47:31 2021 +0200

    [Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line
    
    gcc/ada/
    
            * libgnat/s-dwalin.adb (To_File_Name): Fetch only the last string
            from the .debug_line_str section.
            (Symbolic_Address.Set_Result): Likewise.

Diff:
---
 gcc/ada/libgnat/s-dwalin.adb | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/libgnat/s-dwalin.adb b/gcc/ada/libgnat/s-dwalin.adb
index 74700e68bfc..4bcd741c92c 100644
--- a/gcc/ada/libgnat/s-dwalin.adb
+++ b/gcc/ada/libgnat/s-dwalin.adb
@@ -957,8 +957,10 @@ package body System.Dwarf_Lines is
 
                      when DW_FORM_line_strp =>
                         Read_Section_Offset (C.Lines, Off, C.Header.Is64);
-                        Seek (C.Line_Str, Off);
-                        Read_C_String (C.Line_Str, Buf);
+                        if J = File then
+                           Seek (C.Line_Str, Off);
+                           Read_C_String (C.Line_Str, Buf);
+                        end if;
 
                      when others =>
                         raise Dwarf_Error with "DWARF form not implemented";
@@ -1674,8 +1676,10 @@ package body System.Dwarf_Lines is
 
                         when DW_FORM_line_strp =>
                            Read_Section_Offset (C.Lines, Off, C.Header.Is64);
-                           Seek (C.Line_Str, Off);
-                           File_Name := Read_C_String (C.Line_Str);
+                           if J = Match.File then
+                              Seek (C.Line_Str, Off);
+                              File_Name := Read_C_String (C.Line_Str);
+                           end if;
 
                         when others =>
                            raise Dwarf_Error with "DWARF form not implemented";
@@ -1718,8 +1722,10 @@ package body System.Dwarf_Lines is
 
                         when DW_FORM_line_strp =>
                            Read_Section_Offset (C.Lines, Off, C.Header.Is64);
-                           Seek (C.Line_Str, Off);
-                           Dir_Name := Read_C_String (C.Line_Str);
+                           if J = Dir_Idx then
+                              Seek (C.Line_Str, Off);
+                              Dir_Name := Read_C_String (C.Line_Str);
+                           end if;
 
                         when others =>
                            raise Dwarf_Error with "DWARF form not implemented";


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-21 15:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21 15:27 [gcc r12-3741] [Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).