由于 "Unknown signal",使用 dgb 在 QT Creator 中调试时出错
Error with debugging in QT creator with dgb because of "Unknown signal"
我正在尝试调试这段代码:
#include <stdio.h>
int main()
{
int firstNumber, secondNumber, sumOfTwoNumbers;
printf("Enter two integers: ");
// Two integers entered by user is stored using scanf() function
scanf("%d %d", &firstNumber, &secondNumber);
// sum of two numbers in stored in variable sumOfTwoNumbers
sumOfTwoNumbers = firstNumber + secondNumber;
// Displays sum
printf("%d + %d = %d", firstNumber, secondNumber, sumOfTwoNumbers);
return 0;
}
这里是调试器日志(如here所述):
1show version
2show debug-file-directory
3set print object on
4set breakpoint pending on
5set print elements 10000
6set unwindonsignal on
7set width 0
8set height 0
9set substitute-path C:/work/build/qt5_workdir/w/s C:/msys64/mingw32/qt5-static
10set substitute-path Q:/qt5_workdir/w/s C:/msys64/mingw32/qt5-static
11set substitute-path c:/Users/qt/work/install C:/msys64/mingw32/qt5-static
12set substitute-path c:/users/qt/work/qt C:/msys64/mingw32/qt5-static
13python sys.path.insert(1, 'C:/msys64/mingw64/share/qtcreator/debugger/')
14python sys.path.append('C:/msys64/mingw64/bin/data-directory/python')
15python from gdbbridge import *
16python theDumper.loadDumpers({"token":16})
17-interpreter-exec console "set target-async off"
18-break-insert -f "\"main.c\":12"
19attach 7444
20-exec-continue
21importPlainDumpers off
22-thread-info
23python theDumper.fetchStack({"limit":20,"nativemixed":0,"token":23})
24set disassembly-flavor att
25-interpreter-exec console "disassemble /rm 0x8ddf8"
26-stack-select-frame 0
27python theDumper.fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["watch","return","inspect","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":1,"resultvarname":"","stringcutoff":"10000","token":27,"typeformats":{},"watchers":[]})
28-interpreter-exec console "disassemble /rm 0x8dde4,0x8de5c"
<Rebuild Watchmodel 1 @ 12:59:48.782 >
和
(超过最大字符数限制,这就是我在 pastebin 发帖的原因)
当我尝试调试代码并且存在断点时,我得到一个 window:
The inferior stopped because it received a signal from the operating system.
Signal name: ?
Signal meaning: Unknown signal
截图:
此外,我遇到问题:
:-1: error: An exception was triggered:
Exception at 0x4015f6, code: 0x4000001f: Win32 x86 emulation subsystem breakpoint hit, flags=0x0.
截图:
还有一些截图:
构建和 运行 代码没有给我任何错误。我已阅读 this 但我没有除 Windows Defender 以外的防病毒软件,我禁用了它的实时保护。我用 Windows 8.1
我还使用 msys2 的 QT、mingw 和 gdb。
问题:问题是什么,如何解决?
我使用的是 qtcreator 64 位,但项目选择了套件 mingw-w64 32 位。我认为位数的差异导致了错误。
现在,当我将 qtcreator 64 位与套件 mingw-w64 64 位一起使用时,调试器工作正常
我得到了 Reddit user jedwardsol 的帮助:
4000001f is coming from the x86 emulation layer of 64-bit Windows. Perhaps your debugger doesn't understand it.
Try building a 64-bit program instead.
我正在尝试调试这段代码:
#include <stdio.h>
int main()
{
int firstNumber, secondNumber, sumOfTwoNumbers;
printf("Enter two integers: ");
// Two integers entered by user is stored using scanf() function
scanf("%d %d", &firstNumber, &secondNumber);
// sum of two numbers in stored in variable sumOfTwoNumbers
sumOfTwoNumbers = firstNumber + secondNumber;
// Displays sum
printf("%d + %d = %d", firstNumber, secondNumber, sumOfTwoNumbers);
return 0;
}
这里是调试器日志(如here所述):
1show version
2show debug-file-directory
3set print object on
4set breakpoint pending on
5set print elements 10000
6set unwindonsignal on
7set width 0
8set height 0
9set substitute-path C:/work/build/qt5_workdir/w/s C:/msys64/mingw32/qt5-static
10set substitute-path Q:/qt5_workdir/w/s C:/msys64/mingw32/qt5-static
11set substitute-path c:/Users/qt/work/install C:/msys64/mingw32/qt5-static
12set substitute-path c:/users/qt/work/qt C:/msys64/mingw32/qt5-static
13python sys.path.insert(1, 'C:/msys64/mingw64/share/qtcreator/debugger/')
14python sys.path.append('C:/msys64/mingw64/bin/data-directory/python')
15python from gdbbridge import *
16python theDumper.loadDumpers({"token":16})
17-interpreter-exec console "set target-async off"
18-break-insert -f "\"main.c\":12"
19attach 7444
20-exec-continue
21importPlainDumpers off
22-thread-info
23python theDumper.fetchStack({"limit":20,"nativemixed":0,"token":23})
24set disassembly-flavor att
25-interpreter-exec console "disassemble /rm 0x8ddf8"
26-stack-select-frame 0
27python theDumper.fetchVariables({"autoderef":1,"context":"","displaystringlimit":"100","dyntype":1,"expanded":["watch","return","inspect","local"],"fancy":1,"formats":{},"nativemixed":0,"partialvar":"","passexceptions":0,"qobjectnames":1,"resultvarname":"","stringcutoff":"10000","token":27,"typeformats":{},"watchers":[]})
28-interpreter-exec console "disassemble /rm 0x8dde4,0x8de5c"
<Rebuild Watchmodel 1 @ 12:59:48.782 >
和
(超过最大字符数限制,这就是我在 pastebin 发帖的原因)
当我尝试调试代码并且存在断点时,我得到一个 window:
The inferior stopped because it received a signal from the operating system.
Signal name: ?
Signal meaning: Unknown signal
截图:
此外,我遇到问题:
:-1: error: An exception was triggered:
Exception at 0x4015f6, code: 0x4000001f: Win32 x86 emulation subsystem breakpoint hit, flags=0x0.
截图:
还有一些截图:
构建和 运行 代码没有给我任何错误。我已阅读 this 但我没有除 Windows Defender 以外的防病毒软件,我禁用了它的实时保护。我用 Windows 8.1
我还使用 msys2 的 QT、mingw 和 gdb。
问题:问题是什么,如何解决?
我使用的是 qtcreator 64 位,但项目选择了套件 mingw-w64 32 位。我认为位数的差异导致了错误。
现在,当我将 qtcreator 64 位与套件 mingw-w64 64 位一起使用时,调试器工作正常
我得到了 Reddit user jedwardsol 的帮助:
4000001f is coming from the x86 emulation layer of 64-bit Windows. Perhaps your debugger doesn't understand it.
Try building a 64-bit program instead.