This patch is supposed to bring the Pure Debugger to modern times. The problem is, that (AFAIK) ASH is not allowed, for license reasons, to make an update by themselves. Therefore somebody else had to do it without the source code. Since I like using PD I did it. Problems of PD I know of, theire conditions of occurrence, and theire status (S = solved, N = not solved, U= understood but still unsolved): NR. SNU occurence Explanation 1 U Multitasking Sometimes at leaving PD the left Mousebutton seams pressed 2 S MagiC PC can't start PD as singletask 3 S MagiC... PD does not closes open files on 'Program reset' -> on restart Fopen produces an error 4 S always PD does not uses XBRA 5 S always PD redirects vectors but does not test if a program, jumping over these vectors is PD or anybody else -> for example if a program, running parallel to PD finishes (Pterm) PD assumes, that this means, that the program to debug has finished. 6 U Graphiccard changing screen per Setscreen does not work 7 S always On running the first program, PD prints an ESC H -> if a console window (Gemini,...) is open, the Cursor goes to the upper left corner. 8 S multitasking sometimes the wrong Menu is visible 9 S MINT PD does not work at all, I was tolled 10 S 2 monitors this is not solving an error, but adding a new feature: you can now run PD on 2 monitors 11 S ? Sometimes the mouse cursor disappears 12 S multitasking PD sometimes try to get memory at the top end, this routine sometimes fails under multitasking OS and always under MagiC. Normely this has no direct effect, since PD reserves mamory at a random position in this case. 13 S ? For some time the one monitorversion, including the unpatched PD halted when it tried to change the screen by Setscreen. Since changing the method in the option menu did not helped an other patch become nessessery 14 S >Gemdos0.19 PD memorizes all Malloc actions to be able to free this memory in program reset. But it ignores Mxalloc General ******* To add new routines, some addresses in PD have to be known. This addresses are stored in PD_ADDR.DAT. On the first run Patch tries to find this adresses and stores them for future use. But this is not foolproof: - The searched routines have changed (different PD version than mine)-> wrong or no address found - Somewhere else something has changed, so that by chance it looks like the routine -> it seams to be found twice. If none or more then one occurrences are found, an error message is issued. Since not all addresses are needed for every patch, you can still try. If a needed adress is unknown the patch will stop. For easier control, there will be a textversion of pd_addr.dat written: pd_addr.txt How does it works ***************** a) Run PATCH.PRG and answer the following questions: a) One or two-monitor-version?: what ever you want. see 10) b) May Setscreen be used? (will only be asked if patching a 1-monitor PD. Ja=Yes; Nein=No First try using Setscreen. Only if this produces a crash then make an other patch and answer with no (Nein) see 13) c) When putting out ESC H ?: s. 7) 'nie'=never;1. Run; 'jedes Run'=every run b) if you wish to run the new PDs out of PC: copy the PD.PRG into the PC-directory. Therefore you have to rename the original PD.PRG c) test it If you want to change something in the patch yourself please set the options in PC as follow: Compiler: -C, -P Assembler: -S Linker -G, -L, -F, Stacksize 100000 usualy I also have -Y set in all 3 categories, but this is not mendatory. Now I also set this options in the PRJ-File, so setting them explicitly in PC is probably not nececerry anymore. If for whatever reasens you are using an other Compiler but PC, don't expect to have no problems. The different problems and their solutions ****************************************** 1) left mouse-button pressed ---------------------------- Since menus, windows and the like are not drawn by AES in PD, but are drawn directly by VDI on the screen, they are kind of invisible to mouse clicks. The only reason there are not more problems is because PD runs in supervisor mode, but at the end of the programm problems occure. I tried solving this problem using wind_update(BEG_MOUSCTRL) but received some strange effects. 2) Running PD as single task (MagiC) ------------------------------------ To be able to run PD out of PC in single task I wrote a starter (START_PD). It starts PD by sending a message (AV-Protocol) to the shell. If this shell understands AV it should find out, if PD has to be run in single task and if so start it in single task. There has been a problem with the desktop EASE, it did not gave PD the comandline. If you press the ALTERNATE button while starting START_PD it will ask some questions: singeltask or multitask 1 or 2 monitors (PD_1.PRG or PD_2.PRG) To make it clear, telling the starter to start PD as singeltask only works, if the AV-Server does it. 3) open files ------------- If at the end of the program (the one to be debugged) or on a break there are still files open, the will still be open on a new run. Some OS like MagiC realise, that this file is tried to be opened for a second time and exit an error. My solution is to log the calls of Fcreate, Fopen and Fdelete. On 'program reset' these files are closed automaticly. Until now only handles between 6 and 63 are observed. If this should not be enough, change p_flags in PDX, and all routines using it. But the worst case possible is that PD reacts for files with handle >63 as it used to with any handle. 4) XBRA ------- I introduced a XBRA structure for all routines changed by Setexc. The ID is 'PDeb' for PD_1 and 'PDEB' for PD_2. The XBRA-Impementation is complet now, meening, that also deinstalling is done by XBRA. But since PD is to be used with unfinished software, this is not always possible. So if the deinstalling routine does not find it's own ID, it will reset the vector to the original state. The reasen for using 2 ID's is, to be able to debug PD_1 with PD_2. 5) identification of caller --------------------------- PD does not test who is jumping over changed vectors. In single task this is fine, but not in multitasking. One very 'nice' error occurs, when you end a program running parallel to PD. PD exits the message 'program terminated' and exits the run modus. But the program which was debugged is still runnig, even after finishing PD! Don't ask me what this can couse for problems (who ownes the memmory,...). Before finding out I always pressed reset. Now PD saves the adress of it Basepage at the beginning. Everytime a changed vector (XBRA) is used, it is tested if it's PD or not. Either the original routine is used or the PD one. This patch needs 4) and is needed for 3). For every rule there is an exeption. PD uses the hardcopy Interrupt as a break. () If this would be only active while PD is executetd, this would mean that you have to press for some time. Since this routine only sets a flag, there is no problem of letting it being active even if a other programm is executed. This flag is tested during the vertical Blanc routine. Meaning, that the is memorized at all time, but that PD only reacts if there is a vb during the time PD is executed. So if PD does not react try pressing a button, moving a Window of the programm debugged,... 6) Setscreen ------------ PD reserves ST-RAM for a 2nd and 3rd screen, then it trys out if Setscreen is working. Setscreen would work on some graphic-cards (NOVA,...) if their RAM and not ST-RAM would be used. So i tried to fake the malloc, but without success. The problem seems to be, that NOVA-RAM starts at 0xFEC00000 which is negative... . As a partial solution TT-Ram is used in case a graphic card is reccognized. By now only NOVA cards are recognized by: if (get_cookie('IMNE',(long *)&icb)) X_pd.p_bs_m=3; for other graphic cards, the if-condition can either be changed to recognize other cards by adding '||...' or if the card is always used by deleting the if totaly. X_pd.p_bs_m includes the Mxalloc modus. It is usualy 0, but will be changed here to 3. This patch is only included in the one-monitor-patch. 7) ESC H -------- On the first RUN PD prints ESC H, if a console window(Gemini,...) is open, the cursor goes to the upper left corner. If this is wanted or not can be chosen by everybody self. I introduced 3 possibilities: a) never printing ESC H b) only at the first RUN (as in the original) c) at every RUN 8) Menu title ------------- In multitasking environments sometimes the wrong Menu is visible, even if the right one is active. I did not found all circumstances under which it occurs. Therefor I only added an automatic redraw of the menu shortly after the start of the program, and for all other cases I added an manual possibility. Just click in the menu line (y<18) and the menu is redrawn. Of course this should be done in the right unused part of the menu. This is only included in the one-monitor-solution, since this problem does not exist with 2 monitors. 9) MINT ------- I don't know. I never installed MINT, I am not actually interested in it. But Thomas Knneth and Chris Felsch wrote a starter which makes it possible to run PD under MiNT. I included this starter in my own ( see 2) ) and so it should be possible to use PD under MiNT now. 10) two monitors ---------------- This was the reason I started writing this patch in the first place. With this version it is possible to use 2 monitors, similar to the very good program, SYSMON. It is quite difficult to redirect AES-output, even more to a different resolution. But luckily this is not necessary, since PD only uses VDI-calls. Therefore it is only necessary to open a OFF-Screen Bitmap and return PD that handle instead to the one expected of v_opnvwk. Besides the mouse curser has to be drawn by PD it selve. But all this problems are solved under some conditions: - VDI which supports OFF-screen bitmaps, either per v_opnvwk2 (NOVA-VDI) or by v_opnbm (NVDI, NOVA and others if the EdDI-cookie is present with version >=1.1) -ATARI-compatible monitor and second monitor by graphic card is present. Problems could occur, if a second program, uses two monitors too, but the only othe program doing so I know off, SYSMON works together with my one just fine. There had been Problems with the programm BLACKSCR.PRG, which sets all colors of the 2nd monitor to black. This has only an effect in the monochrome mode on TTs. Thatfore if it is a TT I now set the colors to black/white. Now I use a PC with MagiC PC. Since there I only have one monitor, I can actualy not use this feature myselv anymore 11) disappearing mouse cursor ----------------------------- As I never observed this error by my self, or at least don't remember observing it, which probably is mainly caused by the fact, that I almost always use PD with 2 monitors, I only introduced a symptomatic solution. If the cursor disappears, just press the right mouse button and it should reappear. This is until now untested, but I am optimistic. If somebody manages to produce a reproducible state in which this error occurs, then please let me know, and I may find a better solution. 12) Malloc for high memory -------------------------- While trying to further improve my XBRA implementation (s. 4)) I analysed a routine and realized, that it had 2 errors. PD sometimes try to get memory at the top end. That fore it first reserves all memory (in a loop containing Malloc(-1)) this fails if a other programm reserves memory in the meantime. This could be solved by changing the break - condition. Then PD looks for the highest so reserved block and trys to split it so, that tho top part gets the needed size. This does not funktions under MagiC, since there 32 extra Bytes are reserved with any Malloc. For examble if the Block has 3000 Byte and PD needs 1000, PD shrinks (Mshrink) the Block to 2000 and trys to reserve 1000 But under MagiC there are only 1968 Bytes left. To be on the safe side I now always shrink to 64 Bytes less then required under TOS -> I spoil 64 Bytes under TOS, 32 under MagiC. But maybe some other OS needs more. Of course I could calculate the exact length needed, but to save a few byte this is not sensible, certanly not if the produced code would be longer than the saved memory 13) Setscreen for 1 monitor --------------------------- This patch is optional and should only be used if PD otherwise does not run. I just exchanged the original Setscreen by an empty function: {} this works because PD checks after using Setscreen if it was sucsessful, and if not uses an other way of changing the screen 14 Mxalloc ---------- Since I already introduced my own Fopen, Fcreate and Fclose I decided to include a complete Version of the Gemdos Dispatcher into the Patch. This also includes Mxalloc, where as with Malloc in the original PD all memoryallocation is memorized 15) other changes ----------------- as said in 9) I will try to solve other problems with PD anybody tells me off. It has a good reason, that I include the source code. So anybody can include patches by himself, this is needed either when I am not reachable or if it's a problem I don't have on my configuration. But I recommend, that every change/addition is brought to my attention. I then will include it in a new public version. This definitely includes the case, that GET_ADDR does not finds an address by itself but you find it by yourself. Fairware -------- This program is Fairware, it may be copied freely, but if somebody needs to get rid of some mo- ney... Thanks to --------- Bernhard Held volunteered as ž-tester. Thomas Knneth and Chris Felsch for their MiNT-starter Wilfried Behne for his help in searching an error (in my patch) in connection with NVDI. !!!!!!!!!!!!!!! ! Attention ! !!!!!!!!!!!!!!! On no circumstance PD, either the original or a patched version may be exchanged without the prior approval of ASH. This program may only be used to patch officially bought versions of the Pure Debugger. This is especially true, since some routines (xbra_exc and xbra_Gd_trm) included in the source code are variations of the original PD code. These are specially marked. Exeption, I will give a patched version to ASH. Probably they will put it in their BOX, so that it is accessible to registered users. But since there are some options on patching PD, this is only 2nd best to patching it by yourself. Author ------ Dimitri Junker E-Mail: Dimitri_Junker@AC3.maus.de or for long mails (>16k): Junker@popmail.oche.de