{"id":240,"date":"2014-03-08T12:21:49","date_gmt":"2014-03-08T12:21:49","guid":{"rendered":"http:\/\/blogs.gentoo.org\/lu_zero\/?p=240"},"modified":"2015-03-26T15:36:17","modified_gmt":"2015-03-26T15:36:17","slug":"lldb-how-to-botch-the-user-interface","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/lu_zero\/2014\/03\/08\/lldb-how-to-botch-the-user-interface\/","title":{"rendered":"lldb: how to botch the user interface"},"content":{"rendered":"<p>Recently I had to spend some time developing on MacOSX. Gentoo-Prefix sadly is getting less and less useful till we don&#8217;t make clang a first class citizen (People proposing a GSoC for it are welcome!) so I&#8217;m forced to use what&#8217;s provided by Xcode. All in all I do like a lot most of the new toolchain: clang instead of an ancient <strong>gcc-4.2<\/strong>, a brand new <strong>ld<\/strong> replacing a stale binutils. Just <strong>lldb<\/strong> is not good.<\/p>\n<h2>Clang<\/h2>\n<p><strong>clang<\/strong> is wonderful for developing, it is arguably fast at building and the generated code isn&#8217;t that bad, beside when you are using <strong>asan<\/strong> and it miscompiles&#8230; (reported to the asan developers, they will have a look, <strong>gcc-asan<\/strong> works as expected.<\/p>\n<p>The warning reporting is probably one of the feature I do miss in other compilers and that&#8217;s why I added it to <a href=\"https:\/\/github.com\/MatzeB\/cparser\">cparser<\/a> and I&#8217;m looking forward to move to <strong>gcc-4.9<\/strong>.<\/p>\n<p>All in all <strong>clang<\/strong> developers increased the usability of the compiler and made the other projects improve as well, competition in opensource does work.<\/p>\n<h2>ld<\/h2>\n<p>The linker is again different from the usual binutils, normally you do not notice it but with the new xcode you have to face it since some projects will have problems finding symbols. Again the reporting is quite good, not stellar as clang&#8217;s but when the missing symbols are C++ it does a better job than stock binutils in telling you what&#8217;s missing from where.<\/p>\n<h2>lldb<\/h2>\n<p>The new debugger probably isn&#8217;t really ready for the prime time. <strong>gdb<\/strong> gets its share of complaints about some of its quirks (the macros system is quite minimal and the python interface is good, but not documented as it should), but it is really effective and fast to use.<\/p>\n<p><strong>lldb<\/strong> is not. Almost every command that in gdb is a single statement, and can be shortened to a single letter, in lldb it is two statements , usually with a compulsory option.<\/p>\n<p>Setting breakpoints, watchers, moving through frames; everything gets more cumbersome to use.<\/p>\n<p>The reporting is a little more confusing and the error messages can be misleading. And since you might use the tool while under pressure (e.g. there is a last second bug found before a main release), you want to be as quick as possible.<\/p>\n<p>While debugging some VDA hwaccel improvements for <a href=\"http:\/\/libav.org\">libav<\/a> I got to spend quite a bit of time tracking why a pointer gets nulled.<\/p>\n<p>The watchpoint I set to figure out triggered at random times in the innards of the osx memory management and I couldn&#8217;t actually see when or how that happens.<\/p>\n<p>I ended up writing a dummy hwaccel accessing the same fields on linux, run it through gdb and discover the actual problem in &#8230; 10minutes, code and reboots included.<\/p>\n<p>I do hope we&#8217;ll see a better interface for <strong>lldb<\/strong> and further improvements on <strong>gdb<\/strong> (and hopefully combinations such as <strong>clang + gdb<\/strong> and <strong>gcc + lldb<\/strong> will work better).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I had to spend some time developing on MacOSX. Gentoo-Prefix sadly is getting less and less useful till we don&#8217;t make clang a first class citizen (People proposing a GSoC for it are welcome!) so I&#8217;m forced to use what&#8217;s provided by Xcode. All in all I do like a lot most of the &hellip; <a href=\"https:\/\/blogs.gentoo.org\/lu_zero\/2014\/03\/08\/lldb-how-to-botch-the-user-interface\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">lldb: how to botch the user interface<\/span><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[1],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1aGWH-3S","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/240"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/comments?post=240"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/240\/revisions"}],"predecessor-version":[{"id":426,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/posts\/240\/revisions\/426"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/media?parent=240"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/categories?post=240"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/lu_zero\/wp-json\/wp\/v2\/tags?post=240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}