public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Eric Botcazou <ebotcazou@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r11-9045] [Ada] Small optimization to DWARF 5 mode in System.Dwarf_Line
Date: Thu, 30 Sep 2021 11:51:07 +0000 (GMT)	[thread overview]
Message-ID: <20210930115107.7EF913857C4C@sourceware.org> (raw)

https://gcc.gnu.org/g:a872ad6d709494ff3a8d340a60f466bb0e8154e3

commit r11-9045-ga872ad6d709494ff3a8d340a60f466bb0e8154e3
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 3fd6d1184e9..b8e8c112dd7 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";


                 reply	other threads:[~2021-09-30 11:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210930115107.7EF913857C4C@sourceware.org \
    --to=ebotcazou@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).