是否可以用软件中断 GDB 中的 Native Client 应用程序并继续执行?

发布于 01-01 06:37 字数 847 浏览 5 评论 0原文

是否有人有使用 Windows Native Client 调试器的经验,如此处 调试 Native Client 应用程序?

我正在尝试在应用程序代码中触发软件断点或异常,这将在触发它的源行处停止附加的和正在运行的 GDB,并能够继续执行。

我可以通过创建非法地址异常来做到这一点,例如:

#define SOFTBREAK { int *p=0; p=0; }

它确实会在使用定义的地方中断到调试器:

Program received signal SIGSEGV, Segmentation fault.
0x0000000c00209ba2 in CTestTestList::Init (this=0xfe55d080) at ../testlist.cpp:1242
1242    in ../testlist.cpp

但是我似乎无法使用 jump 命令跳过中断来继续执行行,(使用下一个源代码行或汇编地址)。在继续之前我需要确认或清除分段错误吗?

有谁知道是否可以使用非法地址异常继续执行?或者是否可以使用不同的方法,例如引发软件异常(EXC_SOFTWARE)? 任何帮助或建议将不胜感激。

(顺便说一句,这是我第一篇关于堆栈溢出的文章,所以如果我没有遵循这篇文章的任何礼仪,我深表歉意。)

非常感谢,

安迪

Does anyone have any experience of using the Windows Native Client debugger as described here to debug a Native Client application?

I'm trying to fire a software breakpoint or exception in the application code which would halt the attached and running GDB at the source line it was fired from and be able to continue execution.

I can do this by creating an illegal address exception, eg:

#define SOFTBREAK { int *p=0; p=0; }

which does break into the debugger where ever the define is used:

Program received signal SIGSEGV, Segmentation fault.
0x0000000c00209ba2 in CTestTestList::Init (this=0xfe55d080) at ../testlist.cpp:1242
1242    in ../testlist.cpp

however i can't seem to continue execution using the jump command to skip the break line, (either using the next source line or assembly address). Do i need to acknowledge or clear the segmentation fault before continuing?

Does anyone know if its possible to continiue exectuion using the illegal address exception? Or is there a different method that could be used, for example, raising a software exception, (EXC_SOFTWARE)?
Any help or advice would be appreciated.

(Btw, this is my first post to stack overflow so apologises if i've not followed any etiquette with this post.)

Many thanks,

Andy

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲念泪2025-01-08 06:37:41

我通常使用无限循环来达到相同的目的。

volatile int var = 1;
while (var);

然后我在调试器中更改相应的寄存器值。

set $rax = 0

I usually use an infinite loop for the same purpose.

volatile int var = 1;
while (var);

Then I change corresponding register value in debugger.

set $rax = 0
江挽川2025-01-08 06:37:41

您可以将 __asm__("int3"); 与 winGDB 一起使用,详细信息这里

~Main

You can use __asm__("int3"); with winGDB, as detailed here

~Main

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文