ValueObject.h revision 9ae7cef26612773c6b3422834cec83f0fbb2cf8c
1//===-- ValueObject.h -------------------------------------------*- C++ -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef liblldb_ValueObject_h_
11#define liblldb_ValueObject_h_
12
13// C Includes
14// C++ Includes
15#include <map>
16#include <vector>
17// Other libraries and framework includes
18// Project includes
19
20#include "lldb/lldb-private.h"
21#include "lldb/Core/DataExtractor.h"
22#include "lldb/Core/Error.h"
23#include "lldb/Core/Flags.h"
24#include "lldb/Core/ConstString.h"
25#include "lldb/Core/UserID.h"
26#include "lldb/Core/Value.h"
27#include "lldb/Target/ExecutionContext.h"
28#include "lldb/Target/ExecutionContextScope.h"
29#include "lldb/Target/StackID.h"
30#include "lldb/Utility/PriorityPointerPair.h"
31#include "lldb/Utility/SharedCluster.h"
32
33namespace lldb_private {
34
35/// ValueObject:
36///
37/// This abstract class provides an interface to a particular value, be it a register, a local or global variable,
38/// that is evaluated in some particular scope.  The ValueObject also has the capibility of being the "child" of
39/// some other variable object, and in turn of having children.
40/// If a ValueObject is a root variable object - having no parent - then it must be constructed with respect to some
41/// particular ExecutionContextScope.  If it is a child, it inherits the ExecutionContextScope from its parent.
42/// The ValueObject will update itself if necessary before fetching its value, summary, object description, etc.
43/// But it will always update itself in the ExecutionContextScope with which it was originally created.
44
45/// A brief note on life cycle management for ValueObjects.  This is a little tricky because a ValueObject can contain
46/// various other ValueObjects - the Dynamic Value, its children, the dereference value, etc.  Any one of these can be
47/// handed out as a shared pointer, but for that contained value object to be valid, the root object and potentially other
48/// of the value objects need to stay around.
49/// We solve this problem by handing out shared pointers to the Value Object and any of its dependents using a shared
50/// ClusterManager.  This treats each shared pointer handed out for the entire cluster as a reference to the whole
51/// cluster.  The whole cluster will stay around until the last reference is released.
52///
53/// The ValueObject mostly handle this automatically, if a value object is made with a Parent ValueObject, then it adds
54/// itself to the ClusterManager of the parent.
55
56/// It does mean that external to the ValueObjects we should only ever make available ValueObjectSP's, never ValueObjects
57/// or pointers to them.  So all the "Root level" ValueObject derived constructors should be private, and
58/// should implement a Create function that new's up object and returns a Shared Pointer that it gets from the GetSP() method.
59///
60/// However, if you are making an derived ValueObject that will be contained in a parent value object, you should just
61/// hold onto a pointer to it internally, and by virtue of passing the parent ValueObject into its constructor, it will
62/// be added to the ClusterManager for the parent.  Then if you ever hand out a Shared Pointer to the contained ValueObject,
63/// just do so by calling GetSP() on the contained object.
64
65class ValueObject : public UserID
66{
67public:
68
69    enum GetExpressionPathFormat
70    {
71        eDereferencePointers = 1,
72        eHonorPointers
73    };
74
75    enum ValueObjectRepresentationStyle
76    {
77        eDisplayValue = 1,
78        eDisplaySummary,
79        eDisplayLanguageSpecific,
80        eDisplayLocation
81    };
82
83    enum ExpressionPathScanEndReason
84    {
85        eEndOfString = 1,           // out of data to parse
86        eNoSuchChild,               // child element not found
87        eEmptyRangeNotAllowed,      // [] only allowed for arrays
88        eDotInsteadOfArrow,         // . used when -> should be used
89        eArrowInsteadOfDot,         // -> used when . should be used
90        eFragileIVarNotAllowed,     // ObjC ivar expansion not allowed
91        eRangeOperatorNotAllowed,   // [] not allowed by options
92        eRangeOperatorInvalid,      // [] not valid on objects other than scalars, pointers or arrays
93        eArrayRangeOperatorMet,     // [] is good for arrays, but I cannot parse it
94        eBitfieldRangeOperatorMet,  // [] is good for bitfields, but I cannot parse after it
95        eUnexpectedSymbol,          // something is malformed in the expression
96        eTakingAddressFailed,       // impossible to apply & operator
97        eDereferencingFailed,       // impossible to apply * operator
98        eRangeOperatorExpanded,     // [] was expanded into a VOList
99        eUnknown = 0xFFFF
100    };
101
102    enum ExpressionPathEndResultType
103    {
104        ePlain = 1,                 // anything but...
105        eBitfield,                  // a bitfield
106        eBoundedRange,              // a range [low-high]
107        eUnboundedRange,            // a range []
108        eValueObjectList,           // several items in a VOList
109        eInvalid = 0xFFFF
110    };
111
112    enum ExpressionPathAftermath
113    {
114        eNothing = 1,               // just return it
115        eDereference,               // dereference the target
116        eTakeAddress                // take target's address
117    };
118
119    struct GetValueForExpressionPathOptions
120    {
121        bool m_check_dot_vs_arrow_syntax;
122        bool m_no_fragile_ivar;
123        bool m_allow_bitfields_syntax;
124
125        GetValueForExpressionPathOptions(bool dot = false,
126                                         bool no_ivar = false,
127                                         bool bitfield = true) :
128            m_check_dot_vs_arrow_syntax(dot),
129            m_no_fragile_ivar(no_ivar),
130            m_allow_bitfields_syntax(bitfield)
131        {
132        }
133
134        GetValueForExpressionPathOptions&
135        DoCheckDotVsArrowSyntax()
136        {
137            m_check_dot_vs_arrow_syntax = true;
138            return *this;
139        }
140
141        GetValueForExpressionPathOptions&
142        DontCheckDotVsArrowSyntax()
143        {
144            m_check_dot_vs_arrow_syntax = false;
145            return *this;
146        }
147
148        GetValueForExpressionPathOptions&
149        DoAllowFragileIVar()
150        {
151            m_no_fragile_ivar = false;
152            return *this;
153        }
154
155        GetValueForExpressionPathOptions&
156        DontAllowFragileIVar()
157        {
158            m_no_fragile_ivar = true;
159            return *this;
160        }
161
162        GetValueForExpressionPathOptions&
163        DoAllowBitfieldSyntax()
164        {
165            m_allow_bitfields_syntax = true;
166            return *this;
167        }
168
169        GetValueForExpressionPathOptions&
170        DontAllowBitfieldSyntax()
171        {
172            m_allow_bitfields_syntax = false;
173            return *this;
174        }
175
176        static const GetValueForExpressionPathOptions
177        DefaultOptions()
178        {
179            static GetValueForExpressionPathOptions g_default_options;
180
181            return g_default_options;
182        }
183
184    };
185
186    class EvaluationPoint
187    {
188    public:
189
190        EvaluationPoint ();
191
192        EvaluationPoint (ExecutionContextScope *exe_scope, bool use_selected = false);
193
194        EvaluationPoint (const EvaluationPoint &rhs);
195
196        ~EvaluationPoint ();
197
198        ExecutionContextScope *
199        GetExecutionContextScope ();
200
201        Target *
202        GetTarget () const
203        {
204            return m_target_sp.get();
205        }
206
207        Process *
208        GetProcess () const
209        {
210            return m_process_sp.get();
211        }
212
213        // Set the EvaluationPoint to the values in exe_scope,
214        // Return true if the Evaluation Point changed.
215        // Since the ExecutionContextScope is always going to be valid currently,
216        // the Updated Context will also always be valid.
217
218        bool
219        SetContext (ExecutionContextScope *exe_scope);
220
221        void
222        SetIsConstant ()
223        {
224            SetUpdated();
225            m_stop_id = LLDB_INVALID_UID;
226        }
227
228        bool
229        IsConstant () const
230        {
231            return m_stop_id == LLDB_INVALID_UID;
232        }
233
234        lldb::user_id_t
235        GetUpdateID () const
236        {
237            return m_stop_id;
238        }
239
240        void
241        SetUpdateID (lldb::user_id_t new_id)
242        {
243            m_stop_id = new_id;
244        }
245
246        bool
247        IsFirstEvaluation () const
248        {
249            return m_first_update;
250        }
251
252        void
253        SetNeedsUpdate ()
254        {
255            m_needs_update = true;
256        }
257
258        void
259        SetUpdated ();
260
261        bool
262        NeedsUpdating()
263        {
264            SyncWithProcessState();
265            return m_needs_update;
266        }
267
268        bool
269        IsValid ()
270        {
271            if (m_stop_id == LLDB_INVALID_UID)
272                return false;
273            else if (SyncWithProcessState ())
274            {
275                if (m_stop_id == LLDB_INVALID_UID)
276                    return false;
277            }
278            return true;
279        }
280
281        void
282        SetInvalid ()
283        {
284            // Use the stop id to mark us as invalid, leave the thread id and the stack id around for logging and
285            // history purposes.
286            m_stop_id = LLDB_INVALID_UID;
287
288            // Can't update an invalid state.
289            m_needs_update = false;
290
291//            m_thread_id = LLDB_INVALID_THREAD_ID;
292//            m_stack_id.Clear();
293        }
294
295    private:
296        bool
297        SyncWithProcessState ();
298
299        ExecutionContextScope *m_exe_scope;   // This is not the way to store the evaluation point state, it is just
300                                            // a cache of the lookup, and gets thrown away when we update.
301        bool             m_needs_update;
302        bool             m_first_update;
303
304        lldb::TargetSP   m_target_sp;
305        lldb::ProcessSP  m_process_sp;
306        lldb::user_id_t  m_thread_id;
307        StackID          m_stack_id;
308        lldb::user_id_t  m_stop_id; // This is the stop id when this ValueObject was last evaluated.
309    };
310
311    const EvaluationPoint &
312    GetUpdatePoint () const
313    {
314        return m_update_point;
315    }
316
317    EvaluationPoint &
318    GetUpdatePoint ()
319    {
320        return m_update_point;
321    }
322
323    ExecutionContextScope *
324    GetExecutionContextScope ()
325    {
326        return m_update_point.GetExecutionContextScope();
327    }
328
329    virtual ~ValueObject();
330
331    //------------------------------------------------------------------
332    // Sublasses must implement the functions below.
333    //------------------------------------------------------------------
334    virtual size_t
335    GetByteSize() = 0;
336
337    virtual clang::ASTContext *
338    GetClangAST () = 0;
339
340    virtual lldb::clang_type_t
341    GetClangType () = 0;
342
343    virtual lldb::ValueType
344    GetValueType() const = 0;
345
346    virtual ConstString
347    GetTypeName() = 0;
348
349    virtual lldb::LanguageType
350    GetObjectRuntimeLanguage();
351
352    virtual bool
353    IsPointerType ();
354
355    virtual bool
356    IsArrayType ();
357
358    virtual bool
359    IsScalarType ();
360
361    virtual bool
362    IsPointerOrReferenceType ();
363
364    virtual bool
365    IsPossibleCPlusPlusDynamicType ();
366
367    virtual bool
368    IsPossibleDynamicType ();
369
370    virtual bool
371    IsBaseClass ()
372    {
373        return false;
374    }
375
376    virtual bool
377    IsDereferenceOfParent ()
378    {
379        return false;
380    }
381
382    bool
383    IsIntegerType (bool &is_signed);
384
385    virtual bool
386    GetBaseClassPath (Stream &s);
387
388    virtual void
389    GetExpressionPath (Stream &s, bool qualify_cxx_base_classes, GetExpressionPathFormat = eDereferencePointers);
390
391    lldb::ValueObjectSP
392    GetValueForExpressionPath(const char* expression,
393                              const char** first_unparsed = NULL,
394                              ExpressionPathScanEndReason* reason_to_stop = NULL,
395                              ExpressionPathEndResultType* final_value_type = NULL,
396                              const GetValueForExpressionPathOptions& options = GetValueForExpressionPathOptions::DefaultOptions(),
397                              ExpressionPathAftermath* final_task_on_target = NULL);
398
399    int
400    GetValuesForExpressionPath(const char* expression,
401                               lldb::ValueObjectListSP& list,
402                               const char** first_unparsed = NULL,
403                               ExpressionPathScanEndReason* reason_to_stop = NULL,
404                               ExpressionPathEndResultType* final_value_type = NULL,
405                               const GetValueForExpressionPathOptions& options = GetValueForExpressionPathOptions::DefaultOptions(),
406                               ExpressionPathAftermath* final_task_on_target = NULL);
407
408    virtual bool
409    IsInScope ()
410    {
411        return true;
412    }
413
414    virtual off_t
415    GetByteOffset()
416    {
417        return 0;
418    }
419
420    virtual uint32_t
421    GetBitfieldBitSize()
422    {
423        return 0;
424    }
425
426    virtual uint32_t
427    GetBitfieldBitOffset()
428    {
429        return 0;
430    }
431
432    virtual bool
433    IsArrayItemForPointer()
434    {
435        return m_is_array_item_for_pointer;
436    }
437
438    virtual bool
439    SetClangAST (clang::ASTContext *ast)
440    {
441        return false;
442    }
443
444    virtual const char *
445    GetValueAsCString ();
446
447    virtual bool
448    SetValueFromCString (const char *value_str);
449
450    // Return the module associated with this value object in case the
451    // value is from an executable file and might have its data in
452    // sections of the file. This can be used for variables.
453    virtual Module *
454    GetModule()
455    {
456        if (m_parent)
457            return m_parent->GetModule();
458        return NULL;
459    }
460    //------------------------------------------------------------------
461    // The functions below should NOT be modified by sublasses
462    //------------------------------------------------------------------
463    const Error &
464    GetError();
465
466    const ConstString &
467    GetName() const;
468
469    virtual lldb::ValueObjectSP
470    GetChildAtIndex (uint32_t idx, bool can_create);
471
472    virtual lldb::ValueObjectSP
473    GetChildMemberWithName (const ConstString &name, bool can_create);
474
475    virtual uint32_t
476    GetIndexOfChildWithName (const ConstString &name);
477
478    uint32_t
479    GetNumChildren ();
480
481    const Value &
482    GetValue() const;
483
484    Value &
485    GetValue();
486
487    bool
488    ResolveValue (Scalar &scalar);
489
490    const char *
491    GetLocationAsCString ();
492
493    const char *
494    GetSummaryAsCString ();
495
496    const char *
497    GetObjectDescription ();
498
499    const char *
500    GetPrintableRepresentation(ValueObjectRepresentationStyle val_obj_display = eDisplaySummary,
501                               lldb::Format custom_format = lldb::eFormatInvalid);
502
503    bool
504    DumpPrintableRepresentation(Stream& s,
505                                ValueObjectRepresentationStyle val_obj_display = eDisplaySummary,
506                                lldb::Format custom_format = lldb::eFormatInvalid);
507    bool
508    GetValueIsValid () const;
509
510    bool
511    GetValueDidChange ();
512
513    bool
514    UpdateValueIfNeeded (bool update_format = true);
515
516    void
517    UpdateFormatsIfNeeded();
518
519    DataExtractor &
520    GetDataExtractor ();
521
522    bool
523    Write ();
524
525    lldb::ValueObjectSP
526    GetSP ()
527    {
528        return m_manager->GetSharedPointer(this);
529    }
530
531protected:
532    void
533    AddSyntheticChild (const ConstString &key,
534                       ValueObject *valobj);
535public:
536    lldb::ValueObjectSP
537    GetSyntheticChild (const ConstString &key) const;
538
539    lldb::ValueObjectSP
540    GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create);
541
542    lldb::ValueObjectSP
543    GetSyntheticArrayMemberFromArray (int32_t index, bool can_create);
544
545    lldb::ValueObjectSP
546    GetSyntheticBitFieldChild (uint32_t from, uint32_t to, bool can_create);
547
548    lldb::ValueObjectSP
549    GetSyntheticExpressionPathChild(const char* expression, bool can_create);
550
551    lldb::ValueObjectSP
552    GetDynamicValue (lldb::DynamicValueType valueType);
553
554    lldb::ValueObjectSP
555    GetSyntheticValue (lldb::SyntheticValueType use_synthetic);
556
557    virtual lldb::ValueObjectSP
558    CreateConstantValue (const ConstString &name);
559
560    virtual lldb::ValueObjectSP
561    Dereference (Error &error);
562
563    virtual lldb::ValueObjectSP
564    AddressOf (Error &error);
565
566    virtual lldb::ValueObjectSP
567    CastPointerType (const char *name,
568                     ClangASTType &ast_type);
569
570    virtual lldb::ValueObjectSP
571    CastPointerType (const char *name,
572                     lldb::TypeSP &type_sp);
573
574    // The backing bits of this value object were updated, clear any value
575    // values, summaries or descriptions so we refetch them.
576    virtual void
577    ValueUpdated ()
578    {
579        m_value_str.clear();
580        m_summary_str.clear();
581        m_object_desc_str.clear();
582    }
583
584    virtual bool
585    IsDynamic ()
586    {
587        return false;
588    }
589
590    static void
591    DumpValueObject (Stream &s,
592                     ValueObject *valobj,
593                     const char *root_valobj_name,
594                     uint32_t ptr_depth,
595                     uint32_t curr_depth,
596                     uint32_t max_depth,
597                     bool show_types,
598                     bool show_location,
599                     bool use_objc,
600                     lldb::DynamicValueType use_dynamic,
601                     bool use_synthetic,
602                     bool scope_already_checked,
603                     bool flat_output,
604                     uint32_t omit_summary_depth);
605
606    // returns true if this is a char* or a char[]
607    // if it is a char* and check_pointer is true,
608    // it also checks that the pointer is valid
609    bool
610    IsCStringContainer(bool check_pointer = false);
611
612    void
613    ReadPointedString(Stream& s,
614                      Error& error,
615                      uint32_t max_length = 0,
616                      bool honor_array = true,
617                      lldb::Format item_format = lldb::eFormatCharArray);
618
619    bool
620    GetIsConstant () const
621    {
622        return m_update_point.IsConstant();
623    }
624
625    void
626    SetIsConstant ()
627    {
628        m_update_point.SetIsConstant();
629    }
630
631    lldb::Format
632    GetFormat () const
633    {
634        if (m_parent && m_format == lldb::eFormatDefault)
635            return m_parent->GetFormat();
636        return m_format;
637    }
638
639    void
640    SetFormat (lldb::Format format)
641    {
642        if (format != m_format)
643            m_value_str.clear();
644        m_format = format;
645    }
646
647    void
648    SetCustomSummaryFormat(lldb::SummaryFormatSP format)
649    {
650        m_forced_summary_format = format;
651        m_user_id_of_forced_summary = m_update_point.GetUpdateID();
652        m_summary_str.clear();
653    }
654
655    lldb::SummaryFormatSP
656    GetCustomSummaryFormat()
657    {
658        return m_forced_summary_format;
659    }
660
661    void
662    ClearCustomSummaryFormat()
663    {
664        m_forced_summary_format.reset();
665        m_summary_str.clear();
666    }
667
668    bool
669    HasCustomSummaryFormat()
670    {
671        return (m_forced_summary_format.get());
672    }
673
674    lldb::SummaryFormatSP
675    GetSummaryFormat()
676    {
677        UpdateFormatsIfNeeded();
678        if (HasCustomSummaryFormat())
679            return m_forced_summary_format;
680        return m_last_summary_format;
681    }
682
683    // Use GetParent for display purposes, but if you want to tell the parent to update itself
684    // then use m_parent.  The ValueObjectDynamicValue's parent is not the correct parent for
685    // displaying, they are really siblings, so for display it needs to route through to its grandparent.
686    virtual ValueObject *
687    GetParent()
688    {
689        return m_parent;
690    }
691
692    virtual const ValueObject *
693    GetParent() const
694    {
695        return m_parent;
696    }
697
698    ValueObject *
699    GetNonBaseClassParent();
700
701    void
702    SetPointersPointToLoadAddrs (bool b)
703    {
704        m_pointers_point_to_load_addrs = b;
705    }
706
707protected:
708    typedef ClusterManager<ValueObject> ValueObjectManager;
709
710    //------------------------------------------------------------------
711    // Classes that inherit from ValueObject can see and modify these
712    //------------------------------------------------------------------
713    ValueObject  *      m_parent;       // The parent value object, or NULL if this has no parent
714    EvaluationPoint     m_update_point; // Stores both the stop id and the full context at which this value was last
715                                        // updated.  When we are asked to update the value object, we check whether
716                                        // the context & stop id are the same before updating.
717    ConstString         m_name;         // The name of this object
718    DataExtractor       m_data;         // A data extractor that can be used to extract the value.
719    Value               m_value;
720    Error               m_error;        // An error object that can describe any errors that occur when updating values.
721    std::string         m_value_str;    // Cached value string that will get cleared if/when the value is updated.
722    std::string         m_old_value_str;// Cached old value string from the last time the value was gotten
723    std::string         m_location_str; // Cached location string that will get cleared if/when the value is updated.
724    std::string         m_summary_str;  // Cached summary string that will get cleared if/when the value is updated.
725    std::string         m_object_desc_str; // Cached result of the "object printer".  This differs from the summary
726                                              // in that the summary is consed up by us, the object_desc_string is builtin.
727
728    ValueObjectManager *m_manager;      // This object is managed by the root object (any ValueObject that gets created
729                                        // without a parent.)  The manager gets passed through all the generations of
730                                        // dependent objects, and will keep the whole cluster of objects alive as long
731                                        // as a shared pointer to any of them has been handed out.  Shared pointers to
732                                        // value objects must always be made with the GetSP method.
733
734    std::vector<ValueObject *> m_children;
735    std::map<ConstString, ValueObject *> m_synthetic_children;
736    ValueObject *m_dynamic_value;
737    ValueObject *m_synthetic_value;
738    lldb::ValueObjectSP m_addr_of_valobj_sp; // We have to hold onto a shared pointer to this one because it is created
739                                             // as an independent ValueObjectConstResult, which isn't managed by us.
740    ValueObject *m_deref_valobj;
741
742    lldb::Format                m_format;
743    uint32_t                    m_last_format_mgr_revision;
744    lldb::SummaryFormatSP       m_last_summary_format;
745    lldb::SummaryFormatSP       m_forced_summary_format;
746    lldb::ValueFormatSP         m_last_value_format;
747    lldb::SyntheticChildrenSP   m_last_synthetic_filter;
748    lldb::user_id_t             m_user_id_of_forced_summary;
749
750    bool                m_value_is_valid:1,
751                        m_value_did_change:1,
752                        m_children_count_valid:1,
753                        m_old_value_valid:1,
754                        m_pointers_point_to_load_addrs:1,
755                        m_is_deref_of_parent:1,
756                        m_is_array_item_for_pointer:1,
757                        m_is_bitfield_for_scalar:1,
758                        m_is_expression_path_child:1;
759
760    // used to prevent endless looping into GetpPrintableRepresentation()
761    uint32_t            m_dump_printable_counter;
762    friend class ClangExpressionDeclMap;  // For GetValue
763    friend class ClangExpressionVariable; // For SetName
764    friend class Target;                  // For SetName
765
766    //------------------------------------------------------------------
767    // Constructors and Destructors
768    //------------------------------------------------------------------
769
770    // Use the no-argument constructor to make a constant variable object (with no ExecutionContextScope.)
771
772    ValueObject();
773
774    // Use this constructor to create a "root variable object".  The ValueObject will be locked to this context
775    // through-out its lifespan.
776
777    ValueObject (ExecutionContextScope *exe_scope);
778
779    // Use this constructor to create a ValueObject owned by another ValueObject.  It will inherit the ExecutionContext
780    // of its parent.
781
782    ValueObject (ValueObject &parent);
783
784    ValueObjectManager *
785    GetManager()
786    {
787        return m_manager;
788    }
789
790    virtual bool
791    UpdateValue () = 0;
792
793    virtual void
794    CalculateDynamicValue (lldb::DynamicValueType use_dynamic);
795
796    virtual void
797    CalculateSyntheticValue (lldb::SyntheticValueType use_synthetic);
798
799    // Should only be called by ValueObject::GetChildAtIndex()
800    // Returns a ValueObject managed by this ValueObject's manager.
801    virtual ValueObject *
802    CreateChildAtIndex (uint32_t idx, bool synthetic_array_member, int32_t synthetic_index);
803
804    // Should only be called by ValueObject::GetNumChildren()
805    virtual uint32_t
806    CalculateNumChildren() = 0;
807
808    void
809    SetName (const char *name);
810
811    void
812    SetName (const ConstString &name);
813
814    void
815    SetNumChildren (uint32_t num_children);
816
817    void
818    SetValueDidChange (bool value_changed);
819
820    void
821    SetValueIsValid (bool valid);
822
823    void
824    ClearUserVisibleData();
825
826public:
827    lldb::addr_t
828    GetPointerValue (AddressType &address_type,
829                     bool scalar_is_load_address);
830
831    lldb::addr_t
832    GetAddressOf (AddressType &address_type,
833                  bool scalar_is_load_address);
834private:
835    //------------------------------------------------------------------
836    // For ValueObject only
837    //------------------------------------------------------------------
838
839    lldb::ValueObjectSP
840    GetValueForExpressionPath_Impl(const char* expression_cstr,
841                                   const char** first_unparsed,
842                                   ExpressionPathScanEndReason* reason_to_stop,
843                                   ExpressionPathEndResultType* final_value_type,
844                                   const GetValueForExpressionPathOptions& options,
845                                   ExpressionPathAftermath* final_task_on_target);
846
847    // this method will ONLY expand [] expressions into a VOList and return
848    // the number of elements it added to the VOList
849    // it will NOT loop through expanding the follow-up of the expression_cstr
850    // for all objects in the list
851    int
852    ExpandArraySliceExpression(const char* expression_cstr,
853                               const char** first_unparsed,
854                               lldb::ValueObjectSP root,
855                               lldb::ValueObjectListSP& list,
856                               ExpressionPathScanEndReason* reason_to_stop,
857                               ExpressionPathEndResultType* final_value_type,
858                               const GetValueForExpressionPathOptions& options,
859                               ExpressionPathAftermath* final_task_on_target);
860
861
862    DISALLOW_COPY_AND_ASSIGN (ValueObject);
863
864};
865
866} // namespace lldb_private
867
868#endif  // liblldb_ValueObject_h_
869