Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Setting breakpoints in source code in manual compile

Setting breakpoints in source code in manual compile

Scheduled Pinned Locked Moved C / C++ / MFC
c++questionworkspace
14 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U User 11169029

    that just launches MS VS IDE and that's it. I am curious if there at least some way to "debug" in a proper way using command line tools? (not just cout << statements..)

    A Offline
    A Offline
    Albert Holguin
    wrote on last edited by
    #5

    I agree there must be a way, but any particular reason as to why you don't want to just use the IDE? VisualStudio is actually a pretty darn good product, so why not use it? If you prefer command line tools, why not use gcc tools on Linux instead? ...I'm on Linux as I type this btw, I just really like what MS has done with VS overall (some of the incremental releases were a bit ridiculous but it's still a good product).

    1 Reply Last reply
    0
    • U User 11169029

      I am experimenting with Microsoft Visual c++ 2015, for quick tests of console only program I just edit .cpp files with an editor then I call the "developer Command Prompt for VS2015" and compile source using: cl /EHsc mysource.cpp then run executable. My question is, how can I manually now set breakpoints in mysource.cpp file and step through them in a same command line environment?

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #6

      Having used a command line debugger years ago I can say for a fact that I have no desire to go back to that. But then I haven't actually used a debugger for about 3 years. I just add some prints and let it run.

      A 1 Reply Last reply
      0
      • J jschell

        Having used a command line debugger years ago I can say for a fact that I have no desire to go back to that. But then I haven't actually used a debugger for about 3 years. I just add some prints and let it run.

        A Offline
        A Offline
        Albert Holguin
        wrote on last edited by
        #7

        Prints are a pain... debugger is way better when you can use it. No need to recompile just to figure out different sets of info.

        J 1 Reply Last reply
        0
        • A Albert Holguin

          Prints are a pain... debugger is way better when you can use it. No need to recompile just to figure out different sets of info.

          J Offline
          J Offline
          jschell
          wrote on last edited by
          #8

          I have used debuggers - many of them. And typically I do not need that to figure out problems. And in critical situations they are not available as in postmortems on production problems. The C# IDE is in fact the best one that I have used. Best in the context of least difficult to get up and running. But even then I still run into cases where debugger can't be used because I am always working in threaded situations and at least sometimes dealing with time critical operations. And a break point significantly changes behavior in such situations often making it impossible to diagnose the problem. Prints (or more specifically logging) allows for that. Should note that I do not and have not for a very long time work with UI code. So mileage on that could be significantly different.

          A 1 Reply Last reply
          0
          • J jschell

            I have used debuggers - many of them. And typically I do not need that to figure out problems. And in critical situations they are not available as in postmortems on production problems. The C# IDE is in fact the best one that I have used. Best in the context of least difficult to get up and running. But even then I still run into cases where debugger can't be used because I am always working in threaded situations and at least sometimes dealing with time critical operations. And a break point significantly changes behavior in such situations often making it impossible to diagnose the problem. Prints (or more specifically logging) allows for that. Should note that I do not and have not for a very long time work with UI code. So mileage on that could be significantly different.

            A Offline
            A Offline
            Albert Holguin
            wrote on last edited by
            #9

            Nobody NEEDS a debugger, just like nobody NEEDS an IDE, it's just another tool to make your job easier. As to time critical aspects, well... you just have to know how to use a debugger effectively (conditional breakpoints, watchlists) and certainly in conjunction with any other methods in your toolbox. I work with real-time systems every day, I'm a communications/DSP engineer.

            J 1 Reply Last reply
            0
            • A Albert Holguin

              Nobody NEEDS a debugger, just like nobody NEEDS an IDE, it's just another tool to make your job easier. As to time critical aspects, well... you just have to know how to use a debugger effectively (conditional breakpoints, watchlists) and certainly in conjunction with any other methods in your toolbox. I work with real-time systems every day, I'm a communications/DSP engineer.

              J Offline
              J Offline
              jschell
              wrote on last edited by
              #10

              Albert Holguin wrote:

              it's just another tool to make your job easier

              And...AGAIN...I have used debuggers. Used them for C#, C++ and Java. For years. And they do NOT make what I do significantly easier. And in the difficult cases the do NOT help.

              Albert Holguin wrote:

              you just have to know how to use a debugger effectively

              To be clear with 40+ years (and approaching) 50 and having used IDEs and debuggers for DECADES I can state that I do in fact know how to do exactly how to use them and do in fact know what features you are talking about and have in fact used them.... So if we can in fact move beyond the implicit denigration I can speak that for what I DO (not you and not others) between being able to actually figure out bugs by doing nothing at all (by just knowing how the flows work and what the code does where the problem lies), by looking at the code and by understanding how the flow works MOST problems that I encountered can be determined without a debugger. And the problems that are most complex involve interactions which a debugger would NOT help UNLESS I already knew what the bug was.

              Albert Holguin wrote:

              I work with real-time systems every day,

              And I do not. So YOUR mileage may vary. Finally of course, as I originally pointed out, I have also used a command line debugger which is per the OP. And those are NOT easy to use. Certainly when I used them they didn't support complex debugging support and I suspect setting them up to do that would be extremely difficult.

              A 1 Reply Last reply
              0
              • J jschell

                Albert Holguin wrote:

                it's just another tool to make your job easier

                And...AGAIN...I have used debuggers. Used them for C#, C++ and Java. For years. And they do NOT make what I do significantly easier. And in the difficult cases the do NOT help.

                Albert Holguin wrote:

                you just have to know how to use a debugger effectively

                To be clear with 40+ years (and approaching) 50 and having used IDEs and debuggers for DECADES I can state that I do in fact know how to do exactly how to use them and do in fact know what features you are talking about and have in fact used them.... So if we can in fact move beyond the implicit denigration I can speak that for what I DO (not you and not others) between being able to actually figure out bugs by doing nothing at all (by just knowing how the flows work and what the code does where the problem lies), by looking at the code and by understanding how the flow works MOST problems that I encountered can be determined without a debugger. And the problems that are most complex involve interactions which a debugger would NOT help UNLESS I already knew what the bug was.

                Albert Holguin wrote:

                I work with real-time systems every day,

                And I do not. So YOUR mileage may vary. Finally of course, as I originally pointed out, I have also used a command line debugger which is per the OP. And those are NOT easy to use. Certainly when I used them they didn't support complex debugging support and I suspect setting them up to do that would be extremely difficult.

                A Offline
                A Offline
                Albert Holguin
                wrote on last edited by
                #11

                Take a step back... deep breath.... now realize that what people post on internet posts is of little relevance to your every day life. With that said, let's agree to disagree.

                J 1 Reply Last reply
                0
                • A Albert Holguin

                  Take a step back... deep breath.... now realize that what people post on internet posts is of little relevance to your every day life. With that said, let's agree to disagree.

                  J Offline
                  J Offline
                  jschell
                  wrote on last edited by
                  #12

                  Rationalize it as you will. "...you just have to know how to use a debugger effectively..."

                  A 1 Reply Last reply
                  0
                  • J jschell

                    Rationalize it as you will. "...you just have to know how to use a debugger effectively..."

                    A Offline
                    A Offline
                    Albert Holguin
                    wrote on last edited by
                    #13

                    You must have never been called wrong a lot as a child. It's a part of life, you should learn to deal with it.

                    J 1 Reply Last reply
                    0
                    • A Albert Holguin

                      You must have never been called wrong a lot as a child. It's a part of life, you should learn to deal with it.

                      J Offline
                      J Offline
                      jschell
                      wrote on last edited by
                      #14

                      What I have learned is that many people spout subjective opinions as facts without actually understanding that it is is subjective. And then they attempt to rationalize it when someone points it out.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups