2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2010-11-18 13:51:15 +01: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
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
2014-10-01 13:21:18 +02:00
|
|
|
** conditions see http://www.qt.io/licensing. For further information
|
|
|
|
|
** use the contact form at http://www.qt.io/contact-us.
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
2014-10-01 13:21:18 +02:00
|
|
|
** General Public License version 2.1 or version 3 as published by the Free
|
|
|
|
|
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
|
|
|
|
|
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
|
|
|
|
|
** following information to ensure the GNU Lesser General Public License
|
|
|
|
|
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
2012-10-02 09:12:39 +02:00
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 17:14:20 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2010-11-18 13:51:15 +01:00
|
|
|
|
|
|
|
|
#ifndef CDBPARSEHELPERS_H
|
|
|
|
|
#define CDBPARSEHELPERS_H
|
|
|
|
|
|
2013-08-29 16:36:42 +02:00
|
|
|
#include <debugger/breakpoint.h>
|
2011-02-03 16:26:23 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QPair>
|
2010-11-18 13:51:15 +01:00
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
class QVariant;
|
|
|
|
|
class QDebug;
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
namespace Debugger {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
class BreakpointData;
|
|
|
|
|
class BreakpointParameters;
|
|
|
|
|
struct ThreadData;
|
|
|
|
|
class Register;
|
|
|
|
|
class GdbMi;
|
2011-04-13 13:52:03 +02:00
|
|
|
class DisassemblerLines;
|
2010-11-18 13:51:15 +01:00
|
|
|
|
2011-03-07 09:24:44 +01:00
|
|
|
// Perform mapping on parts of the source tree as reported by/passed to debugger
|
|
|
|
|
// in case the user has specified such mappings in the global settings.
|
|
|
|
|
enum SourcePathMode { DebuggerToSource, SourceToDebugger };
|
|
|
|
|
QString cdbSourcePathMapping(QString fileName,
|
|
|
|
|
const QList<QPair<QString, QString> > &sourcePathMapping,
|
|
|
|
|
SourcePathMode mode);
|
|
|
|
|
|
2012-12-20 15:24:32 +01:00
|
|
|
// Ensure unique 'namespace' for breakpoints of the breakhandler.
|
2014-05-14 10:38:16 +02:00
|
|
|
enum { cdbBreakPointStartId = 100000,
|
|
|
|
|
cdbBreakPointIdMinorPart = 100};
|
2012-12-20 15:24:32 +01:00
|
|
|
|
|
|
|
|
int breakPointIdToCdbId(const BreakpointModelId &id);
|
|
|
|
|
BreakpointModelId cdbIdToBreakpointModelId(const GdbMi &id);
|
2014-05-14 10:38:16 +02:00
|
|
|
BreakpointModelId cdbIdToBreakpointModelId(int id);
|
2012-12-20 15:24:32 +01:00
|
|
|
BreakpointResponseId cdbIdToBreakpointResponseId(const GdbMi &id);
|
2014-05-14 10:38:16 +02:00
|
|
|
BreakpointResponseId cdbIdToBreakpointResponseId(int id);
|
2012-12-20 15:24:32 +01:00
|
|
|
|
2011-03-07 09:24:44 +01:00
|
|
|
// Convert breakpoint in CDB syntax (applying source path mappings using native paths).
|
|
|
|
|
QByteArray cdbAddBreakpointCommand(const BreakpointParameters &d,
|
|
|
|
|
const QList<QPair<QString, QString> > &sourcePathMapping,
|
2012-05-20 21:15:30 +02:00
|
|
|
BreakpointModelId id = BreakpointModelId(quint16(-1)), bool oneshot = false);
|
2014-05-14 10:38:16 +02:00
|
|
|
QByteArray cdbClearBreakpointCommand(const BreakpointModelId &id);
|
2011-02-03 16:26:23 +01:00
|
|
|
// Parse extension command listing breakpoints.
|
|
|
|
|
// Note that not all fields are returned, since file, line, function are encoded
|
|
|
|
|
// in the expression (that is in addition deleted on resolving for a bp-type breakpoint).
|
2011-06-30 11:01:10 +02:00
|
|
|
void parseBreakPoint(const GdbMi &gdbmi, BreakpointResponse *r, QString *expression = 0);
|
2010-11-18 13:51:15 +01:00
|
|
|
|
2011-02-28 14:33:35 +01:00
|
|
|
// Write memory (f ...).
|
|
|
|
|
QByteArray cdbWriteMemoryCommand(quint64 addr, const QByteArray &data);
|
2010-11-18 13:51:15 +01:00
|
|
|
|
|
|
|
|
QString debugByteArray(const QByteArray &a);
|
|
|
|
|
QString StringFromBase64EncodedUtf16(const QByteArray &a);
|
|
|
|
|
|
2011-04-13 13:52:03 +02:00
|
|
|
DisassemblerLines parseCdbDisassembler(const QList<QByteArray> &a);
|
|
|
|
|
|
2010-11-18 13:51:15 +01:00
|
|
|
// Model EXCEPTION_RECORD + firstchance
|
|
|
|
|
struct WinException
|
|
|
|
|
{
|
|
|
|
|
WinException();
|
2011-01-11 11:06:15 +01:00
|
|
|
void fromGdbMI(const GdbMi &);
|
2010-11-18 13:51:15 +01:00
|
|
|
QString toString(bool includeLocation = false) const;
|
|
|
|
|
|
|
|
|
|
unsigned exceptionCode;
|
|
|
|
|
unsigned exceptionFlags;
|
|
|
|
|
quint64 exceptionAddress;
|
|
|
|
|
quint64 info1;
|
|
|
|
|
quint64 info2;
|
|
|
|
|
bool firstChance;
|
|
|
|
|
QByteArray file;
|
|
|
|
|
int lineNumber;
|
|
|
|
|
QByteArray function;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
QDebug operator<<(QDebug s, const WinException &e);
|
|
|
|
|
|
2011-01-11 11:06:15 +01:00
|
|
|
} // namespace Internal
|
2010-11-18 13:51:15 +01:00
|
|
|
} // namespace Debugger
|
|
|
|
|
|
|
|
|
|
#endif // CDBPARSEHELPERS_H
|