Menu

#376 DEBUG.EXE changes segment addresses after program exit. DEBUG from MS-DOS doesn't.

freedos14
open
nobody
None
5
2025-01-03
2023-04-30
Oliver
No

When i start a simple program, like a hello world, with "g" in FreeDOS's DEBUG the values in the segment registers changes between the status before the run of the program and the and after the normal program termination.

When i do the same in MS-DOS's DEBUG version, the segment registers are not changed.

See the two screenshots:

2 Attachments

Discussion

  • E. C. Masloch

    E. C. Masloch - 2023-05-01

    You can largely emulate this behaviour of MS Debug in FreeDOS Debug/X (or my fork lDebug) by entering an L command (no parameters) after the program has quit. This will reload the original debuggee process with the last effective N command setting, which will be unchanged if you did not enter any N commands.

    Or you can use the free software version of the original Microsoft Debug, available from our server

     
  • E. C. Masloch

    E. C. Masloch - 2023-05-28

    I changed MSDebug so it is more similar to FreeDOS Debug/X and lDebug in this regard. The old process termination behaviour is preserved in the repo history of MSDebug, or in the past "current release" at https://pushbx.org/ecm/download/old/msdebug/20220813.zip

     
  • E. C. Masloch

    E. C. Masloch - 2023-06-25

    The new behaviour makes it so the debugger is always attached to a client process, but will be able to terminate this process upon an L (or lDebug QA) command to free its memory. The old MS-DOS Debug way seemed to leak some memory on repeated L commands, and the "empty process" created initially was allocated within Debug memory rather than in its own memory block.

    I also just tested with the 2022-08-13 MSDebug and if you have a child process (loaded like with L command) that terminates, then the resulting CS:IP will point into free memory which is not good. If the client program does allocations, a subsequent run could corrupt the client.

    I think the new way is preferable.

     
    👍
    1

Log in to post a comment.