|
1 | 1 |
|
| 2 | +import mRegistry, mWindowsAPI; |
2 | 3 | from mNotProvided import fbIsProvided;
|
3 | 4 |
|
4 | 5 | from foConsoleLoader import foConsoleLoader;
|
5 | 6 | from fsCreateBugIdCommandLine import fsCreateBugIdCommandLine;
|
6 | 7 | from fxGetCurrentJITDebuggerCommandLine import fxGetCurrentJITDebuggerCommandLine;
|
7 | 8 | from mColorsAndChars import *;
|
| 9 | +import mJITDebuggerRegistry; |
8 | 10 | oConsole = foConsoleLoader();
|
9 | 11 |
|
10 | 12 | def fOutputCurrentJITDebuggerSettings():
|
| 13 | + sOSISA = mWindowsAPI.oSystemInfo.sOSISA; |
| 14 | + dsCommandLineKeyPath_by_sTargetBinaryISA = mJITDebuggerRegistry.ddsCommandLineKeyPath_by_sTargetBinaryISA_by_sOSISA[sOSISA]; |
11 | 15 | oConsole.fLock();
|
12 | 16 | try:
|
13 |
| - oConsole.fOutput("┌───[", COLOR_INFO, " Current JIT Debugger ", COLOR_NORMAL, "]", sPadding = "─"); |
14 |
| - xCurrentJITDebuggerCommandLine = fxGetCurrentJITDebuggerCommandLine(); |
15 |
| - if not fbIsProvided(xCurrentJITDebuggerCommandLine): |
16 |
| - oConsole.fOutput( |
17 |
| - "│ ", |
18 |
| - COLOR_INFO, CHAR_INFO, |
19 |
| - COLOR_NORMAL, "JIT debugger: ", |
20 |
| - COLOR_INFO, "None", |
21 |
| - COLOR_NORMAL, ".", |
| 17 | + oConsole.fOutput( |
| 18 | + "┌───[ ", |
| 19 | + COLOR_INFO, "Current JIT Debugger", "s" if len(dsCommandLineKeyPath_by_sTargetBinaryISA) > 1 else "", |
| 20 | + COLOR_NORMAL, " ]", |
| 21 | + sPadding = "─" |
| 22 | + ); |
| 23 | + dsCommandLineKeyPath_by_sTargetBinaryISA = mJITDebuggerRegistry.ddsCommandLineKeyPath_by_sTargetBinaryISA_by_sOSISA[sOSISA]; |
| 24 | + for (sTargetBinaryISA, sCommandLineKeyPath) in dsCommandLineKeyPath_by_sTargetBinaryISA.items(): |
| 25 | + # Get the current JIT debugger command line for the target binary ISA if one is installed. |
| 26 | + oRegistryHiveKey = mRegistry.cRegistryHiveKey( |
| 27 | + sHiveName = mJITDebuggerRegistry.sCommandLineHiveName, |
| 28 | + sKeyPath = sCommandLineKeyPath, |
22 | 29 | );
|
23 |
| - elif xCurrentJITDebuggerCommandLine is None: |
24 |
| - oConsole.fOutput( |
25 |
| - "│ ", |
26 |
| - COLOR_ERROR, CHAR_ERROR, |
27 |
| - COLOR_NORMAL, " JIT debugger: ", |
28 |
| - COLOR_INFO, "Unknown", |
29 |
| - COLOR_NORMAL, " (unable to read registry).", |
30 |
| - ); |
31 |
| - else: |
32 |
| - sBugIdJITDebuggerCommandLineStartsWith = fsCreateBugIdCommandLine(); |
33 |
| - if xCurrentJITDebuggerCommandLine.startswith(sBugIdJITDebuggerCommandLineStartsWith): |
| 30 | + o0RegistryValue = oRegistryHiveKey.fo0GetValueForName(sValueName = "Debugger"); |
| 31 | + if o0RegistryValue is None: |
34 | 32 | oConsole.fOutput(
|
35 | 33 | "│ ",
|
36 |
| - COLOR_OK, CHAR_OK, |
| 34 | + COLOR_WARNING, CHAR_WARNING, |
| 35 | + COLOR_NORMAL, " ", |
| 36 | + COLOR_INFO, sTargetBinaryISA, |
37 | 37 | COLOR_NORMAL, " JIT debugger: ",
|
38 |
| - COLOR_INFO, "BugId", |
| 38 | + COLOR_INFO, "None", |
39 | 39 | COLOR_NORMAL, ".",
|
40 | 40 | );
|
41 |
| - sArguments = xCurrentJITDebuggerCommandLine[len(sBugIdJITDebuggerCommandLineStartsWith) + 1:]; |
42 |
| - oConsole.fOutput( |
43 |
| - "│ Arguments: ", |
44 |
| - COLOR_INFO, sArguments, |
45 |
| - ); |
46 |
| - else: |
| 41 | + elif o0RegistryValue.sTypeName != "REG_SZ": |
47 | 42 | oConsole.fOutput(
|
48 | 43 | "│ ",
|
49 |
| - COLOR_WARNING, CHAR_WARNING, |
| 44 | + COLOR_ERROR, CHAR_ERROR, |
| 45 | + COLOR_NORMAL, " ", |
| 46 | + COLOR_INFO, sTargetBinaryISA, |
50 | 47 | COLOR_NORMAL, " JIT debugger: ",
|
51 |
| - COLOR_INFO, "Other", |
52 |
| - COLOR_NORMAL, ".", |
53 |
| - ); |
54 |
| - oConsole.fOutput( |
55 |
| - "│ Command line: ", |
56 |
| - COLOR_INFO, xCurrentJITDebuggerCommandLine, |
| 48 | + COLOR_INFO, "Unknown", |
| 49 | + COLOR_NORMAL, " (registry value not a string).", |
57 | 50 | );
|
| 51 | + else: |
| 52 | + sCurrentJITDebuggerCommandLine = o0RegistryValue.xValue; |
| 53 | + sBugIdJITDebuggerCommandLineStartsWith = fsCreateBugIdCommandLine(); |
| 54 | + if sCurrentJITDebuggerCommandLine.startswith(sBugIdJITDebuggerCommandLineStartsWith): |
| 55 | + oConsole.fOutput( |
| 56 | + "│ ", |
| 57 | + COLOR_OK, CHAR_OK, |
| 58 | + COLOR_NORMAL, " ", |
| 59 | + COLOR_INFO, sTargetBinaryISA, |
| 60 | + COLOR_NORMAL, " JIT debugger: ", |
| 61 | + COLOR_INFO, "BugId", |
| 62 | + COLOR_NORMAL, ".", |
| 63 | + ); |
| 64 | + sArguments = sCurrentJITDebuggerCommandLine[len(sBugIdJITDebuggerCommandLineStartsWith) + 1:]; |
| 65 | + oConsole.fOutput( |
| 66 | + "│ Arguments: ", |
| 67 | + COLOR_INFO, sArguments, |
| 68 | + ); |
| 69 | + else: |
| 70 | + oConsole.fOutput( |
| 71 | + "│ ", |
| 72 | + COLOR_INFO, CHAR_INFO, |
| 73 | + COLOR_NORMAL, " ", |
| 74 | + COLOR_INFO, sTargetBinaryISA, |
| 75 | + COLOR_NORMAL, " JIT debugger: ", |
| 76 | + COLOR_INFO, "Other", |
| 77 | + COLOR_NORMAL, ".", |
| 78 | + ); |
| 79 | + oConsole.fOutput( |
| 80 | + "│ Command line: ", |
| 81 | + COLOR_INFO, sCurrentJITDebuggerCommandLine, |
| 82 | + ); |
58 | 83 | oConsole.fOutput("└", sPadding = "─");
|
59 | 84 | finally:
|
60 | 85 | oConsole.fUnlock();
|
0 commit comments