clion Debug & Qt? - expressions -msvc
Answered
Hey
I just got clion with debug running on msvc and oh my its so amazing!
But I do wonder... how can I cast QString in to something "readable"? I think I need expression but not sure how to get it to work?
I usually use qtCreator so I'm a bit bad with expressions...
TIA
Please sign in to leave a comment.
Mhmm I found this https://unlimitedcodeworks.xyz/blog/2016/08/20/gsoc-kdevelop-lldb-final-report/#using-data-formatter-scripts-outside-kdevelop
It seems that we can install the KDevelop formatter scripts in other LLDB, does clion allow it in any shape of form ? Any tips? ( I never touched lldb before yeterday)
Hi Dariusz!
Note that CLion use custom native visualizers if you have them in the project. It might help in your situation. You can try using https://github.com/inviwo/inviwo/blob/master/tools/natvis/qt5.natvis, for example. Just copy the file into your project, CLion should automatically detect natvis and use it. Make sure that the Settings | Build, Execution, Deployment | Debugger Data Views | Enable NatVis renderers for LLDB option is enabled.
Hey
This is amazing! Woah !
But I'm failing to get it "running". I restarted clion, enabled the NatVis & even tried debug to the 3 options I can have... I still cant read QString >
Not sure what to do here?
I also found this natvis too >
https://code.qt.io/cgit/qt-labs/vstools.git/tree/src/qtvstools/qt5.natvis.xml?id=c69a9dac77c67310bc837826c1bab51286fec6d1
TIA.
We're investigating the situation on our side. As soon as I get any update from the developer, I'll let you know.
Hey Anna
Thanks so much for info! Looking forward to it ! ;- ))
I would love to see some Qt related data and not just bytes ^^
Unfortunately, it turned out that our LLDB-based debugger for Windows have some rendering issues with Unicode strings and format specifiers. We've created https://youtrack.jetbrains.com/issue/CPP-16751, feel free to comment or upvote.
Hey Anna
Thanks so much for feedback!
What do you think the roughest eta for this could be?
Sorry, Dariusz, I can't provide you any ETA :(
Hey @Anna Falevskaya
I just noticed that there was an update regarding NatVis for msvc & Clion, is there anything I need to do to get it to work?
I noticed that some stuff appear to print differently now with QT, but QString appear to still be a bit "odd"
Perhaps my natvis file is off? :- )
QMap/QVector etc appear to print better now, not sure tho how it did before as I did not use it much... sigh.
@Dariusz, the issues related to your case (https://youtrack.jetbrains.com/issue/CPP-16751, https://youtrack.jetbrains.com/issue/CPP-16750) are still open.
Ahh bummer, I saw the natvis info in update log and jumped ^^
Thanks for the update. Will wait more :- ) Glad something around natvis is getting done ^^
it seems that issue have not been solved yet. any plan on this? on debugger session ,it only show int value not the char ,it is a little wired.
@Redblueblur2009 you can find the related issues from our tracker in this thread and follow them to get updates.
I have followed the steps , in the latest version . it seems that QString still can not show the debug value friendly . Do I miss something or it just can do so ?
@Redblueblur2009 the related issues (https://youtrack.jetbrains.com/issue/CPP-16751, https://youtrack.jetbrains.com/issue/CPP-16750) are still open. It means this is not fixed yet. Please follow the issues to get updates. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
does the "Enable NatVis renderers for LLDB" feature only be supported in Windows?
I didn't see the option in Macos/2019.3.4
@Fatfatson, a NATVIS file is a debugger visualization file used by Microsoft Visual Studio. So it's supported only for MSVC toolchain's debugger in Windows.
hi @Anna Falevskaya
but are there any subsitution in Clion for macos? some complex data structure are too annoying to expand them everytime.
Last few versions appear to be supporting QStrings, I can see my text next to my member, yay!
However QVector<int> QMap/etc/etc seems to still be... "jibberish"... Is this "accidental" fix for QStrings or is there more to it ?
Both of the bug track tickets appear to still be "untouched"... soo accidental fix?
Dariusz Makowski for QMap please follow https://youtrack.jetbrains.com/issue/CPP-20085.
>Both of the bug track tickets appear to still be "untouched"... soo accidental fix?
They are fixed partially, that's why the issues are still in the Open state.