<div dir="ltr"><div dir="ltr">Hi All,<div>We would like to propose a variable tracking for LLDB. The objective and definition of the project are updated in this <a href="https://docs.google.com/document/d/1_j16G1I-rYaJ4G86CurBVJ7BIXLyuNg_bxP_I8n7rPQ/edit?usp=sharing">document</a>. We would like to know id this a project that the community would like to support and may be down the line add to LLDB mainline</div><div><br></div><div>-- A brief of what we are proposing</div><div><br></div><div><span id="gmail-docs-internal-guid-f6d8b8a0-7fff-3fb3-5990-65b160818501"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">What are we trying to do?</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">A lot of bugs are introduced by the wrong/unexpected update of a variable. Programmers often track the changes in the value of variables to identify the error in their program. However the point of detection (of the error) is much later than the point of occurrence (the actual error point)  and the user often relies on multiple debug runs or new techniques such as reverse debugging to make the process faster. The user can also rely on watchpoints but it breaks at every update, which can sometimes become very irritating.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Our aim is to reduce the user effort by providing an opportunity to track the changes to the variables of interest at the point of detection.  This would save a lot of time and effort from the user. </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">For this, we record the variable changes after each instruction, under the LLDB Client. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:11pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">What would it look like in LLDB?</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We are trying to  introduce a new LLDB command called as </span><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-style:italic;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">track </span><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> which along with a variable name would print the values and source code instruction at which the variable is executed. </span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">For example here we are trying to track the variable a.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><span style="border:none;display:inline-block;overflow:hidden;width:588px;height:161px"><img src="https://lh3.googleusercontent.com/jQA34vMfEK1J9He2Suz7wbfxagfySGkyCKMtjNyvj9VQiHx0hjrqtLEvC4asMKHhH9o-G80qMHPbq7mD9ALZjwOMG_qi_buI8dDDj3rF1JSIq3_5WG5gWHaUJzd9Bi-B_L3LwZUO=s0" width="588" height="161" style="margin-left: 0px; margin-top: 0px;"></span></span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">Track details will contain the file name, the new  value, the line number and the source line.</span></p><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">We understand that this has a substantial overhead so we would like to introduce an enable and disable </span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"> Commands:</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The commands that will be introduced in LLDB is as follows,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">enable track</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">This command will set or enable the tracking mechanism to start tracking the variable changes.</span></p><br><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">disable track</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">This command will unset or disable the tracking mechanism to stop tracking the variable changes.</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Courier New";color:rgb(0,0,0);background-color:transparent;font-weight:700;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">track variable_name</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap">The user command track variable name will list the variable value, corresponding source code line number along with address of instruction and file name.</span></p><div><span style="font-size:12pt;font-family:"Times New Roman";color:rgb(0,0,0);background-color:transparent;font-variant-numeric:normal;font-variant-east-asian:normal;vertical-align:baseline;white-space:pre-wrap"><br></span></div></span></div><div><br><div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Thanks and Regards,</div><div><a href="https://sites.google.com/site/jkrishnavs" target="_blank">Jyothi Krishna V S</a></div></div></div></div></div></div></div></div></div></div></div>