OSDN Git Service

ce22035d98e4e905de9ac59a8078fc39e45f3909
[qt-creator-jp/qt-creator-jp.git] / src / plugins / debugger / shared / dbgwinutils.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** No Commercial Usage
10 **
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
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 **
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.
24 **
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.
28 **
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
31 **
32 **************************************************************************/
33
34 #ifndef DEBUGGER_DBG_WINUTILS_H
35 #define DEBUGGER_DBG_WINUTILS_H
36
37 #include <QtCore/QList>
38
39 QT_FORWARD_DECLARE_CLASS(QString)
40 QT_FORWARD_DECLARE_CLASS(QTextStream)
41
42 namespace Debugger {
43 namespace Internal {
44
45 struct ProcData; // debuggerdialogs, used by the process listing dialogs
46
47 QList<ProcData> winProcessList();
48
49 // Resume a suspended thread by id.
50 bool winResumeThread(unsigned long dwThreadId, QString *errorMessage);
51
52 // Open a process by PID and break into it.
53 bool winDebugBreakProcess(unsigned long  pid, QString *errorMessage);
54
55 unsigned long winGetCurrentProcessId();
56
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. */
62
63 QString winNormalizeFileName(const QString &f);
64
65 bool isWinProcessBeingDebugged(unsigned long pid);
66
67 // Special exception codes.
68 enum
69 {
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
81 };
82
83 // Format windows Exception
84 void formatWindowsException(unsigned long code, quint64 address,
85                             unsigned long flags, quint64 info1, quint64 info2,
86                             QTextStream &str);
87 // Check for access violation, etc.
88 bool isFatalWinException(long code);
89
90 // Check for EXCEPTION_BREAKPOINT, EXCEPTION_SINGLE_STEP
91 bool isDebuggerWinException(long code);
92
93 } // namespace Internal
94 } // namespace Debugger
95
96 #endif // DEBUGGER_DBG_WINUTILS_H