Patch: Debugger improvements: F3 key and "MCBS"

Here you can discuss the development of patches.

Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-5-30 @ 13:16

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:

Code: Select all
  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:

Code: Select all
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
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby Qbix » 2009-5-30 @ 17:06

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10707
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-5-31 @ 02:42

Thanks, moderator! Patch is attached to this post.
You do not have the required permissions to view the files attached to this post.
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-6-19 @ 11:47

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?
Hacking F-15 Strike Eagle III and DOSBox's debugger
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby Qbix » 2009-6-19 @ 12:05

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10707
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-6-19 @ 12:56

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


Great, thanks!
Hacking F-15 Strike Eagle III and DOSBox's debugger
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby Qbix » 2009-6-22 @ 09:39

Some small things:
Code: Select all
 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!
User avatar
Qbix
DOSBox Author
 
Posts: 10707
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-6-23 @ 00:51

G'day,

Qbix wrote:Some small things:
Code: Select all
 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
Hacking F-15 Strike Eagle III and DOSBox's debugger
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby Qbix » 2009-11-06 @ 13:56

commited
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10707
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Patch: Debugger improvements: F3 key and "MCBS"

Postby doshea » 2009-11-22 @ 07:30

Qbix wrote:commited


Thanks! Sorry I never got around to tidying it up!
Hacking F-15 Strike Eagle III and DOSBox's debugger
User avatar
doshea
Newbie
 
Posts: 10
Joined: 2009-5-22 @ 09:37
Location: Australia


Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest