This is an archive of the discontinued LLVM Phabricator instance.

Add a class ValueObjectConstResultCast.
ClosedPublic

Authored by sivachandra on Jul 14 2015, 3:40 PM.

Details

Summary

Other changes around the main change include:

  1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl

and ValueObjectConstResultChild.

  1. Add an argument |live_address| of type lldb::addr_t to the constructor

of ValueObjectConstResultChild. This is passed on to the backing
ValueObjectConstResultImpl object constructor so that the address of the
child value can be calculated properly.

Diff Detail

Event Timeline

sivachandra retitled this revision from to Add a class ValueObjectConstResultCast..
sivachandra updated this object.
sivachandra added a subscriber: lldb-commits.

I will add tests in case the general direction of this change is OK.

clayborg edited edge metadata.Jul 15 2015, 11:23 AM

I would almost rather see us create a ValueObjectCast class that just takes another ValueObjectSP and a new type to cast it to. We might want there to be different cast types like static, reinterpret, or dynamic. Is there a reason this is ValueObjectConstResultCast? I think it would be great to be able to cast any ValueObjectSP if possible. I will talk more with Jim Ingham on this and get back to you.

clayborg accepted this revision.Jul 15 2015, 1:19 PM
clayborg edited edge metadata.

Actually after speaking with Jim Ingham and Enrico Granata, this is the way it should be for now.

This revision is now accepted and ready to land.Jul 15 2015, 1:19 PM
granata.enrico accepted this revision.Jul 15 2015, 1:20 PM
granata.enrico edited edge metadata.

This patch is fine for now if that is what is required in the current model

In general, a redesign of how Cast works (and even - on a broader level - what operations might fall under the "casting" label in a debugger) would be great, but that is definitely beyond the scope of your change

sivachandra edited edge metadata.

Added tests.

Thanks for the review, I will commit this shortly.

sivachandra closed this revision.Jul 15 2015, 6:47 PM