Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: simon.marchi@ericsson.com, gdb-patches@sourceware.org
Subject: Re: [PATCH v2 3/4] Add DWARF index cache
Date: Fri, 27 Jul 2018 21:25:00 -0000	[thread overview]
Message-ID: <83sh44qslw.fsf@gnu.org> (raw)
In-Reply-To: <e0035566b1c76e4592790b62cd319b34@polymtl.ca> (message from Simon	Marchi on Fri, 27 Jul 2018 10:01:43 -0400)

> Date: Fri, 27 Jul 2018 10:01:43 -0400
> From: Simon Marchi <simon.marchi@polymtl.ca>
> Cc: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
> 
> On 2018-07-27 05:06, Eli Zaretskii wrote:
> >> From: Simon Marchi <simon.marchi@ericsson.com>
> >> CC: Simon Marchi <simon.marchi@ericsson.com>
> >> Date: Wed, 25 Jul 2018 18:47:03 -0400
> >> 
> >> GDB can generate indexes for DWARF debug information, which, when
> >> integrated in the original binary, can speed up loading object files.
> >> This can be done using the gdb-add-index script or directly by the
> >> linker itself.
> > 
> > The information in the last sentence is not mentioned in the
> > documentation patch you provided.  I think we should mention that.
> 
> I think this is already well covered by the rest of the "18.5 Index 
> Files Speed Up GDB" section, just before the content I added, isn't it?

Ah, yes, you are right.

> >> - The saved index file is exactly the same as the output of the "save
> >>   gdb-index" command.  It is therefore the exact same content that 
> >> would
> >>   be found in the .gdb_index or .debug_names section.  We just leave 
> >> it
> >>   as a standalone file instead of merging it in the binary.
> > 
> > This should be mentioned in the documentation, IMO.
> 
> Ok, I thought this was an internal GDB implementation detail (which 
> could be subject to change), but I can add it if you think it is 
> important.

If we think this details is likely to change, or have other good
reasons not divulge this, I'm okay with keeping silent about it.  But
if chances are this will stay forever (or thereabouts), I think the
details is important enough to tell the users.

> >> +      /* If we get EEXIST and the existing path is a directory, then 
> >> we're
> >> +         happy.  If it exists, but it's a regular file and this is 
> >> not the last
> >> +         component, we'll fail at the next component.  If this is the 
> >> last
> >> +         component, the caller will fail with ENOTDIR when trying to
> >> +         open/create a file under that path.  */
> >> +      if (mkdir (start, 0700) != 0)
> > 
> > This will not work on Windows.
> 
> Which part of it?

mkdir accepts only one argument, not 2.

> > Does this mean this feature will only work on systems with mmap?
> 
> Indeed.  There is an equivalent API for Windows though I think:
> 
> https://docs.microsoft.com/en-us/windows/desktop/Memory/file-mapping
> 
> I can't really do the Windows bits, because I just don't have the 
> competence to write software for Windows.  Every time I tried to build 
> GDB for Windows, I failed miserably (do we have a guide for that?).  So 
> my thought (including for the mkdir_recursive function) was that 
> somebody who used Windows could later implement the missing parts.  

Fair enough.

> Also, I guess that somebody debugging native executables on Windows 
> wouldn't have a use for the cache, because indices only work for DWARF 
> debug info.

MinGW uses DWARF debug info for quite a few years now, so caching will
definitely be useful.

Thanks.


  reply	other threads:[~2018-07-27 21:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-25 22:47 [PATCH v2 0/4] Add a " Simon Marchi
2018-07-25 22:47 ` [PATCH v2 2/4] Introduce mmap_file function Simon Marchi
2018-07-25 22:47 ` [PATCH v2 4/4] Add doc and news for DWARF index cache Simon Marchi
2018-07-27  8:50   ` Eli Zaretskii
2018-07-30 19:04     ` Simon Marchi
2018-07-30 19:23       ` Eli Zaretskii
2018-07-25 22:48 ` [PATCH v2 3/4] Add " Simon Marchi
2018-07-27  9:06   ` Eli Zaretskii
2018-07-27 14:01     ` Simon Marchi
2018-07-27 21:25       ` Eli Zaretskii [this message]
2018-07-30 15:33         ` Simon Marchi
2018-07-30 15:45           ` Simon Marchi
2018-07-30 15:57           ` Eli Zaretskii
2018-07-30 17:05             ` Simon Marchi
2018-07-25 22:48 ` [PATCH v2 1/4] Make index reading functions more modular Simon Marchi

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=83sh44qslw.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /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