2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-04-26 18:54:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2010-04-26 18:54:08 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-04-26 18:54:08 +02:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2010-04-26 18:54:08 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2010-12-17 16:01:08 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2015-03-25 11:51:14 +01:00
|
|
|
#include "debuggerprotocol.h"
|
|
|
|
|
|
2015-12-16 17:17:38 +01:00
|
|
|
#include <utils/treemodel.h>
|
|
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QCoreApplication>
|
2013-03-21 17:10:19 +01:00
|
|
|
#include <QMetaType>
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2015-04-01 17:19:43 +02:00
|
|
|
#include <vector>
|
2015-01-28 10:20:01 +01:00
|
|
|
|
2010-04-26 18:54:08 +02:00
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
2013-02-01 13:05:28 +01:00
|
|
|
class GdbMi;
|
|
|
|
|
|
2018-03-08 15:13:42 +01:00
|
|
|
class WatchItem : public Utils::TypedTreeItem<WatchItem, WatchItem>
|
2010-04-26 18:54:08 +02:00
|
|
|
{
|
|
|
|
|
public:
|
2015-12-16 17:17:38 +01:00
|
|
|
WatchItem();
|
|
|
|
|
|
2016-04-05 11:14:40 +02:00
|
|
|
void parse(const GdbMi &input, bool maySort);
|
2015-12-16 17:17:38 +01:00
|
|
|
|
|
|
|
|
bool isLocal() const;
|
|
|
|
|
bool isWatcher() const;
|
|
|
|
|
bool isInspect() const;
|
|
|
|
|
|
|
|
|
|
QString expression() const;
|
|
|
|
|
QString realName() const;
|
2016-06-07 17:04:53 +02:00
|
|
|
QString internalName() const;
|
2015-12-16 17:17:38 +01:00
|
|
|
QString toToolTip() const;
|
|
|
|
|
|
|
|
|
|
QVariant editValue() const;
|
|
|
|
|
int editType() const;
|
|
|
|
|
|
2015-12-01 10:58:01 +01:00
|
|
|
static const qint64 InvalidId = -1;
|
|
|
|
|
|
2016-08-03 13:13:06 +02:00
|
|
|
void setHasChildren(bool c) { wantsChildren = c; }
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2010-10-15 13:00:14 +02:00
|
|
|
bool isValid() const { return !iname.isEmpty(); }
|
2011-11-11 17:51:29 +01:00
|
|
|
bool isVTablePointer() const;
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2010-10-15 13:00:14 +02:00
|
|
|
void setError(const QString &);
|
|
|
|
|
void setValue(const QString &);
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QString toString() const;
|
2010-04-26 18:54:08 +02:00
|
|
|
|
|
|
|
|
static QString msgNotInScope();
|
|
|
|
|
static QString shadowedName(const QString &name, int seen);
|
|
|
|
|
static const QString &shadowedNameFormat();
|
|
|
|
|
|
2016-06-07 17:04:53 +02:00
|
|
|
QString hexAddress() const;
|
|
|
|
|
QString key() const { return address ? hexAddress() : iname; }
|
2010-10-15 13:00:14 +02:00
|
|
|
|
2010-04-26 18:54:08 +02:00
|
|
|
public:
|
2015-12-01 10:58:01 +01:00
|
|
|
qint64 id; // Token for the engine for internal mapping
|
2016-06-07 17:04:53 +02:00
|
|
|
QString iname; // Internal name sth like 'local.baz.public.a'
|
|
|
|
|
QString exp; // The expression
|
2015-03-25 11:51:14 +01:00
|
|
|
QString name; // Displayed name
|
|
|
|
|
QString value; // Displayed value
|
2016-06-07 17:04:53 +02:00
|
|
|
QString editvalue; // Displayed value
|
|
|
|
|
QString editformat; // Format of displayed value
|
2015-04-01 17:19:43 +02:00
|
|
|
DebuggerEncoding editencoding; // Encoding of displayed value
|
2016-06-07 17:04:53 +02:00
|
|
|
QString type; // Type for further processing
|
2015-03-25 11:51:14 +01:00
|
|
|
quint64 address; // Displayed address of the actual object
|
|
|
|
|
quint64 origaddr; // Address of the pointer referencing this item (gdb auto-deref)
|
|
|
|
|
uint size; // Size
|
|
|
|
|
uint bitpos; // Position within bit fields
|
|
|
|
|
uint bitsize; // Size in case of bit fields
|
|
|
|
|
int elided; // Full size if value was cut off, -1 if cut on unknown size, 0 otherwise
|
2015-12-16 17:17:38 +01:00
|
|
|
int arrayIndex; // -1 if not an array member
|
2016-04-05 11:14:40 +02:00
|
|
|
uchar sortGroup; // 0 - ordinary member, 1 - vptr, 2 - base class
|
2015-03-25 11:51:14 +01:00
|
|
|
bool wantsChildren;
|
|
|
|
|
bool valueEnabled; // Value will be enabled or not
|
|
|
|
|
bool valueEditable; // Value will be editable
|
2015-07-06 09:46:08 +02:00
|
|
|
bool outdated; // \internal item is to be removed.
|
2010-04-26 18:54:08 +02:00
|
|
|
|
2015-12-16 17:17:38 +01:00
|
|
|
private:
|
2016-04-05 11:14:40 +02:00
|
|
|
void parseHelper(const GdbMi &input, bool maySort);
|
2010-10-15 13:00:14 +02:00
|
|
|
Q_DECLARE_TR_FUNCTIONS(Debugger::Internal::WatchHandler)
|
2010-04-26 18:54:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Debugger
|