[Lldb-commits] New feature suggestion: Tacking variable update

Jyothi Krishna V S via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 24 23:53:40 PDT 2021

Hi All,
We would like to propose a variable tracking for LLDB. The objective and
definition of the project are updated in this document
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

-- A brief of what we are proposing

What are we trying to do?

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

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.

For this, we record the variable changes after each instruction, under the
LLDB Client.

What would it look like in LLDB?

We are trying to  introduce a new LLDB command called as track  which along
with a variable name would print the values and source code instruction at
which the variable is executed.

For example here we are trying to track the variable a.

Track details will contain the file name, the new  value, the line number
and the source line.

We understand that this has a substantial overhead so we would like to
introduce an enable and disable


The commands that will be introduced in LLDB is as follows,

enable track

This command will set or enable the tracking mechanism to start tracking
the variable changes.

disable track

This command will unset or disable the tracking mechanism to stop tracking
the variable changes.

track variable_name

The user command track variable name will list the variable value,
corresponding source code line number along with address of instruction and
file name.

Thanks and Regards,
Jyothi Krishna V S <https://sites.google.com/site/jkrishnavs>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20210825/87c59594/attachment.html>

More information about the lldb-commits mailing list