From a7974933dd818194de3c9387b95dbd122bcf506c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 26 Jan 2019 12:08:56 +0200 Subject: Improve pdump file search and 'pdumper-stats' * src/pdumper.c (pdumper_record_wd): New function. (pdumper_load): Use xstrdup instead of strdup, as on MS-Windows the latter uses the wrong heap. Don't free a NULL pointer. * src/emacs.c (load_pdump): Support the use case where the Emacs binary was renamed: look in exec-directory for the pdump file whose base name is derived from the Emacs binary, in addition to just emacs.pdmp. (main): Call pdumper_record_wd to prepend CWD to the pdump file name. * src/fileio.c (file_name_absolute_p): Now extern. * src/lisp.h (file_name_absolute_p): Add prototype. * src/pdumper.h (pdumper_record_wd): Add prototype. * doc/emacs/cmdargs.texi (Initial Options): Update the documentation of where Emacs looks for the dump file. --- src/pdumper.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pdumper.h') diff --git a/src/pdumper.h b/src/pdumper.h index 7b52c64b974..90c744f0a4e 100644 --- a/src/pdumper.h +++ b/src/pdumper.h @@ -260,6 +260,10 @@ pdumper_clear_marks (void) and execution should resume. */ bool pdumper_handle_page_fault (void *fault_addr_ptr); +/* Record the Emacs startup directory, relative to which the pdump + file was loaded. */ +extern void pdumper_record_wd (const char *); + void syms_of_pdumper (void); INLINE_HEADER_END -- cgit v1.2.1