comparison src/dumper.c @ 1333:1b0339b048ce

[xemacs-hg @ 2003-03-02 09:38:37 by ben] To: xemacs-patches@xemacs.org PROBLEMS: Include nt/PROBLEMS and update. Add note about incremental linking badness. cmdloop.el, custom.el, dumped-lisp.el, files.el, keydefs.el, keymap.el, lisp-mode.el, make-docfile.el, replace.el, simple.el, subr.el, view-less.el, wid-edit.el: Lots of syncing with FSF 21.2. Use if-fboundp in wid-edit.el. New file newcomment.el from FSF. internals/internals.texi: Fix typo. (Build-Time Dependencies): New node. PROBLEMS: Delete. config.inc.samp, xemacs.mak: Eliminate HAVE_VC6, use SUPPORT_EDIT_AND_CONTINUE in its place. No incremental linking unless SUPPORT_EDIT_AND_CONTINUE, since it can cause nasty crashes in pdump. Put warnings about this in config.inc.samp. Report the full compile flags used for src and lib-src in the Installation output. alloc.c, lisp.h, ralloc.c, regex.c: Use ALLOCA() in regex.c to avoid excessive stack allocation. Also fix subtle problem with REL_ALLOC() -- any call to malloc() (direct or indirect) may relocate rel-alloced data, causing buffer text to shift. After any such call, regex must update all its pointers to such data. Add a system, when ERROR_CHECK_MALLOC, whereby regex.c indicates all the places it is prepared to handle malloc()/realloc()/free(), and any calls anywhere in XEmacs outside of this will trigger an abort. alloc.c, dialog-msw.c, eval.c, event-stream.c, general-slots.h, insdel.c, lisp.h, menubar-msw.c, menubar-x.c: Change *run_hook*_trapping_problems to take a warning class, not a string. Factor out code to issue warnings, add flag to call_trapping_problems() to postpone warning issue, and make *run_hook*_trapping_problems issue their own warnings tailored to the hook, postponed in the case of safe_run_hook_trapping_problems() so that the appropriate message can be issued about resetting to nil only when not `quit'. Make record_unwind_protect_restoring_int() non-static. dumper.c: Issue notes about incremental linking problems under Windows. fileio.c: Mule-ize encrypt/decrypt-string code. text.h: Spacing changes.
author ben
date Sun, 02 Mar 2003 09:38:54 +0000
parents e22b0213b713
children 88a2f43560bf
comparison
equal deleted inserted replaced
1332:6aa23bb3da6b 1333:1b0339b048ce
1 /* Portable data dumper for XEmacs. 1 /* Portable data dumper for XEmacs.
2 Copyright (C) 1999-2000 Olivier Galibert 2 Copyright (C) 1999-2000 Olivier Galibert
3 Copyright (C) 2001 Martin Buchholz 3 Copyright (C) 2001 Martin Buchholz
4 Copyright (C) 2001, 2002 Ben Wing. 4 Copyright (C) 2001, 2002, 2003 Ben Wing.
5 5
6 This file is part of XEmacs. 6 This file is part of XEmacs.
7 7
8 XEmacs is free software; you can redistribute it and/or modify it 8 XEmacs is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the 9 under the terms of the GNU General Public License as published by the
405 LHEADER_IMPLEMENTATION (backtrace[i].obj)->name, 405 LHEADER_IMPLEMENTATION (backtrace[i].obj)->name,
406 backtrace[i].position, 406 backtrace[i].position,
407 backtrace[i].offset); 407 backtrace[i].offset);
408 } 408 }
409 } 409 }
410 }
411
412 static void
413 pdump_unsupported_dump_type (enum memory_description_type type,
414 int do_backtrace)
415 {
416 stderr_out ("Unsupported dump type : %d\n", type);
417 #ifdef WIN32_NATIVE
418 stderr_out ("Are you compiling with SUPPORT_EDIT_AND_CONTINUE?\n");
419 stderr_out ("See the PROBLEMS file.\n");
420 #endif
421 if (do_backtrace)
422 pdump_backtrace ();
423 abort ();
410 } 424 }
411 425
412 static void 426 static void
413 pdump_bump_depth (void) 427 pdump_bump_depth (void)
414 { 428 {
543 if (desc1) 557 if (desc1)
544 goto union_switcheroo; 558 goto union_switcheroo;
545 break; 559 break;
546 560
547 default: 561 default:
548 stderr_out ("Unsupported dump type : %d\n", desc1->type); 562 pdump_unsupported_dump_type (desc1->type, 1);
549 pdump_backtrace ();
550 abort ();
551 } 563 }
552 } 564 }
553 } 565 }
554 566
555 static void 567 static void
805 if (desc1) 817 if (desc1)
806 goto union_switcheroo; 818 goto union_switcheroo;
807 break; 819 break;
808 820
809 default: 821 default:
810 stderr_out ("Unsupported dump type : %d\n", desc1->type); 822 pdump_unsupported_dump_type (desc1->type, 0);
811 abort ();
812 } 823 }
813 } 824 }
814 } 825 }
815 } 826 }
816 827
940 if (desc1) 951 if (desc1)
941 goto union_switcheroo; 952 goto union_switcheroo;
942 break; 953 break;
943 954
944 default: 955 default:
945 stderr_out ("Unsupported dump type : %d\n", desc1->type); 956 pdump_unsupported_dump_type (desc1->type, 0);
946 abort ();
947 } 957 }
948 } 958 }
949 } 959 }
950 960
951 static void 961 static void
995 int i; 1005 int i;
996 Elemcount count = Dynarr_length (pdump_root_struct_ptrs); 1006 Elemcount count = Dynarr_length (pdump_root_struct_ptrs);
997 pdump_static_pointer *data = alloca_array (pdump_static_pointer, count); 1007 pdump_static_pointer *data = alloca_array (pdump_static_pointer, count);
998 for (i = 0; i < count; i++) 1008 for (i = 0; i < count; i++)
999 { 1009 {
1000 data[i].address = (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress; 1010 data[i].address =
1001 data[i].value = (char *) pdump_get_entry (* data[i].address)->save_offset; 1011 (char **) Dynarr_atp (pdump_root_struct_ptrs, i)->ptraddress;
1012 data[i].value =
1013 (char *) pdump_get_entry (* data[i].address)->save_offset;
1002 } 1014 }
1003 PDUMP_ALIGN_OUTPUT (pdump_static_pointer); 1015 PDUMP_ALIGN_OUTPUT (pdump_static_pointer);
1004 retry_fwrite (data, sizeof (pdump_static_pointer), count, pdump_out); 1016 retry_fwrite (data, sizeof (pdump_static_pointer), count, pdump_out);
1005 } 1017 }
1006 1018