Good idea, but this requires domain knowledge.<div><br></div><div>For someone completely unfamiliar with the CMake code-base, this would be impractical. However I still appreciate the thought!</div><div><br></div><div>It would be great to see CMake provide some more debug-related commands later. Perhaps CMake could even implement its own prompt. For example:</div>
<div><br></div><div>Assume we have a CMakeLists.txt file with the following contents:</div><div>project( foo )</div><div>set( fubar "something arbitrary" )</div><div>add_executable( foo main.cpp )</div><div><br>
</div><div>And we would debug this file using the CMake debugger prompt like follows:</div><div><br></div><div><b>C:\>cmake --debug-prompt</b></div><div><b>> step-forward</b></div><div><b>line 1: project( foo )</b></div>
<div><b>> view-variable "fubar"</b></div><div><b>Variable "fubar" not found</b></div><div><b>> step-forward</b></div><div><b>line 2: set( fubar "something arbitrary" )</b></div><div><b>> view-variable "fubar"</b></div>
<div><b>fubar ==> "something arbitrary"</b></div><div><b>> step-forward</b></div><div><b>line 3: add_executable( foo main.cpp )</b></div><div><br></div><div>Later on, third party tools could be created to work directly with the prompt and make usable frontends for people who prefer a GUI solution to debugging like Visual Studio.</div>
<div><br></div><div><br><div class="gmail_quote">On Thu, Apr 2, 2009 at 12:57 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><div class="gmail_quote">On Thu, Apr 2, 2009 at 11:51 AM, Robert Dailey <span dir="ltr"><<a href="mailto:rcdailey@gmail.com" target="_blank">rcdailey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
That's the thing that has the "Returning to" and "Entering" messages right?<div><br></div><div>If it is, that's somewhat helpful but not anywhere near what I'm asking for. Think of how visual studio debugs C++ code. That's exactly the most optimal debugging method I would like to see for CMake. Here's a couple of abilities/features I expect:</div>
<div><ul><li>The ability to view the values of variables dynamically. In other words, as I step through code and the variable's value changes, I want to see the values change in real-time, just like Visual Studio's Watch window.</li>
<li>I want to be able to pause at each line of CMake code as it is executing to evaluate the state of the application. I should be able to press a key (like F10) in whatever debugger I'm using to progress to the next line.</li>
</ul><div>I'm guessing such a thing does not exist. In addition, if CMake.exe does not provide a way to step through the code and view variable values dynamically, no such tool can be made for it. CMake has to support the required hooks.</div>
<div>
<br><div class="gmail_quote">On Thu, Apr 2, 2009 at 11:42 AM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
<div>Robert Dailey wrote:<br>
<blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
I can't tell you how hard it is to hunt down strange behavior in CMake. Often times I would save myself 30 minutes of time on each of the hard bug fixes if I could just step through each line of logic as it was being executed and view the values of variables in a "watch" window of some sort.<br>
<br>
Does anyone know if such a CMake debugger exists? If not, are there plans to make one officially by the CMake team or some third party?<br>
<br>
<br>
</blockquote></div>
Have you tried: cmake --trace<br><font color="#888888">
<br>
-Bill<br>
</font></blockquote></div></div></div></blockquote></div><br></div></div>What about using a debug version of CMake and firing up the VS debugger? By putting break points in the right places in cmake.exe you might be able to query the state of things as CMake sees it.<br>
<br>It might be too extreme for what you are asking for, but you could try it in 30 minutes rather than waiting for support for this feature.<br><font color="#888888"><br>James<br>
</font></blockquote></div><br></div>