1. Since this is called the _portable_ dumper, I suggest you use
standard I/O from stdio, rather than low-level Unix I/O. In
practice this means we should use fwrite instead of write, etc.
This will also be much faster for creating the dump file, not that
that is very important (buffering).
2. XEmacs crashes for me as follows:
(martin@polgar) /usr/local/x/build/mdps+/src $ dbx temacs
dbx> run
Running: temacs
(process id 28578)
signal BUS (invalid address alignment) in pdump_load at line 5066 in file
"/net/lasker/xemacs/ws/dev/src/alloc.c"
5066 *(lrecord_implementations_table[i]->lrecord_type_index) = i;
dbx> where
=>[1] pdump_load(), line 5066 in "/net/lasker/xemacs/ws/dev/src/alloc.c"
[2] xemacs_21_2_b27_sparc_sun_solaris2_6(argc = 1, argv = 0xefffeaf4, envp = 0xefffeafc,
restart = 0), line 869 in "/net/lasker/xemacs/ws/dev/src/emacs.c"
[3] main(argc = 1, argv = 0xefffeaf4, envp = 0xefffeafc), line 2266 in
"/net/lasker/xemacs/ws/dev/src/emacs.c"
dbx> f 1
Current function is pdump_load
5066 *(lrecord_implementations_table[i]->lrecord_type_index) = i;
dbx> p *lrecord_implementations_table[i]
*lrecord_implementations_table[i] = {
name = 0x636f6e73 "<bad address 0x636f6e73>"
marker = 0x742d6f62
printer = 0x6a656374
finalizer = (nil)
equal = 0x636f6e73
hash = 0x742d7370
description = 0x65636966
getprop = 0x69657200
putprop = 0x64656661
remprop = 0x756c742d
plist = 0x62756666
static_size = 1701969920U
size_in_bytes_method = 0x63757272
lrecord_type_index = 0x656e742d
basic_p = 1651861094
}
dbx> print i
i = 1
What I don't understand is how the lrecord_implementations_table can
possibly be resurrected in the post-dump temacs. It seems like all
the pointers in the lrecord_implementations_table need to be
relocated, and perhaps the structures they point to need to be
re-created. I don't see where this is being done. I must be missing
something.
Olivier, you can get access to my machine for testing, if you need it,
by sending me your ssh public key.
Martin