home *** CD-ROM | disk | FTP | other *** search
- /***************************************************************************/
- /* */
- /* File : DEMOTXT.C */
- /* */
- /* Version : 1.0 */
- /* Date : 08/30/91 */
- /* */
- /* Author : Ernest Vogelsinger */
- /* */
- /* Description : Explanatory text strings for the DMalloc demo program */
- /* */
- /* History : 08/05/92 EV Texts changed for DMalloc 1.0! */
- /* */
- /* */
- /* (c) E.Vogelsinger 1991, 1992 */
- /***************************************************************************/
-
- char *any_key = "Please press any key to continue...\n";
- char *any_prtsc = "\nPlease press <PrintScreen> now, and, after returning, any key.";
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *welcome[] = {
-
- " Welcome to the demonstration program for DMalloc v.1.0.",
- "",
- " This program will take a short tour through the features and possibili-",
- " ties of DMalloc. Having reached this point, you have already seen the",
- " DMalloc startup screen and you have pressed F5 or F10 to start the",
- " demo program.",
- "",
- " This demo was compiled with Microsoft(R) C 7.00, and linked together with",
- " the DMalloc library. You will certainly see that some debugging\'s",
- " necessary here, since the demo program contains a lot of bugs...",
- "",
- " Just kidding. These bugs were wittingly built into the demo to demonstrate",
- " some of the powerful debugging capabilities of DMalloc."
- "",
- " Now, this text is printf()\'ed at the very beginning of the main() function.",
- "",
- " Please press any key to begin.",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain1[] = {
-
- " Now the demo allocates some memory. Please note that DMalloc checks the",
- " heap in regular intervals -- you can see the \"Please Wait\" sign flash.",
- " This is done automatically. The checking interval may be specified by you",
- " by modifying the setup values.",
- "",
- " The demo consists of three modules: module1.c, module2.c, and module3.c.",
- " Modules 1 and 2 were compiled with complete DMalloc information, and",
- " module 3 is compiled without. All three modules allocate memory by calls",
- " to malloc, calloc, and realloc.\n", "",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain1a[] = {
- " The three modules have now allocated 1200 pointers. Since the default",
- " configuration of DMalloc is to check the heap every 100 calls to one",
- " of the functions of the malloc group, it checked the heap 11 times. Since",
- " the heap is OK at the moment, nothing special has happened.",
- " Please press any key to continue.",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain2[] = {
- " You may now use DMalloc to have a deeper insight into the secrets of the",
- " demo program's memory. Please press the <PrintScreen> key to popup DMalloc.",
- "",
- "",
- " Sorry, the demo cannot help you while you are in DMalloc. ",
- " After pressing PrintScreen, look at the bottom of your screen to see the",
- " function keys that are available. You may press F4 (\"View\") to hide the",
- " DMalloc windows and see this screen.",
- "",
- " Please note that these memory blocks that have been allocated by module",
- " 1 and 2 are shown with full information, and that the other blocks (that",
- " have been allocated by module 3) show \"??unknown\" as owner since this",
- " module has not been compiled with DMalloc information.",
- "",
- " Navigate through the heap entries using the Up, Down, PgUp, and PgDn keys.",
- " Press Enter or F3 (\"Dump\") to see a hexdump of the selected block.",
- " Press F7 (\"Status\") to review the total heap status.",
- " Press F5 (\"Go!\") at any time to go back to the demo.",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain3[] = {
- " The demo will now do some very nasty things: allocated blocks will be",
- " written out-of-bounds for one or more bytes - things that easily may occur",
- " when developing a \"real\" program. One of the blocks will be tampered at",
- " the bytes before the block's begin; this would normally lead to a malloc",
- " crash (or infinite loop) since it would overwrite the malloc unit info.",
- " Please note that DMalloc detects when you write an even number of bytes",
- " to a block that was allocated with odd size. With most malloc implemen-",
- " tations this problem would never be detected since blocks are always allo-",
- " cated even sized. DMalloc still warns you about this situation.",
- "",
- " On the next access, DMalloc will check the heap again and detect the bad",
- " things the demo has done. Watch out!",
- "",
- " Please press any key now to be a bad guy... (and caught by DMalloc)",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain4[] = {
- " To easily navigate through corrupted blocks you can use the Right and Left",
- " keys - the window bar will stop only on elements that have been corrupted.",
- "",
- " Another possibiliy to get a quick overview on memory regions where some",
- " problem has been detected is to select what should be displayed in the main",
- " window. Press <F6> to display the selection window. At the field \"Allocated",
- " units\" switch to \"No\" by pressing the space bar, and then press <F10> to",
- " go back to the main window. The only elements that are displayed now are",
- " the program segments and these allocation units that have been corrupted.",
- "",
- " Press <PrintScreen> now and try the Right and Left keys, and use the",
- " selection window as described above.",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain5[] = {
- " DMalloc will warn you when invalid pointers are passed to realloc() and",
- " free(). In this case, the pointer passed to free() could cause desastrous",
- " consequences, since it points into the DOS area. Freeing this pointer",
- " would modify a byte in DOS memory...",
- "",
- " With DMalloc, you have the choice to discard the pending action, to con-",
- " tinue and do what the program intends to do (not recommended), or to exit",
- " the program. Whenever DMalloc pops up (except after pressing <PrintScreen>)",
- " you may exit the program or set a debugger breakpoint. To set a breakpoint,",
- " step back to the topmost window using <F10>, press <Tab> or <Enter> to get",
- " to the breakpoint field and select from three types: SoftIce, CodeView, or",
- " generic Int 3 by pressing the space bar.",
- " If you have SoftIce running, try using the SoftIce breakpoint when DMalloc",
- " pops up now. If not, try it later.",
- " The activated debugger will wake up at the statement following the",
- " interrupted call. Usually the statement is \"ADD SP, +(n)\".",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain6[] = {
- " DMalloc can be configured to perform a nullcheck whenever it is checking",
- " the heap. The demo program will now write to the null region of the data",
- " segment. This will usually be detected when the program exits.",
- " Using DMalloc you can detect it when you need to know it.",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain6a[] = {
- " Please note:",
- " At program exit you will see a runtime error generated by the C library.",
- " This is what it should do since we did (!) write to the null region of the",
- " data segment!",
- 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain7[] = {
- " There is a lot more functionality to DMalloc than this short demo can show",
- " you. For example, you could tag some blocks (<F9>, <shift> <F9>,",
- " <ctrl> <F9>, or using 'T' und 'U' like the popular XTree(r) utility to pop",
- " DMalloc up whenever a tagged pointer is reallocated or freed. Or you may",
- " specify that DMalloc should pop up after a specific number of calls to",
- " malloc etc. Or you can insert calls to the DMalloc API to modify the",
- " DMalloc settings for a specific program region, to trigger DMalloc from",
- " within the program, or to simply set a debugger breakpoint.",
- " Have a look at the MODULE1.C source on how to do this.",
- "",
- " Please note that the DMalloc settings are always saved to a configuration",
- " file. The file name is <programname>.DMC (here: DMLDEMO.DMC). This allows",
- " you to have different settings for different projects. You may change the",
- " DMalloc window colors (<F2><F2>), the display selection (<F6>), and the",
- " size of the DMalloc tag table (at startup time). All settings will go",
- " to the configuration file.",
- "",
- " Please press any key for the last page of the demo.", 0 };
-
- /*\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\*/
- char *explain8[] = {
- " To prepare a program to use DMalloc, simply link it with an additional",
- " object (DMALLOC.OBJ), and supply the DMALLOC.LIB library. This will insert",
- " the code to track the malloc group functions. This method is simple, and",
- " will provide the full heap monitoring functionality. If you want to have",
- " more detailed information about the owner of memory blocks or want to",
- " interface to the DMalloc API, simply include the DMALLOC.H include file",
- " into the appropriate source modules, #define _DMALLOC (e.g. in the make",
- " file) and recompile it.",
- " Source modules compiled with DMalloc information require to be linked with",
- " DMALLOC.LIB. To quickly remove the DMalloc code, you may relink the pro-",
- " gram with a supplement library (DMCNONE.LIB) that resolves the references",
- " to DMalloc but doesn't pull the code in (very useful for beta site ver-",
- " sions).",
- " Finally, we will free some of the pointers that have been allocated,",
- " and then destroy the far heap by corrupting real critical allocation info.",
- " Normally, one of the next calls to malloc() or realloc() would freeze the",
- " machine since the heap is destroyed.",
- " Watch out for DMalloc how it reacts on this situation.",
- " Thank you for watching the DMalloc demo. ",
- " Ernest Vogelsinger (CIS 100015,551) ",
- " Vienna, Austria ", 0 };
-