<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 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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-IN" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am trying to debug a simple c program,<o:p></o:p></p>
<p class="MsoNormal"><i><span style="color:#4472C4">int main() {<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> char arr[] = "Hello World!";<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">}<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">On gdb, while printing variable content with force formatting,<o:p></o:p></p>
<p class="MsoNormal"><i>(gdb) l<o:p></o:p></i></p>
<p class="MsoNormal"><i>1 int main() {<o:p></o:p></i></p>
<p class="MsoNormal"><i>2 char arr[] = "Hello World!";<o:p></o:p></i></p>
<p class="MsoNormal"><i>3 }<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb) b 3<o:p></o:p></i></p>
<p class="MsoNormal"><i>Breakpoint 2 at 0x40050a: file string.c, line 3.<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb) r<o:p></o:p></i></p>
<p class="MsoNormal"><i>Starting program: /home/chirag/Desktop/test/./a.out<o:p></o:p></i></p>
<p class="MsoNormal"><i><o:p> </o:p></i></p>
<p class="MsoNormal"><i>Breakpoint 2, main () at string.c:3<o:p></o:p></i></p>
<p class="MsoNormal"><i>3 }<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb) p arr<o:p></o:p></i></p>
<p class="MsoNormal"><i>$4 = "Hello World!"<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb) p /d arr<o:p></o:p></i></p>
<p class="MsoNormal"><i>$5 = {72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33, 0}<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb) p /x arr<o:p></o:p></i></p>
<p class="MsoNormal"><i>$6 = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, 0x0}<o:p></o:p></i></p>
<p class="MsoNormal"><i>(gdb)<o:p></o:p></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">While on lldb, <o:p></o:p></p>
<p class="MsoNormal"><i><span style="color:#4472C4">(lldb) l<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> 1 int main() {<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> 2 char arr[] = "Hello World!";<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> 3 }<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">(lldb) b 3<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">Breakpoint 1: where = a.out`main + 29 at string.c:3, address = 0x000000000040050a<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">(lldb) r<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">Process 59671 launched: '/home/chirag/Desktop/test/a.out' (x86_64)<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">Process 59671 stopped<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">* thread #1, name = 'a.out', stop reason = breakpoint 1.1<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> frame #0: 0x000000000040050a a.out`main at string.c:3<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> 1 int main() {<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4"> 2 char arr[] = "Hello World!";<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">-> 3 }<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(lldb) fr v arr<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(char [13]) arr = "Hello World!"<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(lldb) fr v arr -f d<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(char [13]) arr = "Hello World!"<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(lldb) fr v arr -f x<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:red">(char [13]) arr = "Hello World!"<o:p></o:p></span></i></p>
<p class="MsoNormal"><i><span style="color:#4472C4">(lldb)<o:p></o:p></span></i></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">It seems like lldb type summary is completely ignoring the force format option, is it a bug or it is intended?<b><span lang="EN-US" style="color:#2F5597;mso-fareast-language:FR-BE"><o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#2F5597;mso-fareast-language:FR-BE"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#2F5597;mso-fareast-language:FR-BE">Regards,<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="color:#2F5597;mso-fareast-language:FR-BE"><o:p> </o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Chirag Patel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Software Engineer | Raincode Labs India
<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Tel</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">: (+91) 080 41159811<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">Mob</span></b><span lang="EN-US" style="font-size:12.0pt;color:#2F5597;mso-fareast-language:FR-BE">: (+91) 9049336744<o:p></o:p></span></p>
<p class="MsoNormal"><u><span lang="EN-US" style="font-size:12.0pt;color:blue;mso-fareast-language:FR-BE"><a href="http://www.raincodelabs.com/"><span style="color:#0563C1">www.raincodelabs.com</span></a><o:p></o:p></span></u></p>
<p class="MsoNormal"><a href="https://in.linkedin.com/in/chirag-patel-"><span style="font-size:10.0pt;color:#0563C1;mso-fareast-language:FR-BE;text-decoration:none"><img border="0" width="180" height="60" style="width:1.875in;height:.625in" id="Picture_x0020_1" src="cid:image003.png@01D5C629.1E9BE670" alt="linkedin-button"></span></a><span style="font-size:10.0pt;color:#2F5597;mso-fareast-language:FR-BE"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>