summaryrefslogtreecommitdiffstats
path: root/lldb/tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
blob: ae0f550053fdb52706bf2401064e94f3d198fb13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
//===-- MICmnLLDBUtilSBValue.cpp --------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// Third party headers:
#include <cinttypes>

// In-house headers:
#include "MICmnLLDBUtilSBValue.h"
#include "MICmnLLDBDebugSessionInfo.h"
#include "MICmnMIValueConst.h"
#include "MICmnMIValueTuple.h"
#include "MIUtilString.h"

//++ ------------------------------------------------------------------------------------
// Details: CMICmnLLDBUtilSBValue constructor.
// Type:    Method.
// Args:    vrValue             - (R) The LLDB value object.
//          vbHandleCharType    - (R) True = Yes return text molding to char type,
//                                    False = just return data.
// Return:  None.
// Throws:  None.
//--
CMICmnLLDBUtilSBValue::CMICmnLLDBUtilSBValue(const lldb::SBValue &vrValue, const bool vbHandleCharType /* = false */,
                                             const bool vbHandleArrayType /* = true */)
    : m_rValue(const_cast<lldb::SBValue &>(vrValue))
    , m_pUnkwn("??")
    , m_pComposite("{...}")
    , m_bHandleCharType(vbHandleCharType)
    , m_bHandleArrayType(vbHandleArrayType)
{
    m_bValidSBValue = m_rValue.IsValid();
}

//++ ------------------------------------------------------------------------------------
// Details: CMICmnLLDBUtilSBValue destructor.
// Type:    Method.
// Args:    None.
// Return:  None.
// Throws:  None.
//--
CMICmnLLDBUtilSBValue::~CMICmnLLDBUtilSBValue(void)
{
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object the name of the variable. If the name
//          is invalid (or the SBValue object invalid) then "??" is returned.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - Name of the variable or "??" for unknown.
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetName(void) const
{
    const char *pName = m_bValidSBValue ? m_rValue.GetName() : nullptr;
    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);

    return text;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object the value of the variable described in
//          text. If the value is invalid (or the SBValue object invalid) then "??" is
//          returned.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - Text description of the variable's value or "??".
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetValue(const bool vbExpandAggregates /* = false */) const
{
    if (!m_bValidSBValue)
        return m_pUnkwn;

    CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
    bool bPrintExpandAggregates = false;
    bPrintExpandAggregates = rSessionInfo.SharedDataRetrieve<bool>(rSessionInfo.m_constStrPrintExpandAggregates,
                                                                   bPrintExpandAggregates) && bPrintExpandAggregates;

    const bool bHandleArrayTypeAsSimple = m_bHandleArrayType && !vbExpandAggregates && !bPrintExpandAggregates;
    CMIUtilString value;
    const bool bIsSimpleValue = GetSimpleValue(bHandleArrayTypeAsSimple, value);
    if (bIsSimpleValue)
        return value;

    if (!vbExpandAggregates && !bPrintExpandAggregates)
        return m_pComposite;

    bool bPrintAggregateFieldNames = false;
    bPrintAggregateFieldNames = !rSessionInfo.SharedDataRetrieve<bool>(rSessionInfo.m_constStrPrintAggregateFieldNames,
                                                                       bPrintAggregateFieldNames) || bPrintAggregateFieldNames;

    CMICmnMIValueTuple miValueTuple;
    const bool bOk = GetCompositeValue(bPrintAggregateFieldNames, miValueTuple);
    if (!bOk)
        return m_pUnkwn;

    value = miValueTuple.GetString();
    return value;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object the value of the variable described in
//          text if it has a simple format (not composite).
// Type:    Method.
// Args:    vwrValue          - (W) The SBValue in a string format.
// Return:  MIstatus::success - Function succeeded.
//          MIstatus::failure - Function failed.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::GetSimpleValue(const bool vbHandleArrayType, CMIUtilString &vwrValue) const
{
    const MIuint nChildren = m_rValue.GetNumChildren();
    if (nChildren == 0)
    {
        if (m_bHandleCharType && IsCharType())
        {
            vwrValue = GetSimpleValueChar();
            return MIstatus::success;
        }
        else
        {
            const char *pValue = m_rValue.GetValue();
            vwrValue = pValue != nullptr ? pValue : m_pUnkwn;
            return MIstatus::success;
        }
    }
    else if (IsPointerType())
    {
        if (m_bHandleCharType && IsPointeeCharType())
        {
            vwrValue = GetSimpleValueCStringPointer();
            return MIstatus::success;
        }
        else
        {
            const char *pValue = m_rValue.GetValue();
            vwrValue = pValue != nullptr ? pValue : m_pUnkwn;
            return MIstatus::success;
        }
    }
    else if (IsArrayType())
    {
        CMICmnLLDBDebugSessionInfo &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
        bool bPrintCharArrayAsString = false;
        bPrintCharArrayAsString = rSessionInfo.SharedDataRetrieve<bool>(rSessionInfo.m_constStrPrintCharArrayAsString,
                                                                        bPrintCharArrayAsString) && bPrintCharArrayAsString;
        if (bPrintCharArrayAsString && m_bHandleCharType && IsFirstChildCharType())
        {
            vwrValue = GetSimpleValueCStringArray();
            return MIstatus::success;
        }
        else if (vbHandleArrayType)
        {
            vwrValue = CMIUtilString::Format("[%u]", nChildren);
            return MIstatus::success;
        }
    }

    // Composite variable type i.e. struct
    return MIstatus::failure;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object the char value of the variable.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - The char value of the variable.
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetSimpleValueChar(void) const
{
    const uint64_t value = m_rValue.GetValueAsUnsigned();
    if (value == 0)
    {
        const uint64_t nFailValue = 1;
        if (nFailValue == m_rValue.GetValueAsUnsigned(nFailValue))
            return m_pUnkwn;
    }

    const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
    switch (eType)
    {
        default:
            assert(0 && "value must be a char type");
        case lldb::eBasicTypeChar:
        case lldb::eBasicTypeSignedChar:
        case lldb::eBasicTypeUnsignedChar:
        {
            const CMIUtilString prefix(CMIUtilString::ConvertToPrintableASCII((char)value));
            return CMIUtilString::Format("%" PRIu8 " '%s'", (uint8_t)value, prefix.c_str());
        }
        case lldb::eBasicTypeChar16:
        {
            const CMIUtilString prefix(CMIUtilString::ConvertToPrintableASCII((char16_t)value));
            return CMIUtilString::Format("U+%04" PRIx16 " u'%s'", (uint16_t)value, prefix.c_str());
        }
        case lldb::eBasicTypeChar32:
        {
            const CMIUtilString prefix(CMIUtilString::ConvertToPrintableASCII((char32_t)value));
            return CMIUtilString::Format("U+%08" PRIx32 " U'%s'", (uint32_t)value, prefix.c_str());
        }
    }
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object of type char* the c-string value.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - The c-string value of the variable.
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetSimpleValueCStringPointer(void) const
{
    const char *value = m_rValue.GetValue();
    if (value == nullptr)
        return m_pUnkwn;

    lldb::SBValue child = m_rValue.GetChildAtIndex(0);
    const lldb::BasicType eType = child.GetType().GetBasicType();
    switch (eType)
    {
        default:
            assert(0 && "child must be a char type");
        case lldb::eBasicTypeChar:
        case lldb::eBasicTypeSignedChar:
        case lldb::eBasicTypeUnsignedChar:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char>(child));
            // Note code that has const in will not show the text suffix to the string pointer
            // i.e. const char * pMyStr = "blah"; ==> "0x00007000"" <-- Eclipse shows this
            // but        char * pMyStr = "blah"; ==> "0x00007000" "blah"" <-- Eclipse shows this
            return CMIUtilString::Format("%s \"%s\"", value, prefix.c_str());
        }
        case lldb::eBasicTypeChar16:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char16_t>(child));
            return CMIUtilString::Format("%s u\"%s\"", value, prefix.c_str());
        }
        case lldb::eBasicTypeChar32:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char32_t>(child));
            return CMIUtilString::Format("%s U\"%s\"", value, prefix.c_str());
        }
    }
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve from the LLDB SB Value object of type char[] the c-string value.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - The c-string value of the variable.
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetSimpleValueCStringArray(void) const
{
    const MIuint nChildren = m_rValue.GetNumChildren();
    lldb::SBValue child = m_rValue.GetChildAtIndex(0);
    const lldb::BasicType eType = child.GetType().GetBasicType();
    switch (eType)
    {
        default:
            assert(0 && "value must be a char[] type");
        case lldb::eBasicTypeChar:
        case lldb::eBasicTypeSignedChar:
        case lldb::eBasicTypeUnsignedChar:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char>(m_rValue, nChildren));
            // TODO: to match char* it should be the following
            //       return CMIUtilString::Format("[%u] \"%s\"", nChildren, prefix.c_str());
            return CMIUtilString::Format("\"%s\"", prefix.c_str());
        }
        case lldb::eBasicTypeChar16:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char16_t>(m_rValue, nChildren));
            return CMIUtilString::Format("u\"%s\"", prefix.c_str());
        }
        case lldb::eBasicTypeChar32:
        {
            const CMIUtilString prefix(ReadCStringFromHostMemory<char32_t>(m_rValue, nChildren));
            return CMIUtilString::Format("U\"%s\"", prefix.c_str());
        }
    }
}

bool
CMICmnLLDBUtilSBValue::GetCompositeValue(const bool vbPrintFieldNames, CMICmnMIValueTuple &vwrMiValueTuple,
                                         const MIuint vnDepth /* = 1 */) const
{
    const MIuint nMaxDepth = 10;
    const MIuint nChildren = m_rValue.GetNumChildren();
    for (MIuint i = 0; i < nChildren; ++i)
    {
        const lldb::SBValue member = m_rValue.GetChildAtIndex(i);
        const CMICmnLLDBUtilSBValue utilMember(member, m_bHandleCharType, m_bHandleArrayType);
        const bool bHandleArrayTypeAsSimple = false;
        CMIUtilString value;
        const bool bIsSimpleValue = utilMember.GetSimpleValue(bHandleArrayTypeAsSimple, value);
        if (bIsSimpleValue)
        {
            // OK. Value is simple (not composite) and was successfully got
        }
        else if (vnDepth < nMaxDepth)
        {
            // Need to get value from composite type
            CMICmnMIValueTuple miValueTuple;
            const bool bOk = utilMember.GetCompositeValue(vbPrintFieldNames, miValueTuple, vnDepth + 1);
            if (!bOk)
                // Can't obtain composite type
                value = m_pUnkwn;
            else
                // OK. Value is composite and was successfully got
                value = miValueTuple.GetString();
        }
        else
        {
            // Need to get value from composite type, but vnMaxDepth is reached
            value = m_pComposite;
        }
        const bool bNoQuotes = true;
        const CMICmnMIValueConst miValueConst(value, bNoQuotes);
        if (vbPrintFieldNames)
        {
            const bool bUseSpacing = true;
            const CMICmnMIValueResult miValueResult(utilMember.GetName(), miValueConst, bUseSpacing);
            vwrMiValueTuple.Add(miValueResult, bUseSpacing);
        }
        else
        {
            const bool bUseSpacing = false;
            vwrMiValueTuple.Add(miValueConst, bUseSpacing);
        }
    }

    return MIstatus::success;
}

//++ ------------------------------------------------------------------------------------
// Details: Check that basic type is a char type. Char type can be signed or unsigned.
// Type:    Static.
// Args:    eType   - type to check
// Return:  bool    - True = Yes is a char type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsCharBasicType(lldb::BasicType eType)
{
    switch (eType)
    {
        case lldb::eBasicTypeChar:
        case lldb::eBasicTypeSignedChar:
        case lldb::eBasicTypeUnsignedChar:
        case lldb::eBasicTypeChar16:
        case lldb::eBasicTypeChar32:
            return true;
        default:
            return false;
    }
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is a char type or some
//          other type. Char type can be signed or unsigned.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is a char type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsCharType(void) const
{
    const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
    return IsCharBasicType(eType);
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether first child value object of *this object is
//          a char type or some other type. Returns false if there are not children. Char
//          type can be signed or unsigned.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is a char type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsFirstChildCharType(void) const
{
    const MIuint nChildren = m_rValue.GetNumChildren();

    // Is it a basic type
    if (nChildren == 0)
        return false;

    const lldb::SBValue member = m_rValue.GetChildAtIndex(0);
    const CMICmnLLDBUtilSBValue utilValue(member);
    return utilValue.IsCharType();
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether pointee object of *this object is
//          a char type or some other type. Returns false if there are not children. Char
//          type can be signed or unsigned.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is a char type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsPointeeCharType(void) const
{
    const MIuint nChildren = m_rValue.GetNumChildren();

    // Is it a basic type
    if (nChildren == 0)
        return false;

    const lldb::BasicType eType = m_rValue.GetType().GetPointeeType().GetBasicType();
    return IsCharBasicType(eType);
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is a integer type or some
//          other type. Char type can be signed or unsigned and short or long/very long.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is a integer type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsIntegerType(void) const
{
    const lldb::BasicType eType = m_rValue.GetType().GetBasicType();
    return ((eType == lldb::eBasicTypeShort) || (eType == lldb::eBasicTypeUnsignedShort) ||
            (eType == lldb::eBasicTypeInt) || (eType == lldb::eBasicTypeUnsignedInt) ||
            (eType == lldb::eBasicTypeLong) || (eType == lldb::eBasicTypeUnsignedLong) ||
            (eType == lldb::eBasicTypeLongLong) || (eType == lldb::eBasicTypeUnsignedLongLong) ||
            (eType == lldb::eBasicTypeInt128) || (eType == lldb::eBasicTypeUnsignedInt128));
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is a pointer type or some
//          other type.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is a pointer type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsPointerType(void) const
{
    return m_rValue.GetType().IsPointerType();
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the flag stating whether this value object is an array type or some
//          other type.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes is an array type, false = some other type.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsArrayType(void) const
{
    return m_rValue.GetType().IsArrayType();
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the C string data of value object by read the memory where the
//          variable is held.
// Type:    Method.
// Args:    vrValue         - (R) LLDB SBValue variable object.
// Return:  CMIUtilString   - Text description of the variable's value.
// Throws:  None.
//--
template <typename charT>
CMIUtilString
CMICmnLLDBUtilSBValue::ReadCStringFromHostMemory(lldb::SBValue &vrValue, const MIuint vnMaxLen) const
{
    std::string result;
    lldb::addr_t addr = vrValue.GetLoadAddress(), end_addr = addr + vnMaxLen * sizeof(charT);
    lldb::SBProcess process = CMICmnLLDBDebugSessionInfo::Instance().GetProcess();
    lldb::SBError error;
    while (addr < end_addr)
    {
        charT ch;
        const MIuint64 nReadBytes = process.ReadMemory(addr, &ch, sizeof(ch), error);
        if (error.Fail() || nReadBytes != sizeof(ch))
            return m_pUnkwn;
        else if (ch == 0)
            break;
        result.append(CMIUtilString::ConvertToPrintableASCII(ch, true /* bEscapeQuotes */));
        addr += sizeof(ch);
    }

    return result.c_str();
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the state of the value object's name.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = yes name is indeterminate, false = name is valid.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsNameUnknown(void) const
{
    const CMIUtilString name(GetName());
    return (name == m_pUnkwn);
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the state of the value object's value data.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = yes value is indeterminate, false = value valid.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsValueUnknown(void) const
{
    const CMIUtilString value(GetValue());
    return (value == m_pUnkwn);
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the value object's type name if valid.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - The type name or "??".
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetTypeName(void) const
{
    const char *pName = m_bValidSBValue ? m_rValue.GetTypeName() : nullptr;
    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);

    return text;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the value object's display type name if valid.
// Type:    Method.
// Args:    None.
// Return:  CMIUtilString   - The type name or "??".
// Throws:  None.
//--
CMIUtilString
CMICmnLLDBUtilSBValue::GetTypeNameDisplay(void) const
{
    const char *pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
    const CMIUtilString text((pName != nullptr) ? pName : m_pUnkwn);

    return text;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve whether the value object's is valid or not.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = valid, false = not valid.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsValid(void) const
{
    return m_bValidSBValue;
}

//++ ------------------------------------------------------------------------------------
// Details: Retrieve the value object' has a name. A value object can be valid but still
//          have no name which suggest it is not a variable.
// Type:    Method.
// Args:    None.
// Return:  bool    - True = valid, false = not valid.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::HasName(void) const
{
    bool bHasAName = false;

    const char *pName = m_bValidSBValue ? m_rValue.GetDisplayTypeName() : nullptr;
    if (pName != nullptr)
    {
        bHasAName = (CMIUtilString(pName).length() > 0);
    }

    return bHasAName;
}

//++ ------------------------------------------------------------------------------------
// Details: Determine if the value object' represents a LLDB variable i.e. "$0".
// Type:    Method.
// Args:    None.
// Return:  bool    - True = Yes LLDB variable, false = no.
// Throws:  None.
//--
bool
CMICmnLLDBUtilSBValue::IsLLDBVariable(void) const
{
    return (GetName().at(0) == '$');
}
OpenPOWER on IntegriCloud