c++ code interpreter/debugging tool
-
CalinNegru(fearless_) wrote:
It`s basically a simulation of execution without a binary file being involved
Sorry, I don't have an answer for you, but wow, that's sounds incredibly ambitious. :omg:
"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
It`s similar to what Visual Studio Intellisense does just driven one step further
-
It`s similar to what Visual Studio Intellisense does just driven one step further
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
-
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?
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
-
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
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[^]
-
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
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.
-
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.
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. -
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.I`m making proper use of the term then. Thanks for the article link Greg
-
I`m making proper use of the term then. Thanks for the article link Greg
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. -
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.I`ll probably won`t end-up much further than getting my feet wet but that good to know.
-
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?
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
-
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
Lots of useful resources, thanks.
-
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?
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/[^]