Trying to debug my application, developed under eVC, on the target (QTEK 9090) but not finding much in the way of information about it.
I assume it's possible, do I need any other tools to do it?
Cheers,
Geoff.
- It is currently Thu May 23, 2013 6:08 am • All times are UTC + 2 hours
Target debugging
6 posts
• Page 1 of 1
Hi Geoff,
if you have everything installed properly than you can debug your application on the emulator directly from eVC (Build->Start Debug->F5)
If you want to debug on your device than you have to use debug functions:
1. this is what i'm using :
void _debug(TCHAR *szFormat, ...)
{
TCHAR szBuffer[1024]; //in this buffer we form the message
const size_t NUMCHARS = sizeof(szBuffer) / sizeof(szBuffer[0]);
const int LASTCHAR = NUMCHARS - 1;
//format the input string
va_list pArgs;
va_start(pArgs, szFormat);
// use a bounded buffer size to prevent buffer overruns. Limit count to
// character size minus one to allow for a NULL terminating character.
_vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);
va_end(pArgs);
//ensure that the formatted string is NULL-terminated
szBuffer[LASTCHAR] = TEXT('\0');
//write the file
FILE *f = _tfopen(TEXT("\\Debug.txt"),TEXT("a"));
_ftprintf(f, TEXT("%s\n"),szBuffer);
fclose(f);
}
you just insert (for example for a string and an int / DWORD value):
_debug(L"szText:%s nNumber:%d", szText,nNumber);// after the line you want to debug
In Visual Studio 2005 this has changed. There is an article about it :
http://msdn.microsoft.com/library/defau ... ration.asp
Cheers,
Raul
if you have everything installed properly than you can debug your application on the emulator directly from eVC (Build->Start Debug->F5)
If you want to debug on your device than you have to use debug functions:
1. this is what i'm using :
void _debug(TCHAR *szFormat, ...)
{
TCHAR szBuffer[1024]; //in this buffer we form the message
const size_t NUMCHARS = sizeof(szBuffer) / sizeof(szBuffer[0]);
const int LASTCHAR = NUMCHARS - 1;
//format the input string
va_list pArgs;
va_start(pArgs, szFormat);
// use a bounded buffer size to prevent buffer overruns. Limit count to
// character size minus one to allow for a NULL terminating character.
_vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);
va_end(pArgs);
//ensure that the formatted string is NULL-terminated
szBuffer[LASTCHAR] = TEXT('\0');
//write the file
FILE *f = _tfopen(TEXT("\\Debug.txt"),TEXT("a"));
_ftprintf(f, TEXT("%s\n"),szBuffer);
fclose(f);
}
you just insert (for example for a string and an int / DWORD value):
_debug(L"szText:%s nNumber:%d", szText,nNumber);// after the line you want to debug
In Visual Studio 2005 this has changed. There is an article about it :
http://msdn.microsoft.com/library/defau ... ration.asp
Cheers,
Raul
- sad_ghost
- TEK-Giant

- Posts: 269
- Joined: Thu Apr 06, 2006 11:04 am
Thanks Raul, the emulator is working fine but it is a bluetooth application and the documentation tells me that the emulator does not support bluetooth.
So it is not possible to attach to the application on the device via active sync and set break points etc.
Why do they have debug build options for the target processors?
So it is not possible to attach to the application on the device via active sync and set break points etc.
Why do they have debug build options for the target processors?
- Geoff
- TEK-Seeker
- Posts: 22
- Joined: Fri May 05, 2006 12:45 pm
Hi Geoff,
the answer is because they also provide emulators for the target processors. Any device that we buy and use has its OS based on a general one released by MSFT to the OEMs (this guys are making customizations integrating different drivers for there hardware and so on). But the core of the OS is the same on any for instance 2003 SE device (for that you have the emulator).
BTW,
You can use the debug function i posted in any situation (for any type of variable) even yours.
the answer is because they also provide emulators for the target processors. Any device that we buy and use has its OS based on a general one released by MSFT to the OEMs (this guys are making customizations integrating different drivers for there hardware and so on). But the core of the OS is the same on any for instance 2003 SE device (for that you have the emulator).
BTW,
You can use the debug function i posted in any situation (for any type of variable) even yours.
- sad_ghost
- TEK-Giant

- Posts: 269
- Joined: Thu Apr 06, 2006 11:04 am
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests