[cmake-developers] Request for Comments: Will implementing an interactive CMake debugger be welcome?

Matt McCormick matt.mccormick at kitware.com
Mon Jan 7 19:06:11 EST 2013


Hi Shlomi,

I also think this would be a great feature.  I started on an
implementation here:

  https://github.com/thewtex/cmakedbg

but I have not had time to follow it through.  The user interface is
written in Python/Cython for fast prototyping purposes, but it could
be written all C/C++ if you would like.  I believe I got to the point
where it was possible to set a breakpoint.  I was building against
this branch:

  https://github.com/thewtex/CMake/tree/cmakedbg

Overall, I think the approach is fairly solid.  When CMake processes a
line, it asks a debugger if it is interested.  For there, the debugger
can pause if a breakpoint is set at that point, let the user print the
content of current variables that are defined, ...  Since it uses
CMake for processing all the code, the debugger will behave exactly
the same as a cmake executable.

Feel free to take the project and run with it.

Matt



On Thu, Jan 3, 2013 at 3:46 PM, Stephen Kelly <steveire at gmail.com> wrote:
> Shlomi Fish wrote:
>
>> Hi all,
>>
>> following a discussion we had on ##llvm on irc.oftc.net (the main LLVM
>> channel, because LLVM+clang can be built using CMake), I've been wondering
>> if you would like someone (like me) to implement an interactive debugger
>> (or debugging "mode") for cmake invocations, similar to gdb, "perl -d",
>> pdb.py, etc.? I saw this thread:
>>
>> http://www.cmake.org/pipermail/cmake/2009-July/030728.html
>>
>> Where it was recommended to use cmake --trace, and I've been using MESSAGE
>> ( ... ) and MESSAGE (FATAL_ERROR ...) for most of my debugging, but I'm
>> interested in something better.
>>
>> I can try working on it given the time and motivation (in a separate git
>> branch on a GitHub/Bitbucket repository), but I want to get a green light
>> for it, because once introduced, it naturally should be supported in the
>> future (and if I'm going to write it, I am willing to help support it).
>>
>
> Hi there,
>
> I'm sure such an addition would be welcome, but it would be a lot of work.
>
> Before writing such a feature, do you have enough familiarity with the cmake
> codebase already to describe how much work it would be?
>
> Thanks,
>
> Steve.
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers



More information about the cmake-developers mailing list