<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Menlo;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Futura;
        panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hey Sara,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I installed latest Xcode and switched to latest lldb. Its working for me.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thanks again!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-Prabhat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Sara Burke
<br>
<b>Sent:</b> Thursday, November 01, 2012 1:40 PM<br>
<b>To:</b> Greg Clayton<br>
<b>Cc:</b> Sara Burke; lldb-dev@cs.uiuc.edu; Prabhat Verma<br>
<b>Subject:</b> Re: [lldb-dev] How to debug a core file with lldb?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Great, thanks Greg. I must not have the most up-to-date lldb version, for I see the following when I do the same commands:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">(lldb) version<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">LLDB-112.2<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">(lldb) apropos core<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">No commands found pertaining to 'core'. Try 'help' to see a complete list of debugger commands.<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">(lldb) help target create<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">   Create a target using the argument as the main executable.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Syntax: target create <cmd-options> <filename><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Command Options Usage:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">  target create [-a <arch>] [-p <platform-name>] [-v <none>] [-b <none>] [-s <filename>] <filename><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">       -a <arch>  ( --arch <arch> )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">            Specify the architecture for the target.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">       -b  ( --build )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">            Specify the initial SDK build number.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">       -p <platform-name>  ( --platform <platform-name> )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">            Specify name of the platform to use for this target, creating the platform if necessary.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">       -s <filename>  ( --sysroot <filename> )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">            Specify the SDK root directory that contains a root of all remote system files.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">       -v  ( --version )<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">            Specify the initial SDK version to use prior to connecting.<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">(lldb) target create --core /cores/core.1235<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">lldb: unrecognized option `--core'<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">error: unknown or ambiguous option<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Could you tell me what vernon of lldb the core support is in? Thanks!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Nov 1, 2012, at 1:35 PM, Greg Clayton wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
On Nov 1, 2012, at 8:30 AM, Sara Burke <<a href="mailto:Sara.Burke@mathworks.com">Sara.Burke@mathworks.com</a>> wrote:<br>
<br>
<br>
<o:p></o:p></p>
<p class="MsoNormal">Hi lldb-dev,<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><o:p> </o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal">I have a question regarding debugging a core file. With gdb, one can specify -c <core_file> to debug a core file. However, I can find no documentation to do this with lldb. Is there such a way? lldb seems to think the core file is an executable,
 which isn't necessarily what I would like. Any suggestions?<o:p></o:p></p>
</blockquote>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><o:p> </o:p></p>
</blockquote>
<p class="MsoNormal"><br>
(lldb) apropos core<br>
The following commands may relate to 'core':<br>
target create -- Create a target using the argument as the main executable.<br>
(lldb) help target create<br>
  Create a target using the argument as the main executable.<br>
<br>
Syntax: target create <cmd-options> <filename><br>
<br>
Command Options Usage:<br>
 target create [-a <arch>] [-p <platform-name>] [-v <none>] [-b <none>] [-s <filename>] [-c <path>] <filename><br>
<br>
      -a <arch>  ( --arch <arch> )<br>
           Specify the architecture for the target.<br>
<br>
      -b  ( --build )<br>
           Specify the initial SDK build number.<br>
<br>
      -c <path>  ( --core <path> )<br>
           Fullpath to a core file to use for this target.<br>
<br>
      -p <platform-name>  ( --platform <platform-name> )<br>
           Specify name of the platform to use for this target, creating the platform if necessary.<br>
<br>
      -s <filename>  ( --sysroot <filename> )<br>
           Specify the SDK root directory that contains a root of all remote system files.<br>
<br>
      -v  ( --version )<br>
           Specify the initial SDK version to use prior to connecting.<br>
<br>
This command takes options and arguments, if your arguments look like option specifiers you must use '--' to terminate the options before starting to give the arguments.<br>
<br>
<br>
<br>
So there is documentation.<br>
<br>
(lldb) target create --core /cores/core.1235<br>
<br>
You can optionally give us the architecture and/or executable file if you know them:<br>
<br>
(lldb) target create --core /cores/core.1235 --arch x86_64 /path/to/executable<br>
<br>
After this commend, you can then do a:<br>
<br>
(lldb) thread list<br>
(lldb) thread backtrace all<br>
<br>
Core files only work for mach-o core files right now. ELF support hasn't been done yet, but there is good sample code to follow in the following directory:<br>
<br>
lldb/source/Plugins/Process/mach-core<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:13.5pt"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black"> <o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black">-----------------------------------------------------------------</span></span><span class="apple-style-span"><span style="font-family:"Menlo","serif""><o:p></o:p></span></span></p>
<div>
<div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-size:13.5pt;font-family:"Helvetica","sans-serif";color:black"> </span></span><span class="apple-style-span"><span style="font-size:8.5pt;font-family:"Futura","serif";color:black">Sara M.
 Burke </span></span><span class="apple-style-span"><span style="font-family:"Helvetica","sans-serif""><o:p></o:p></span></span></p>
<div>
<p class="MsoNormal"><span class="apple-style-span"><span style="font-size:7.5pt;font-family:"Helvetica","sans-serif";color:#858585"> Ext. 7476</span></span><span style="font-size:13.5pt;color:black"><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>