debug cmd.exe build only

All development related issues welcome

Moderator: Moderator Team

Post Reply
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

debug cmd.exe build only

Post by HansH »

is it possible to debug a single cmd.exe build under win32 xp

I did a make cmd only, just to test the compatabilty of the generated cmd.exe.
Because I found some strange effects on some of my .cmd files, I was wondering if there was a
simple way to see the TRACE() output lines in the sources from the cmd.exe
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

Re: debug cmd.exe build only

Post by HansH »

Never mind. I have got it working.

I used the cmd source files to create a new project, and adapted some sourcecode to get it working in vc++
I now have a 130kb cmd.exe which is working correctly in windows xp

It is very interesting to see how everything works.
I have done lots of tests, and so far I can see it is workng 100% correctly.

I have made some small adaptions, making tracelogging work dynamic, and loading/executing a batch file from memory, avoiding filelocks and fileread actions during execution.

Thx
User avatar
EmuandCo
Developer
Posts: 4723
Joined: Sun Nov 28, 2004 7:52 pm
Location: Germany, Bavaria, Steinfeld
Contact:

Re: debug cmd.exe build only

Post by EmuandCo »

Source might be interesting for us ... :roll:
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

If my post/reply offends or insults you, be sure that you know what sarcasm is...
vicmarcal
Test Team
Posts: 2733
Joined: Mon Jul 07, 2008 12:35 pm

Re: debug cmd.exe build only

Post by vicmarcal »

HansH wrote:

It is very interesting to see how everything works.
I have done lots of tests, and so far I can see it is workng 100% correctly.

Thx
Of course, Goplat made a cool job and cmd.exe was my first area here in Ros.i made a couple fixes with several commands :)

Yeah please create s bugreport and add your enhancements :)
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

Re: debug cmd.exe build only

Post by HansH »

Perhaps some info first, to see if it is interesting for you:

Because I made a seperate project in vc++, I could define an alternate definition for TRACE()
Just pointed it to a custom trace function which default does nothing.
if inside the cmd.exe a certain environment var is set, the trace function starts to output the TRACE info until the environment var is unset again.
No idea if this is possible within the reactos environment.

The other thing I did, is to load the full batch file into memory.
The current way is to open a file and keep it open during processing and use SetFilePointer to navigate.
With an internal call, the file is again opened
My change is to add some vars in the bc structure and to read the batchfile into memory and to add some logic into the batch function
to prevent that the same filename is reread again, So that way no file is kept opened or locked.
The downside it costs you memory.

So if this is interesting, i will post the enhancements/changes as a bugreport tomorrow.

great source....learned a lot again :)

Hans
User avatar
Davy Bartoloni
Posts: 1485
Joined: Wed Jan 04, 2006 11:31 pm
Location: Cuneo
Contact:

Re: debug cmd.exe build only

Post by Davy Bartoloni »

it would be nice :)
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

Re: debug cmd.exe build only

Post by HansH »

Ok,

bugreport 5806 : dynamic TRACE output to cmd console
bugreport 5807 : Replace FILE IO with Memory IO for batchfiles.
Haos
Test Team
Posts: 2954
Joined: Thu Mar 22, 2007 5:42 am
Contact:

Re: debug cmd.exe build only

Post by Haos »

The files you attached are not the proper patches. Please checkout a ReactOS trunk source tree and introduce the changes there. Then please make sure it compiles and works correctly. Finaly, please create a DIFF file for reach bugreport/feature and attach it to bugzilla, to the reports you have already opened.
HansH
Posts: 9
Joined: Fri Dec 31, 2010 12:23 am
Location: Netherlands

Re: debug cmd.exe build only

Post by HansH »

Aahh, mist that one ....

Patches are now attached, diff are done against the trunk
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests