Home > Software engineering >  Vc2013, in the process of debugging, how to view the superior function parameter values?
Vc2013, in the process of debugging, how to view the superior function parameter values?

Time:09-16


Main interface function rapid cycling to write data in the database
Write_data (pBuffer2, temp1, length1);
The temp1 in single CPP in a function as a centralized processing

Void unix_to_date (unsigned long long time, char * date)
{
Unsigned long long second=time/1000;
Unsigned int milli=time % 1000;

Time_t timeT=(time_t) second;

If (timeT> 100000000000)
{//output debugging information

}
* struct tm ptime.
Ptime=localtime (& amp; TimeT);

If (ptime==NULL)
{//output debugging information

}


Strftime (date, DATE_TIME_STRING_LENGTH + 1, "% % Y - m - H: % d % % m: % S", ptime);//the data here is need to eventually return to the time data
//strftime (date, 100, "% % Y - m - H: % d % % m: % S", ptime);
Char milli_str [5].
Sprintf (milli_str ". % 3 d ", milli);
Strcat (date, milli_str);
}


During the execution of a program (write very fast cycle), to a certain time will collapse, the problem is ptime null values, view timeT and transfer time is a great value, at this time how to examine the problems in the main interface function value, add supervisors tips beyond the scope of!!!!!
Because the program runs quickly, can't see what main interface to which the problem of for loops, and the cycle number is a big

CodePudding user response:

Add ASSERT, debug version will play a window, and then click retry can see the call stack
If (XXXXXX)
{
//parameter error
ASSERT (FALSE);
}

CodePudding user response:

reference 1st floor zgl7903 response:
add ASSERT, debug version will pop-up window, and then click retry can see the call stack
If (XXXXXX)
{
//parameter error
ASSERT (FALSE);
}

To study the

CodePudding user response:

Seems not, there are other action?

CodePudding user response:

Ptime=localtime (& amp; TimeT);
ASSERT (ptime!=NULL);

CodePudding user response:

ASSERT to view?

CodePudding user response:

Convert a time value and correct for the local time zone. More secure versions of these functions provides are available; See localtime_s, _localtime32_s, _localtime64_s.
Is the localtime might be unsafe factors, it is recommended to use localtime_s


CodePudding user response:

Conditional breakpoints, right-click on the breakpoint points, set up the conditions,

CodePudding user response:

DebugBreak ();
  • Related