{"id":204,"date":"2014-04-04T04:38:14","date_gmt":"2014-04-04T04:38:14","guid":{"rendered":"http:\/\/blog.ignoranthack.me\/?p=204"},"modified":"2015-06-26T03:50:17","modified_gmt":"2015-06-26T03:50:17","slug":"the-short-list-8-using-lldb-with-a-core-file-on-freebsd","status":"publish","type":"post","link":"http:\/\/blog.ignoranthack.me\/?p=204","title":{"rendered":"The Short List #8: Using #lldb with a core file on #FreeBSD"},"content":{"rendered":"<p>Debugging qemu this evening and it took me a minute or two to figure out the syntax for debugging a core file with lldb.<\/p>\n<p><em>lldb mips-bsd-user\/qemu-mips -c \/mipsbuild\/qemu-mips.core<\/em><\/p>\n<p>Make sure you have permissions to access both the binary and the core, else you get a super unhelpful error of:<\/p>\n<p><em>error: Unable to find process plug-in for core file &#8216;\/mipsbuild\/qemu-mips.core&#8217;<\/em><\/p>\n<p>But, after that, you can start poking around:<\/p>\n<blockquote><p>Core file &#8216;\/mipsbuild\/qemu-mips.core&#8217; (x86_64) was loaded.<\/p>\n<p>Process 0 stopped<\/p>\n<p>* thread #1: tid = 0, 0x00000000601816fa qemu-mips`_kill + 10, name = &#8216;qemu-mips&#8217;, stop reason = signal SIGILL<\/p>\n<p>frame #0: 0x00000000601816fa qemu-mips`_kill + 10<\/p>\n<p>qemu-mips`_kill + 10:<\/p>\n<p>-&gt; 0x601816fa: jb 0x60182f5c ; .cerror<\/p>\n<p>0x60181700: ret<\/p>\n<p>0x60181701: nop<\/p>\n<p>0x60181702: nop<\/p>\n<p>(lldb) bt<\/p>\n<p>* thread #1: tid = 0, 0x00000000601816fa qemu-mips`_kill + 10, name = &#8216;qemu-mips&#8217;, stop reason = signal SIGILL<\/p>\n<p>* frame #0: 0x00000000601816fa qemu-mips`_kill + 10<\/p>\n<p>frame #1: 0x000000006003753b qemu-mips`force_sig(target_sig=&lt;unavailable&gt;) + 283 at signal.c:352<\/p>\n<p>frame #2: 0x00000000600376dc qemu-mips`queue_signal(env=&lt;unavailable&gt;, sig=4, info=0x00007ffffffe8878) + 380 at signal.c:395<\/p>\n<p>frame #3: 0x0000000060035566 qemu-mips`cpu_loop [inlined] target_cpu_loop(env=&lt;unavailable&gt;) + 1266 at target_arch_cpu.h:239<\/p>\n<p>frame #4: 0x0000000060035074 qemu-mips`cpu_loop(env=&lt;unavailable&gt;) + 20 at main.c:201<\/p>\n<p>frame #5: 0x00000000600362ae qemu-mips`main(argc=1623883776, argv=0x00007fffffffd898) + 2542 at main.c:588<\/p>\n<p>frame #6: 0x000000006000030f qemu-mips`_start + 367<\/p><\/blockquote>\n<p>Edit:\u00a0 The permission error on the core file is now more meaningful in later versions of llvm:<\/p>\n<p>http:\/\/llvm.org\/viewvc\/llvm-project?view=revision&#038;revision=240753<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Debugging qemu this evening and it took me a minute or two to figure out the syntax for debugging a core file with lldb. lldb mips-bsd-user\/qemu-mips -c \/mipsbuild\/qemu-mips.core Make sure you have permissions to access both the binary and the core, else you get a super unhelpful error of: error: Unable to find process plug-in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_share_on_mastodon":"0"},"categories":[2],"tags":[],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/204"}],"collection":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=204"}],"version-history":[{"count":5,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/204\/revisions"}],"predecessor-version":[{"id":236,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=\/wp\/v2\/posts\/204\/revisions\/236"}],"wp:attachment":[{"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=204"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.ignoranthack.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}