<div style="font-family:Verdana;font-size:14px;color:#000;"><div>ping</div><div><br></div><div> </div><div><sign signid="98"><div style="color:#909090;font-family:Arial Narrow;font-size:12px"><br /><br /><br /><br /></div><div style='font-size:14px;font-family:Verdana;color:#000;'><div style="overflow:hidden;"><table class="preview_table"><tr><td valign="middle"><img id="preview_qrcode" src="https://exmail.qq.com/cgi-bin/setting_qrcode_card?action=qrcode_card&alias=lingcc@lingcc.com&key=cf0d878c1b209e40"  /></td><td valign="middle" style="color:#a0a0a0;font-size:12px;"><h4 class="name" style="margin:0;font-size:14px;font-weight:bold;line-height:28px;color:#000;zoom:1;">lingcc</h4><p class="position" style="margin:0;"></p><p class="department" style="margin:0;">52mianshiti.com/Lingcc.com</p><p class="tel" style="margin:0;"></p><p class="mobile" style="margin:0;"></p><p class="addr" style="margin:0;line-height:22px;color:#a0a0a0;">北京市昌平区</p></td></tr></table></div></div></sign></div><div> </div><div style="font:Verdana normal 14px;color:#000;padding:8px 0px;"><div> </div><div> </div><div style="FONT-SIZE: 12px;FONT-FAMILY: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="FONT-SIZE: 12px;background:#efefef;padding:8px;"><div><b>From:</b> "Kun  LIng"<lingcc@lingcc.com>; </div><div><b>Date:</b> 2014年8月30日(星期六) 下午3:58</div><div><b>To:</b> "lldb-dev"<lldb-dev@cs.uiuc.edu>; </div><div><b>Subject:</b> [lldb-dev] Is there a way to know whether a variable have been init?</div></div><div> </div>Hi all,<br>    I am currently using python interface to run a non-interactively script based on LLDB to trace the variable changing during each step during the program running. <br><br>    C allows a variable to be declared at first without initialization.  And the value of the variable after declaration could be a random value before initialized according to my test using LLDB with the following code compiled by clang+llvm. <br><br>----Example Code ----<br><div>#include <stdio.h></div><div>#include <stdlib.h></div><div>int g = 42;</div><div>float u = 5;</div><div>struct node {</div><div>  int field;</div><div>  struct node* next;</div><div>};</div><div>void f() {</div><div>    g = g + 1;</div><div>    printf("Hello world!\n");</div><div>}</div><div><br></div><div>int <span style="line-height: 1.5;">main(int argc, char *argv[])</span></div><div>{</div><div><span style="line-height: 1.5;">  int x;</span></div><div>  int y=10;</div><div>  x  = y+1;</div><div>  struct node* root = (struct node*)malloc(sizeof(struct node));</div><div>  root->field = 3;</div><div>  root->next = (struct node*)malloc(sizeof(struct node));</div><div>  root->next->field = 2;</div><div>  free(root->next);</div><div>  free(root);</div><div><br></div><div>  int i = 0;</div><div>  i = i + 1;</div><div>  f();</div><div>  return 0;</div><div>}<br></div><br>-----End Example Code ----<br><br>   My question is:<br>   In LLDB, is there a way to check whether a variable is currently be declared, and have not been initialized? So that my non-interactively script could check this, and ignore to show it before initialized ?<div><br>   Thanks very much.<br><br>Best,<br>Kun Ling<br> </div>  <!-- --><style></style></div></div>