Thread: How to debug on the fly?

  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    88

    How to debug on the fly?

    I dunno the exact therm for what I am looking for, I think it`s somewhere between interpreter, praser and static code checker.

    Normally in C++ you write code and then you compile. If you made some mistakes like syntax errors the compiler will show you a error or a warning. The problem is that I find this way of coding, I will not say ineffective but it could be better.

    I have seen a similar feature in visual studio and C#. If you make a mistake like a wrong type the ide will show you instantly an error and you can fix it. This saves a lot of time trying to compile it.

    Now I want to see such a feature also for C++ (preferred as a visual studio addin).

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    I use Visual Assist from Whole Tomato - which beefs up "Intellisense", plus a lot more.
    http://www.wholetomato.com/

    gg

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    You mean "Edit and Continue"? That works in VS2005 with C++.
    If that's not what you're using, you'll have to state your compiler.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > interpreter, praser and static code checker.
    Wow, for a minute I mis-read that as "praiser".

    What's that, a popup which appears from time to time to tell you how marvellous your code is, and what an awesome programmer you are
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    88
    Quote Originally Posted by Codeplug View Post
    I use Visual Assist from Whole Tomato - which beefs up "Intellisense", plus a lot more.
    http://www.wholetomato.com/
    That`s a nice tool, but not what I am looking for.

    Quote Originally Posted by iMalc View Post
    You mean "Edit and Continue"? That works in VS2005 with C++.
    If that's not what you're using, you'll have to state your compiler.
    No, I don`t mean that. I can edit the source while debugging but this is not what I mean.

    What I mean is, you write code in editor and even before you compile you will see the errors you made, if any in some window.

    Ok, it was not exactly C# where I saw this feature. But it was Visual Baisc.net. I made here a screenshot. I can already see any errors before I compile the source. This is really effective and I want some addin for visual studio or external tool / ide for that in C++.
    Last edited by sept; 09-12-2007 at 08:48 AM.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by sept View Post
    What I mean is, you write code in editor and even before you compile you will see the errors you made, if any in some window.
    That is a fairly complex procedure with C++, particularly when using for example templates. You could probably find SOME of the problems.

    I work with writing small amounts of code and compiling that, then writing a bit more. At least for syntax that works - you obviously need a way to test the code to find logic problems, and that sometimes requires a bit more of a working code-set.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    Quote Originally Posted by sept View Post
    This is really effective and I want some addin for visual studio or external tool / ide for that in C++.
    the need for a update->compile->run cycle is one of the drawbacks of using compilers. this isn't solved completely. you have to stick to interpreters if you really want this.
    but god gave use make and precompiled headers to make life much better for us. use them and be happy

    by the way: what I've always asked myself is: every compiler needs a parser. that parser is 100% complete and correct in it's function. why doesn't compiler vendors make their parsers available also to external programs (IDEs for expamle) through a library?
    Last edited by pheres; 09-12-2007 at 10:36 AM.

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > If you make a mistake like a wrong type the ide will show you instantly an error and you can fix it.
    Sooner or later, you'll need to take the training wheels off your bicycle and learn to ride by yourself.

    If you're a reasonably fast typist, and you know what you're doing, these kinds of tools rapidly start to get in the way. On the large projects where they might start to be useful, the performance falls away with the amount of information they have to sift through.

    > the need for a update->compile->run cycle is one of the drawbacks of using compilers.
    All compilers (and by extension, all IDEs) also have the option of "Compile Only" to just compile the current source file. This normally takes only seconds and then you have a nice error list (or not) to advance your way through.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary not built with debug info - why?
    By ulillillia in forum C Programming
    Replies: 15
    Last Post: 12-11-2008, 01:37 AM
  2. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 04:00 PM
  3. Debug --> Exceptions in Visual Studio 2005
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 08-10-2007, 02:12 AM
  4. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  5. Ask about Debug Assert Failed
    By ooosawaddee3 in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2002, 11:07 PM