1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
34 #ifndef DEBUGGER_DBG_WINUTILS_H
35 #define DEBUGGER_DBG_WINUTILS_H
37 #include <QtCore/QList>
39 QT_FORWARD_DECLARE_CLASS(QString)
40 QT_FORWARD_DECLARE_CLASS(QTextStream)
45 struct ProcData; // debuggerdialogs, used by the process listing dialogs
47 QList<ProcData> winProcessList();
49 // Resume a suspended thread by id.
50 bool winResumeThread(unsigned long dwThreadId, QString *errorMessage);
52 // Open a process by PID and break into it.
53 bool winDebugBreakProcess(unsigned long pid, QString *errorMessage);
55 unsigned long winGetCurrentProcessId();
57 /* Helper for (case-)normalizing file names:
58 * Determine normalized case of a Windows file name (camelcase.cpp -> CamelCase.cpp)
59 * as the debugger reports lower case file names.
60 * Restriction: File needs to exist and be non-empty and will be to be opened/mapped.
61 * The result should be cached as the function can be extensive. */
63 QString winNormalizeFileName(const QString &f);
65 bool isWinProcessBeingDebugged(unsigned long pid);
67 // Special exception codes.
70 winExceptionCppException = 0xe06d7363,
71 winExceptionStartupCompleteTrap = 0x406d1388,
72 winExceptionRpcServerUnavailable = 0x6ba,
73 winExceptionRpcServerInvalid = 0x6a6,
74 winExceptionDllNotFound = 0xc0000135,
75 winExceptionDllEntryPointNoFound = 0xc0000139,
76 winExceptionDllInitFailed = 0xc0000142,
77 winExceptionMissingSystemFile = 0xc0000143,
78 winExceptionAppInitFailed = 0xc0000143,
79 winExceptionWX86Breakpoint = 0x4000001f,
80 winExceptionCtrlPressed = 0x40010005
83 // Format windows Exception
84 void formatWindowsException(unsigned long code, quint64 address,
85 unsigned long flags, quint64 info1, quint64 info2,
87 // Check for access violation, etc.
88 bool isFatalWinException(long code);
90 // Check for EXCEPTION_BREAKPOINT, EXCEPTION_SINGLE_STEP
91 bool isDebuggerWinException(long code);
93 } // namespace Internal
94 } // namespace Debugger
96 #endif // DEBUGGER_DBG_WINUTILS_H