Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Debug question[s]

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Markus - 22 Jul 2007 09:10 GMT
Hmmmm, for as much as this software costs, I'm not so sure I'm sold on
it (using the professional version).

This code here:
------------------------------------
#include <string>
#include <iostream>
using namespace std;

int mystrcmp ( const char * src, const char * dst);

int main(int argc, char* argv[]){

-->    int i = 90;
    const char *s1;
    const char *s2;
    s1 = "Helli";
    s2 = "Hello";

    i = mystrcmp(s1, s2);
    cout << i << endl;
    cin >> i;
    ....
---------------------------------------

I set the breakpoint at the arrow, but when I select debug - start
debugging, the breakpoint moves down to the function call?????? Also,
the "Locals" window shows the variable i to have a value of '2' at
this point, and it stays that way.  WTF????
--------------------------------------------------------------
        argc    1    int
+        argv    0x00333360    char * *
        i    2    int
---------------------------------------------------------------

FWIW: The command window shows the correct value (-1) for i via the
cout statement....

Again, open to any suggestions....

Thanks,
Markus
David Lowndes - 22 Jul 2007 14:00 GMT
>Hmmmm, for as much as this software costs, I'm not so sure I'm sold on
>it (using the professional version).
[quoted text clipped - 3 lines]
>the "Locals" window shows the variable i to have a value of '2' at
>this point, and it stays that way.  WTF????

Markus,

The symptoms you describe are typical when debugging the release
(optimised) version of a project. Is that perhaps what you're doing -
or have optimisation set for the DEBUG configuration?

Dave
Markus - 23 Jul 2007 00:26 GMT
>>Hmmmm, for as much as this software costs, I'm not so sure I'm sold on
>>it (using the professional version).
[quoted text clipped - 11 lines]
>
>Dave

Dave,

The toolbar/configuration manager claimed that I was in Debug mode,
however going into "Project - <projectname> Properties ... -
Configuration Properties - C/C++ - Optimization" saw Optimization set
to Maximum Speed (/O2).  I set it to Disabled (/Od) and whala, I can
debug at will :)

Thanks!
Markus
David Lowndes - 23 Jul 2007 08:28 GMT
>The toolbar/configuration manager claimed that I was in Debug mode,
>however going into "Project - <projectname> Properties ... -
>Configuration Properties - C/C++ - Optimization" saw Optimization set
>to Maximum Speed (/O2).  I set it to Disabled (/Od) and whala, I can
>debug at will :)

Great, I'm glad that helped.

Dave

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.