1
/***************************************************************************
2
begin : Tue Aug 17 1999
3
copyright : (C) 1999 by John Birch
4
email : jbb@kdevelop.org
5
***************************************************************************/
7
/***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
19
#include "variablewidget.h"
27
/** Strips gdb decorations from value of a single variable
28
and sets text of 'item' appropriately.
29
For values of composite types also calls item->setCache.
30
Does not recurse into composite types and does not creates
31
child items of 'item' (that will be done in item->setOpen,
32
when that's method is called.
34
"Decorations" are {} around arrays and structures and value
35
type that is printed before value itself in some cases.
37
void parseValue(TrimmableItem *item, const char *buf);
39
/** Parses gdb-provided value 'buf' of a composite type
40
(struct/array), and assigns proper values to children
41
of 'parent'. As a special hack, the output from
42
"info locals" and "info args" can be passed to this
43
method, as the output looks like just value of some
44
imaginary 'struct local_variables'.
45
The value should contain all the decorations from gdb
46
(opening braces of arrays, and so on).
48
void parseCompositeValue(TrimmableItem* parent, const char* buf);
50
DataType determineType(const char *buf) const;
52
const char *skipString(const char *buf) const;
53
const char *skipQuotes(const char *buf, char quote) const;
54
const char *skipDelim(const char *buf, char open, char close) const;
56
static GDBParser *getGDBParser();
57
static void destroy();
60
TrimmableItem *getItem(TrimmableItem *parent, DataType itemType,
61
const QString &varName, bool requested);
63
void parseArray(TrimmableItem *parent, const char *buf);
65
const char *skipTokenEnd(const char *buf) const;
66
const char *skipTokenValue(const char *buf) const;
67
const char *skipNextTokenStart(const char *buf) const;
69
QString getName(const char **buf);
70
/** Assuming 'buf' points to a value, return a pointer
71
to the position right after the value.
73
QCString getValue(const char **buf);
74
QCString undecorateValue(DataType type, const QCString& s);
75
void setItem(TrimmableItem *parent, const QString &varName, DataType dataType,
76
const QCString &value, bool requested);
81
static GDBParser *GDBParser_;