Thinking The Smartest Debugging Ways

All development related issues welcome

Moderator: Moderator Team

Post Reply
User avatar
katayama_hirofumi_mz
Posts: 54
Joined: Mon Apr 05, 2010 5:43 am
Location: Japan
Contact:

Thinking The Smartest Debugging Ways

Post by katayama_hirofumi_mz »

Hi, I'm Katayama Hirofumi MZ; a Japanese coder. Happy New Year!

ReactOS remains many problems on code quality. I think we should raise the revolution of quality management to catch up the digital world's speed.

Shall we do brainstorming on debugging technique? Your ideas welcome!

[IDEA-1]
Insert more assertions in our codes. Debugging information (__FILE__, __LINE__, the last error etc.) should be available.

ASSERT(1 == 1); // OK
ASSERT(1 == 0); // NG, assertion failure

hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

I also think that there should be more checks, but they should not be enabled in ordinary dbg builds, only in special superdbg builds, which should be tested from time to time.

User avatar
katayama_hirofumi_mz
Posts: 54
Joined: Mon Apr 05, 2010 5:43 am
Location: Japan
Contact:

Re: Thinking The Smartest Debugging Ways

Post by katayama_hirofumi_mz »

>they should not be enabled in ordinary dbg builds

Hmm, how about adding "debugging console" in ReactOS to view debugging information (such as assertion failures)? Normal users can easily use that "debugging console"...

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

Re: Thinking The Smartest Debugging Ways

Post by EmuandCo »

Like our debugport=screen? It Even works from time to time. Depends in the Hardware you use.
ReactOS is still in alpha stage, meaning it is not feature-complete and is recommended only for evaluation and testing purposes.

hto
Developer
Posts: 2193
Joined: Sun Oct 01, 2006 3:43 pm

Post by hto »

Hmm, how about adding "debugging console" in ReactOS to view debugging information (such as assertion failures)? Normal users can easily use that "debugging console"...
Boot with ReactOS (Screen), it should switch to GSOD (Green Screen Of Debugger) when a crash occurs.

Also, you can boot with ReactOS (Log file) and read debug.log in, for example, Notepad.

TeamCtors
Posts: 4
Joined: Tue Jan 31, 2012 3:11 am

Re: Thinking The Smartest Debugging Ways

Post by TeamCtors »

katayama hirofumi (sorry if i misspelt your name) is getting somewhere, but why not do this:

Code: Select all

 Condition_X==SetValue ? Retrun TRUE | PrintDebugStatusRCT(opc_1,opc_2, DeviceLastCall) //proper C++ syntax. PrintDebugStatus is a theoretical function along with DeviceLastCall
problem is though, that somehow, a record of all op-codes processed would have to be kept, like a table along with the process that accessed the device. this is just an example though.

User avatar
katayama_hirofumi_mz
Posts: 54
Joined: Mon Apr 05, 2010 5:43 am
Location: Japan
Contact:

Re: Thinking The Smartest Debugging Ways

Post by katayama_hirofumi_mz »

Simply call me Katayama. Have you read class library's source code like MFC?
MFC includes ASSERT and VERIFY macros.

I recommend this:

Code: Select all

#if (in debugging)
#define VERIFY(x) ((x) ? TRUE : VerifyFail(__FILE__, __LINE__, #x))
#else
#define VERIFY(x) (x)
#endif
Or if you needs op-codes then:

Code: Select all

...
#define VERIFY1(x, opc1) ((x) ? TRUE : VerifyFail1(__FILE__, __LINE__, #x, opc1))
#define VERIFY2(x, opc1, opc2) ((x) ? TRUE : VerifyFail2(__FILE__, __LINE__, #x, opc1, opc2))
...
Preprocessor produces a literal string for #x, that expresses x itself.

Post Reply

Who is online

Users browsing this forum: DotBot [Crawler] and 5 guests