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. c++ code interpreter/debugging tool

c++ code interpreter/debugging tool

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++debuggingquestion
14 Posts 6 Posters 2 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.
  • C Calin Negru

    A while ago I`m started making a c++ code debugger tool in Forms (C#). The tool is designed to spot faults in a c++ code file and works such that in the process no compilation is taking place. It`s basically a simulation of execution without a binary file being involved. Are there similar projects around?

    K Offline
    K Offline
    k5054
    wrote on last edited by
    #5

    I'm not sure, excactly, what it is you're trying to accomplish. If you're thinking of creating a full C++ interpreter, then maybe you want to look at the [Cling - ROOT](https://root.cern/cling/#what-is-cling) project. However, that is a Linux only project, so it probably wont fit your needs. There might be a good C++ interpreter available for windows out there, you'll just have to google for it. If what you are trying to achieve is more along the lines of code analysis, then maybe clang-tidy is more what you are thinking of, in which case see here: [Using Clang-Tidy in Visual Studio | Microsoft Docs](https://docs.microsoft.com/en-us/cpp/code-quality/clang-tidy?view=msvc-170) But maybe I've misunderstood what it is you're trying to do. Perhaps the exercise of writing a C++ parser is in itself worth the effort for you, in which case, have at it!

    Keep Calm and Carry On

    C 1 Reply Last reply
    0
    • J jeron1

      Simulating execution versus providing context sensitive help seems like a BIG step, at least to me. I'm not dismissing Intellisense, which I imagine is a very large and complex task itself.

      "the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle

      C Offline
      C Offline
      Calin Negru
      wrote on last edited by
      #6

      Itellisense keeps track of variables (which involves the creation of some sort of structures to hold at least the variable name and type) and brackets, but I agree it`s all on a very shallow level. I thought storing variable values would be the next logical step. Getting on this track started from me being frustrated with silent errors one gets when accessing an array outside its bounds. You could fix this by adding safety checks around the array in the c++ code but I thought you could also have an Intellisense like system that would spot the error. Evolving it into something that can `understand` classes or other advanced c++ features is an ambitious undertaking indeed I`m not sure I`m aiming that high. here`s a short video of my program performing some basic operations: Simulating code execution - YouTube[^]

      1 Reply Last reply
      0
      • K k5054

        I'm not sure, excactly, what it is you're trying to accomplish. If you're thinking of creating a full C++ interpreter, then maybe you want to look at the [Cling - ROOT](https://root.cern/cling/#what-is-cling) project. However, that is a Linux only project, so it probably wont fit your needs. There might be a good C++ interpreter available for windows out there, you'll just have to google for it. If what you are trying to achieve is more along the lines of code analysis, then maybe clang-tidy is more what you are thinking of, in which case see here: [Using Clang-Tidy in Visual Studio | Microsoft Docs](https://docs.microsoft.com/en-us/cpp/code-quality/clang-tidy?view=msvc-170) But maybe I've misunderstood what it is you're trying to do. Perhaps the exercise of writing a C++ parser is in itself worth the effort for you, in which case, have at it!

        Keep Calm and Carry On

        C Offline
        C Offline
        Calin Negru
        wrote on last edited by
        #7

        thanks I`ll take a look at those projects to see if they are a match to what I`m trying to build. Note: I could be misusing the term `interpreter` here, that could be a word that is used to designate a very specific thing in software development.

        Greg UtasG 1 Reply Last reply
        0
        • C Calin Negru

          thanks I`ll take a look at those projects to see if they are a match to what I`m trying to build. Note: I could be misusing the term `interpreter` here, that could be a word that is used to designate a very specific thing in software development.

          Greg UtasG Offline
          Greg UtasG Offline
          Greg Utas
          wrote on last edited by
          #8

          Interpreter usually means software that executes source code without compiling it. Depending on what you want to do, the code associated with this article[^] may be useful. To do C++ static analysis, it has to do many of the same things as a C++ compiler. However, it is written in C++, not C#.

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
          <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

          C 1 Reply Last reply
          0
          • Greg UtasG Greg Utas

            Interpreter usually means software that executes source code without compiling it. Depending on what you want to do, the code associated with this article[^] may be useful. To do C++ static analysis, it has to do many of the same things as a C++ compiler. However, it is written in C++, not C#.

            Robust Services Core | Software Techniques for Lemmings | Articles
            The fox knows many things, but the hedgehog knows one big thing.

            C Offline
            C Offline
            Calin Negru
            wrote on last edited by
            #9

            I`m making proper use of the term then. Thanks for the article link Greg

            Greg UtasG 1 Reply Last reply
            0
            • C Calin Negru

              I`m making proper use of the term then. Thanks for the article link Greg

              Greg UtasG Offline
              Greg UtasG Offline
              Greg Utas
              wrote on last edited by
              #10

              The code in the article could evolve into a C++ interpreter, but I decided this wouldn't be as useful as enhancing its static analysis capabilities. There are also C++11 language features that it doesn't support, and it doesn't do folding (calculating compile-time constants).

              Robust Services Core | Software Techniques for Lemmings | Articles
              The fox knows many things, but the hedgehog knows one big thing.

              <p><a href="https://github.com/GregUtas/robust-services-core/blob/master/README.md">Robust Services Core</a>
              <em>The fox knows many things, but the hedgehog knows one big thing.</em></p>

              C 1 Reply Last reply
              0
              • Greg UtasG Greg Utas

                The code in the article could evolve into a C++ interpreter, but I decided this wouldn't be as useful as enhancing its static analysis capabilities. There are also C++11 language features that it doesn't support, and it doesn't do folding (calculating compile-time constants).

                Robust Services Core | Software Techniques for Lemmings | Articles
                The fox knows many things, but the hedgehog knows one big thing.

                C Offline
                C Offline
                Calin Negru
                wrote on last edited by
                #11

                I`ll probably won`t end-up much further than getting my feet wet but that good to know.

                1 Reply Last reply
                0
                • C Calin Negru

                  A while ago I`m started making a c++ code debugger tool in Forms (C#). The tool is designed to spot faults in a c++ code file and works such that in the process no compilation is taking place. It`s basically a simulation of execution without a binary file being involved. Are there similar projects around?

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #12

                  Yes, Apparently over at CERN they aren't just doing particle physics. They also do some pretty good software engineering[^], which includes a C++ Interpreter[^] they called Cint. I don't think Cint is being maintained anymore, they seem to be putting all of their effort into the new Cling[^]. I've never used either one of them, so I don't know much about them. :) Best Wishes, -David Delaune

                  C 1 Reply Last reply
                  0
                  • L Lost User

                    Yes, Apparently over at CERN they aren't just doing particle physics. They also do some pretty good software engineering[^], which includes a C++ Interpreter[^] they called Cint. I don't think Cint is being maintained anymore, they seem to be putting all of their effort into the new Cling[^]. I've never used either one of them, so I don't know much about them. :) Best Wishes, -David Delaune

                    C Offline
                    C Offline
                    Calin Negru
                    wrote on last edited by
                    #13

                    Lots of useful resources, thanks.

                    1 Reply Last reply
                    0
                    • C Calin Negru

                      A while ago I`m started making a c++ code debugger tool in Forms (C#). The tool is designed to spot faults in a c++ code file and works such that in the process no compilation is taking place. It`s basically a simulation of execution without a binary file being involved. Are there similar projects around?

                      M Offline
                      M Offline
                      Map R ep ep
                      wrote on last edited by
                      #14

                      Good day to all. Unfortunately, personally, I - I cannot answer the question you raised, but I want to share very useful information. Since I am also engaged in software development, sometimes questions arise, and I find the answers to them on one site that my friend advised me. There you can find the answer to any question regarding IT. If you are interested, I leave a link for you: https://sirinsoftware.com/services/iot-development/[^]

                      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