VOGONS


First post, by doshea

User metadata
Rank Member
Rank
Member

Hi all,

I would like to contribute a patch for the debugger, but the "Patches" forum only allows posting by moderators.

My patch provides the following functions:

1. The F3 key re-enters the previous command, just like in the COMMAND shell. No moving back and forth in the history though, sorry!

2. A new "MCBS" command which shows information about Memory Control Blocks, like running a "MEM /C" command but a bit lower level:

  47474293: MISC:MCB Seg  Size (bytes)  PSP Seg (notes)  Filename
47474293: MISC:Conventional memory:
47474293: MISC: 0158 16 0008 (DOS)
47474293: MISC: 015A 64 0000 (free)
47474293: MISC: (data addr 015B:0008 is 8 bytes past this MCB)
47474293: MISC: 015F 256 0040
47474293: MISC: 0170 192 017E
47474293: MISC: 017D 130688 017E INSTALL
47474293: MISC: 2166 272 017E INSTALL
47474293: MISC: 2178 576 017E INSTALL
47474293: MISC: 219D 752 017E INSTALL
47474293: MISC: 21CD 516880 0000 (free)
47474293: MISC:Upper memory:
47474293: MISC: 9FFF 196608 0008 (DOS) SC
47474293: MISC: D000 65520 0000 (free)

I used this new command to help me write a TSR-like wrapper which logs some data from within a game's memory. Since I had to manually work out which MCB the data was in, I also added the following feature to this command:

If your "Data Overview" is pointing to an address which lies within an MCB, the output will indicate the offset of the address within the MCB:

DEBUG: Set data overview to 015B:0008
22786822: MISC:MCB Seg Size (bytes) PSP Seg (notes) Filename
22786822: MISC:Conventional memory:
22786822: MISC: 0158 16 0008 (DOS)
22786822: MISC: 015A 64 0000 (free)
22786822: MISC: (data addr 015B:0008 is 8 bytes past this MCB)
[...]

How should I go about submitting this patch?

Thanks in advance,
David

Reply 1 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

just add it here and the topic will be moved by a moderator

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 9, by doshea

User metadata
Rank Member
Rank
Member

Thanks, moderator! Patch is attached to this post.

Reply 3 of 9, by doshea

User metadata
Rank Member
Rank
Member

Should I have submitted this as a patch on SourceForge.net instead/as well, or is there something else I can do to get my patch reviewed and/or accepted?

Reply 4 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It will be looked at when we are dealing with the debugger code.
It is not forgotten

Water flows down the stream
How to ask questions the smart way!

Reply 5 of 9, by doshea

User metadata
Rank Member
Rank
Member
Qbix wrote:

It will be looked at when we are dealing with the debugger code.
It is not forgotten

Great, thanks!

Reply 6 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Some small things:

 Bit32u dataAddr = (dataSeg<<4) + dataOfs;

We have functions and typedefs for this kind of stuff.
and we have a function safe_strncpy which could be used in the f3 saving code.
Feel free to adept the patch to match that. Else I'll do that once I add some more stuff to debugger.
The patch looks fine otherwise.
I'm thinking of having a special debug command DOS which could MCBS as sub function. (and things like filetable, and fields of the DTA. (PSP etc))

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 9, by doshea

User metadata
Rank Member
Rank
Member

G'day,

Qbix wrote:
Some small things: […]
Show full quote

Some small things:

 Bit32u dataAddr = (dataSeg<<4) + dataOfs;

We have functions and typedefs for this kind of stuff.

Oh yes, when I just looked I saw PhysMake(), however I'm pretty sure that when I'd looked previously I'd just seen the shift and add style code I used above. I much prefer the idea of the macro, though!

and we have a function safe_strncpy which could be used in the f3 saving code.

Sounds good!

Feel free to adept the patch to match that. Else I'll do that once I add some more stuff to debugger.

I'm not sure when I'll get to update it, hopefully in the next few weeks. If and when I do, I'll attach an updated patch.

The patch looks fine otherwise.

Thanks!

I'm thinking of having a special debug command DOS which could MCBS as sub function. (and things like filetable, and fields of the DTA. (PSP etc))

Sounds like a good idea, there could potentially be lots of those things! I'm afraid that right now I don't want to volunteer to do that, sorry 😀

Thanks,
David

Reply 9 of 9, by doshea

User metadata
Rank Member
Rank
Member
Qbix wrote:

commited

Thanks! Sorry I never got around to tidying it up!