2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2010-11-18 13:51:15 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
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
|
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-11-18 13:51:15 +01: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 17:14:20 +01:00
|
|
|
**
|
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);
|
|
|
|
|
BreakpointResponseId cdbIdToBreakpointResponseId(const GdbMi &id);
|
|
|
|
|
|
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);
|
|
|
|
|
|
2015-08-13 08:52:27 +02:00
|
|
|
DisassemblerLines parseCdbDisassembler(const QByteArray &a);
|
2011-04-13 13:52:03 +02:00
|
|
|
|
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
|