for new CDB engine.
#include "corebreakpoint.h"
#include "cdbmodules.h"
#include "breakhandler.h"
+#include "shared/dbgwinutils.h"
#include <QtCore/QDebug>
#include <QtCore/QDir>
return QString::fromLatin1("Cannot set a breakpoint at '%1': %2").arg(func, why);
}
-static inline BreakpointParameters transformBreakpoint(const BreakpointParameters &p)
-{
- if (p.type == BreakpointAtThrow) {
- BreakpointParameters rc(BreakpointByFunction);
- rc.functionName = QLatin1String(cdbThrowFunction);
- return rc;
- }
- if (p.type == BreakpointAtCatch) {
- BreakpointParameters rc(BreakpointByFunction);
- rc.functionName = QLatin1String(cdbCatchFunction);
- return rc;
- }
- if (p.type == BreakpointAtMain) {
- BreakpointParameters rc(BreakpointByFunction);
- rc.functionName = QLatin1String("main");
- return rc;
- }
- return p;
-}
-
bool addCdbBreakpoint(CIDebugControl* debugControl,
CIDebugSymbols *syms,
const BreakpointParameters &bpIn,
BreakpointResponse *response,
QString *errorMessage)
{
- const BreakpointParameters bp = transformBreakpoint(bpIn);
+ const BreakpointParameters bp = fixWinMSVCBreakpoint(bpIn);
errorMessage->clear();
// Function breakpoints: Are the module names specified?
QString resolvedFunction;
#include "moduleshandler.h"
#include "cdbengine_p.h"
#include "breakpoint.h"
+#include "shared/dbgwinutils.h"
#include <QtCore/QFileInfo>
#include <QtCore/QRegExp>
return true;
}
-const char *cdbThrowFunction = "CxxThrowException";
-const char *cdbCatchFunction = "__CxxCallCatchBlock";
-
// Helper for the resolveSymbol overloads.
static ResolveSymbolResult resolveSymbol(CIDebugSymbols *syms, QString *symbol,
QStringList *matches,
// Is it an incomplete symbol?
if (symbol->contains(QLatin1Char('!')))
return ResolveSymbolOk;
- const bool withinMSVCRunTime = *symbol == QLatin1String(cdbThrowFunction)
- || *symbol == QLatin1String(cdbCatchFunction);
+ const bool withinMSVCRunTime = *symbol == QLatin1String(winMSVCThrowFunction)
+ || *symbol == QLatin1String(winMSVCCatchFunction);
if (*symbol == QLatin1String("qMain")) // 'main' is a #define for gdb, but not for VS
*symbol = QLatin1String("main");
// resolve
bool getModuleSymbols(CIDebugSymbols *syms, const QString &moduleName,
QList<Symbol> *symbols, QString *errorMessage);
-extern const char *cdbThrowFunction;
-extern const char *cdbCatchFunction;
-
} // namespace Internal
} // namespace Debugger
#include "winutils.h"
#include "dbgwinutils.h"
#include "debuggerdialogs.h"
+#include "breakpoint.h"
#include <QtCore/QDebug>
#include <QtCore/QString>
return true;
}
+// Special function names in MSVC runtime
+const char *winMSVCThrowFunction = "CxxThrowException";
+const char *winMSVCCatchFunction = "__CxxCallCatchBlock";
+
+BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
+{
+ if (p.type == BreakpointAtThrow) {
+ BreakpointParameters rc(BreakpointByFunction);
+ rc.functionName = QLatin1String(winMSVCThrowFunction);
+ return rc;
+ }
+ if (p.type == BreakpointAtCatch) {
+ BreakpointParameters rc(BreakpointByFunction);
+ rc.functionName = QLatin1String(winMSVCCatchFunction);
+ return rc;
+ }
+ if (p.type == BreakpointAtMain) {
+ BreakpointParameters rc(BreakpointByFunction);
+ rc.functionName = QLatin1String("main");
+ return rc;
+ }
+ return p;
+}
+
} // namespace Internal
} // namespace Debugger
namespace Debugger {
namespace Internal {
+class BreakpointParameters;
+
struct ProcData; // debuggerdialogs, used by the process listing dialogs
QList<ProcData> winProcessList();
// Check for EXCEPTION_BREAKPOINT, EXCEPTION_SINGLE_STEP
bool isDebuggerWinException(long code);
+// fix up breakpoints (catch/throw, etc).
+BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p);
+
+// Special function names in MSVC runtime
+extern const char *winMSVCThrowFunction;
+extern const char *winMSVCCatchFunction;
} // namespace Internal
} // namespace Debugger