{"id":1491,"date":"2014-12-18T22:59:23","date_gmt":"2014-12-18T21:59:23","guid":{"rendered":"http:\/\/galfar.vevb.net\/wp\/?p=1491"},"modified":"2018-09-04T14:28:37","modified_gmt":"2018-09-04T13:28:37","slug":"problems-with-cdb-debugger-in-qtcreator","status":"publish","type":"post","link":"https:\/\/galfar.vevb.net\/wp\/2014\/problems-with-cdb-debugger-in-qtcreator\/","title":{"rendered":"Problems with CDB Debugger in QtCreator"},"content":{"rendered":"<p>Some time ago <em>Locals and Expressions<\/em>\u00a0view in QtCreator just stopped working for me. No locals were listed when the program stopped on a breakpoint, watches did not show the values, hovering with the mouse over a variable in the editor did not show its value in a tooltip. No fiddling with IDE options helped. This was on Windows using compiler from Visual C++ and CDB as a debugger.<\/p>\n<p>It was quite annoying but I was mostly working on UI at that time and could live with occasional dumping of few variables into a log. Few weeks later I moved to some math heavy stuff and the situation became desperate\u00a0\u2014 I had to fix this!<\/p>\n<p>At first, I suspected the debugger or the compiler. Since reinstalling and trying different versions did not help I also tried different versions of Qt and QtCreator itself. Still broken. And Googling for broken CDB only revealed problems with CDB getting unusably slow.<\/p>\n<p>After QtCreator reinstall, I noticed the settings were preserved from the old version. So maybe they are somehow corrupted? \u00a0I found them in <code>C:\\Users\\username\\AppData\\Roaming\\QtProject\\qtcreator\\<\/code>, made a backup of that folder, and deleted it. <strong>And it started working!\u00a0<\/strong><em>Locals and Expressions<\/em> were back!<\/p>\n<p>Of course, I also wanted my old settings back. So I switched back to the old settings and started QtCreator again and to my surprise it still worked! I took a closer look and saw that the problem lies in the <em>session file<\/em> (*.qws)\u00a0\u2014 when I previously deleted the settings folder QtCreator created a new session for me and this one I reopened in the IDE after the switch back to the old settings (just copied the files into the folder so the new session file stayed there).<\/p>\n<p>So I\u00a0opened the session file with an intention to start deleting suspicious stuff until it works. It's a XML file and apart from one big base64 blob there is not much else. Besides\u00a0a breakpoint list, the only thing that seemed related to debugging was a list of maybe ten old\u00a0<em>watch expressions<\/em>\u00a0(which were not listed in the IDE anymore!).<em>\u00a0<\/em>I deleted it and\u00a0voil\u00e0, I could\u00a0see the values of locals and variables again!<\/p>\n<p>After a few weeks, debugging started to get slow. Stepping over code took a few seconds and values of the variables showed up only after considerable time (tens of seconds). This time I knew what to do, deleting watch expressions from the session file helped again. So I came to the conclusion that in the first case the values could eventually show up after a few minutes (stepping over code was not slowed down though). It was just very very slow. Then the Googled complaints about slow CDB made more sense to me. And indeed, I <a href=\"http:\/\/stackoverflow.com\/questions\/23031830\/qt-creator-3-0-1-debugging-on-windows-suddenly-becomes-slow-why\" target=\"_blank\" rel=\"noopener\">found out someone fixed it the same way<\/a>\u00a0but I was not paying attention to just slow debugging\u00a0before, I was looking for broken debugging!<\/p>\n<h3>Recapitulation<\/h3>\n<ol>\n<li>Debugging in QtCreator using CDB in Windows is very slow and\/or values of locals and expressions never show up.<\/li>\n<li>Go to the folder where QtCreator stores your session file (<code>C:\\Users\\username\\AppData\\Roaming\\QtProject\\qtcreator\\<\/code>).<\/li>\n<li>Open the session file (*.qws) in text editor and look for this XML subtree:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;data&gt;\r\n    &lt;variable&gt;value-Watchers&lt;\/variable&gt;\r\n    &lt;valuelist type=&quot;QVariantList&quot;&gt;\r\n        &lt;value type=&quot;QString&quot;&gt;some expression 1&lt;\/value&gt;\r\n        &lt;value type=&quot;QString&quot;&gt;some expression 2&lt;\/value&gt;\r\n        &lt;value type=&quot;QString&quot;&gt;some expression 3&lt;\/value&gt;\r\n    &lt;\/valuelist&gt;\r\n&lt;\/data&gt;\r\n<\/pre>\n<\/li>\n<li>Delete this subtree (or just the expressions) and save the file.<\/li>\n<li>Start QtCreator, open the fixed session, and do some debugging.<\/li>\n<\/ol>\n<p><strong><em>Edit<\/em><\/strong>: If this doesn't help check also\u00a0<a href='https:\/\/galfar.vevb.net\/wp\/2018\/debugging-with-cdb-in-qtcreator-agonizingly-slow\/' title='Debugging with CDB in QtCreator Agonizingly Slow'>Debugging with CDB in QtCreator Agonizingly Slow<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some time ago Locals and Expressions\u00a0view in QtCreator just stopped working for me. No locals were listed when the program stopped on a breakpoint, watches did not show the values, hovering with the mouse over a variable in the editor &hellip; <a href=\"https:\/\/galfar.vevb.net\/wp\/2014\/problems-with-cdb-debugger-in-qtcreator\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[8],"tags":[31,30],"class_list":["post-1491","post","type-post","status-publish","format-standard","hentry","category-programming","tag-cc","tag-qt"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/posts\/1491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/comments?post=1491"}],"version-history":[{"count":0,"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/posts\/1491\/revisions"}],"wp:attachment":[{"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/media?parent=1491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/categories?post=1491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/galfar.vevb.net\/wp\/wp-json\/wp\/v2\/tags?post=1491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}