Switch between Release, Debug or Profile build

Started by Pelle, November 27, 2004, 11:24:31 AM

Previous topic - Next topic

Anonymous

i had completely rewritten the parser, i have saved all posted prf files and will test them at home. sorry for the problems.  :oops:

Pelle

No problem - you said it was alpha. Looking forward to the next version...  =P~  8-[

Pelle
/Pelle

nitex

Here is the fixed version, hopefully no parsing problems anymore. At least all posted profiler logs were correct opened.

QuotePRF View History

Version 1.0.0.0 Alpha Build 3 (29.01.2005)
 - Fixed: The checks while parsing the *.prf file were changed. The parser now
   looks if it finds the chars -,.: in a line for profiling session date and
   time, or ,:() for function time, number of calls and function name.
 - Fixed: The parser sometimes stripped some chars from the function name.
 - New: Integrated dummy help file.

Version 1.0.0.0 Alpha Build 2 (28.01.2005)
 - Fixed: *.prf files were opened only if they layed in the program directory
   (blame on me)
 - Fixed: The banners in the option and about dialog disappeared sometimes if
   other windows layed over them.
 - Fixed: Layout of banners in dialogs should be correct now with bigger
   windows fonts
 - New: Owner Drawn Buttons with pictures, and option to disable them.
 - New: Parser is completely rewritten.

Version 1.0.0.0 Alpha Build 1 (21.01.2005)
 - First public release

Pelle

Rock 'n' Roll! Well done!  =D>  \:D/

Pelle
/Pelle

TBD

nitex: yupeee. now it works perfectly  =D>

maybe you can share with us how to render html pages using IExplore  :lol:

nitex

Have a look in the credits, there is a link to an article i used for embedding the Internet Explorer.

Alex

khyron

hi there,

just a little question about the debug, release and profile addin, if I create a new console project and press the prf button i get the following  errors:

POLINK: error: Unresolved external symbol '__imp__MessageBoxA'.
POLINK: error: Unresolved external symbol '__imp__wsprintfA'.
POLINK: fatal error: 2 unresolved external(s).

I usually solve it adding user32.lib in the linker section, is this the correct way of solving it? if it is maybe it could be useful if the addin added that library automatically for console based projects....

nitex

This can be easily fixed by modifying the SetLinkerFlags() function.

Change:
case ID_PROFILE:
{
lstrcpy(szNew, _T("-debug -debugtype:both profiler.lib"));
break;
}


To:
case ID_PROFILE:
{
lstrcpy(szNew, _T("-debug -debugtype:both profiler.lib user32.lib"));
break;
}


And:
/* Forget old options */
if (lstrcmp(psz, _T("-release")) == 0 ||
lstrcmp(psz, _T("-debug")) == 0 ||
lstrcmp(psz, _T("-debugtype:both")) == 0 ||
lstrcmp(psz, _T("-debugtype:coff")) == 0 ||
lstrcmp(psz, _T("-debugtype:cv")) == 0 ||
lstrcmp(psz, _T("profiler.lib")) == 0)
continue;


To:
/* Forget old options */
if (lstrcmp(psz, _T("-release")) == 0 ||
lstrcmp(psz, _T("-debug")) == 0 ||
lstrcmp(psz, _T("-debugtype:both")) == 0 ||
lstrcmp(psz, _T("-debugtype:coff")) == 0 ||
lstrcmp(psz, _T("-debugtype:cv")) == 0 ||
lstrcmp(psz, _T("profiler.lib")) == 0 ||
lstrcmp(psz, _T("user32.lib")) == 0)
continue;


Alex

khyron

hello, thanks for your help and your fast reply!

I patched the code as suggested but I run into a problem, the addin does not work anymore for normal windows apps because it removes user32.lib when your press debug or release...

in the end I just did:

     case ID_PROFILE:
     {
        lstrcpy(szNew, _T("-debug -debugtype:both profiler.lib user32.lib"));
        break;
     }

it works now for both scenarios for me (it leaves user32.lib in the linker for debug and release in console apps but it doesn´t bother me).

nitex

Seems i forgot a check, try this one.

static BOOL SetLinkerFlags(int idCmd)
{
TCHAR szOld[1024], szNew[1024], *psz;

/* Get the current linker options */
if (AddIn_GetProjectSymbol(g_hwndPrj, _T("LINKFLAGS"), szOld, NELEMS(szOld)) == 0)
return FALSE;

/* Set the new options */
switch (idCmd)
{
case ID_RELEASE:
{
lstrcpy(szNew, _T("-release"));
break;
}
case ID_DEBUG:
{
lstrcpy(szNew, _T("-debug -debugtype:both"));
break;
}
case ID_PROFILE:
{
           if (_tcsstr(szOld, _T("console")) == NULL)
{
lstrcpy(szNew, _T("-debug -debugtype:both profiler.lib"));
}
else
{
lstrcpy(szNew, _T("-debug -debugtype:both profiler.lib user32.lib"));
}

break;
}
}

   if (_tcsstr(szOld, _T("console")) == NULL)
   {
/* Walk through the current options and build the new options */
for (psz = _tcstok(szOld, _T(" ")); psz != NULL; psz = _tcstok(NULL, _T(" ")))
{
/* Forget old options */
if (lstrcmp(psz, _T("-release")) == 0 ||
lstrcmp(psz, _T("-debug")) == 0 ||
lstrcmp(psz, _T("-debugtype:both")) == 0 ||
lstrcmp(psz, _T("-debugtype:coff")) == 0 ||
lstrcmp(psz, _T("-debugtype:cv")) == 0 ||
lstrcmp(psz, _T("profiler.lib")) == 0)
continue;

/* Add this option to the new linker options */
if (szNew[0] != '\0')
lstrcat(szNew, _T(" "));
lstrcat(szNew, psz);
}
}
else
{
/* Walk through the current options and build the new options */
for (psz = _tcstok(szOld, _T(" ")); psz != NULL; psz = _tcstok(NULL, _T(" ")))
{
/* Forget old options */
if (lstrcmp(psz, _T("-release")) == 0 ||
lstrcmp(psz, _T("-debug")) == 0 ||
lstrcmp(psz, _T("-debugtype:both")) == 0 ||
lstrcmp(psz, _T("-debugtype:coff")) == 0 ||
lstrcmp(psz, _T("-debugtype:cv")) == 0 ||
lstrcmp(psz, _T("profiler.lib")) == 0 ||
           ((idCmd != ID_PROFILE) && (lstrcmp(psz, _T("user32.lib")) == 0)))
continue;

/* Add this option to the new linker options */
if (szNew[0] != '\0')
lstrcat(szNew, _T(" "));
lstrcat(szNew, psz);
}
}

/* Set the new linker options */
return AddIn_SetProjectSymbol(g_hwndPrj, _T("LINKFLAGS"), szNew);
}

khyron


nitex

New version of the Addin which fixes the error pointed out by khyron and and a new error introduced by me. The check for the console project was changed from if (_tcsstr(szOld, _T("console")) == NULL) to if (_tcsstr(szOld, _T("-subsystem:console")) == NULL)

This could otherwise fail to build projects which include a console.lib for example.