The end of an Era

This is a discussion on The end of an Era within the A Brief History of Cprogramming.com forums, part of the Community Boards category; >> Would it really be as fast as writing some printing statements and such, Daved? It's faster (at least for ...

  1. #31
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    >> Would it really be as fast as writing some printing statements and such, Daved?
    It's faster (at least for me).

    If you've got a small app and you're already running through VC++, just hit F10 (step over) instead of Run (F5) or Execute (Ctrl-F5). Open and dock the Autos window (Debug > Windows > Autos). If your program has output and you have enough room on your monitor (two monitors helps) then put the console or other window next to the debugger, otherwise it will have to be hidden which isn't ideal for this simple exercise.

    Then hit F10 to step over each line of code. When you get to a function you wrote, you can use F11 to step into it, then continue with F10. Watch the variables in the Autos window as they change. That's pretty much what the print statements are doing. The difference is you can see it for every line the first time, instead of adding a few statements and then narrowing down the location.

  2. #32
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by twomers View Post
    Would it really be as fast as writing some printing statements and such, Daved? Might take a look at it the next time I'm coding something. It always seemed a bit overkill to me in my simple world to be honest. Aside from the features you mentioned which others would be worth playing with?
    For one thing, a debugger will INSTANTLY pinpoint a segmentation fault. It doesn't necessarily explain WHY it happens, but it will give you a precise line number. I would hate to have to track down random segfaults by placing prints.

  3. #33
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Quote Originally Posted by brewbuck View Post
    NULL-protection is always good but aren't you concerned that the NULL shouldn't have been present to begin with?
    I am, but its about number 50 on the list. Theres a trade show in vegas this weekend and we have to make a video of the app in action by then. I fixed most of the major issues, only have 3 features left to put in, and I have a small memory leak to track down. Dont think the debugger will help me with the leak unfortunately...
    Last edited by abachler; 11-06-2007 at 10:14 PM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  4. #34
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by abachler View Post
    I am, but its about number 50 on the list.
    Prioritization. Word.

  5. #35
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    haha, yeah but tell that to my boss. I had this annoying handle leak for like 4 months because he kept addign features and wouldnt let me take the time to fix it, turns out it only took a couple hours to fix, and its been making teh app crash after 30 minutes for the last 4 months.
    Last edited by abachler; 11-06-2007 at 11:27 PM.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  6. #36
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    >Theres a trade show in vegas this weekend and we have to make a video of the app in action by then.
    Heard of photoshop?

    > and its been making teh app crash after 30 minutes for the last 4 months.
    That's easy to fix, introduce a 'feature' where the program restarts every 29 minutes

  7. #37
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,859
    I find the debugger a valuable tool. Can not imagine coding without using it.

    I suppose I am just lazy....
    I can read, analyse and plug in values to the code to work out what is wrong
    or
    I can run the code and the debugger will SHOW me what is wrong.


    Quote Originally Posted by twomers View Post
    Aside from the features you mentioned which others would be worth playing with?

    The ability to modify a variable during runtime, jump back and re-run the code, to test small sections of code over a range of values.
    The trace statement (same as printf but to the IDE output window). Great for diagnosing real-time/network app issues.
    Seeing non fatal exceptions reported as they occur (rather than where they cause a crash).
    Edit and continue allows changes on the fly in big/time consuming operations.
    Output shows memory not freed on close and gives address to help track it down (or immediate confimation that the leak is fixed / located in the commented out code).
    Stack trace to find exceptions.

    ect....
    Last edited by novacain; 11-16-2007 at 02:00 AM.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  8. #38
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I debug my programs with OllyDbg lol...
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Modify to make Doubly Linked List
    By Dampecram in forum C Programming
    Replies: 10
    Last Post: 11-03-2008, 07:25 PM
  3. singly linked to doubly linked
    By jsbeckton in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 07:47 PM
  4. socket newbie, losing a few chars from server to client
    By registering in forum Linux Programming
    Replies: 2
    Last Post: 06-07-2003, 12:48 PM
  5. Next Question...
    By Azmeos in forum C++ Programming
    Replies: 3
    Last Post: 06-06-2003, 03:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21