emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding the dump (redux)


From: Eli Zaretskii
Subject: Re: Finding the dump (redux)
Date: Mon, 19 Apr 2021 16:00:44 +0300

> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: eliz@gnu.org,  ali_gnu2@emvision.com,  emacs-devel@gnu.org
> Date: Mon, 19 Apr 2021 10:35:20 +0200
> 
> Name the pdumper file emacs-FINGERPRINT.pdmp (where FINGERPRINT is the
> hex string of the unique fingerprint).  Then the file can be put in a
> fixed, shared directory without conflicts, and there is no need to use
> an elaborate search strategy.                  ^^^^^^^^^^^^^^^^^^^^^^^
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The underlined part is not entirely accurate.  We will still need to
look for the Emacs executable along PATH, resolve symlinks in the
result, then look in 2 possible places relative to that.

To elaborate, we currently do the following:

  . if argv[0] doesn't have leading directories, look for it along PATH
  . resolve symlink in the result to find the real place of the executable
  . look in the same directory for BASENAME.pdmp, where BASENAME is the
    basename of the resolved executable
  . if there's no BASENAME.pdmp there, look for emacs.pdmp in the
    directory specified by EXEC_PATH
  . if that fails as well, look for BASE.pdm in EXEC_PATH, where BASE
    is the basename of the original argv[0]

In each place where we look, if the file by that name exists, we try
to load it; if the load fails, we quit (and don't search in the rest
of the places).  IOW, we only continue to the next candidate place if
the file by the name we looked for doesn't exist there.

Thus, using emacs-FINGERPRINT.pdmp can simplify this process:

  . it will eliminate the need for the last step above
  . it will avoid the danger that a file by the name we look does
    exist in some place, but fails the fingerprint test, and thus
    prevents us from finding the correct file in one of the other
    places

But we'd still need to decide on a search strategy.  For example, note
that the current strategy is the reverse of the one we use for looking
for Lisp files: there we first look in the installation directory and
only if that fails look in the source tree.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]