This is an archive of the discontinued LLVM Phabricator instance.

Fix -data-evaluate-expression for array.
ClosedPublic

Authored by abidh on Sep 4 2015, 8:05 AM.

Details

Summary

For an array declared like "blk[2][3]", this command was showing:
-data-evaluate-expression blk
^done,value="{[0] = [3], [1] = [3]}"

After this fix, it shows:
-data-evaluate-expression blk
^done,value="{[0] = {[0] = 1, [1] = 2, [2] = 3}, [1] = {[0] = 4, [1] = 5, [2] = 6}}"

The code to do the right thing was already available and used by other commands.
So I have just used that and removed the half-baked previous implementation.

Diff Detail

Event Timeline

abidh updated this revision to Diff 34031.Sep 4 2015, 8:05 AM
abidh retitled this revision from to Fix -data-evaluate-expression for array..
abidh updated this object.
abidh added a reviewer: ki.stfu.
abidh added a subscriber: lldb-commits.
ki.stfu requested changes to this revision.Sep 4 2015, 11:29 AM
ki.stfu edited edge metadata.

Source code looks good but please move the test to TestMiData.py.

test/tools/lldb-mi/variable/TestMiVar.py
39–42 ↗(On Diff #34031)

Please move it to a separate @lldmi_test test in data/TestMiData.py

test/tools/lldb-mi/variable/main.cpp
105–110 ↗(On Diff #34031)

Move it to data/main.cpp and create a separate function for that (data_evaluate_expression_test, for example)

This revision now requires changes to proceed.Sep 4 2015, 11:29 AM
abidh updated this revision to Diff 34136.Sep 7 2015, 3:09 AM
abidh edited edge metadata.

Handle review comments.
Moved the test to data directory and put it in a separate function.

ki.stfu accepted this revision.Sep 7 2015, 4:45 AM
ki.stfu edited edge metadata.
This revision is now accepted and ready to land.Sep 7 2015, 4:45 AM
abidh closed this revision.Sep 7 2015, 5:02 AM