可以在ISR中使用断点吗? [英] Can breakpoints be used in in ISRs?

查看:193
本文介绍了可以在ISR中使用断点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在中断服务程序(ISR)中使用断点?

解决方案

是 - strong>。



否则,否。在任何情况下都难以脱身,是一个坏主意。 ISR(通常)应该与硬件一起工作,而当您在每个指令之间留下半秒的时间时,硬件可能会有很大差异。



设置一些ISR也不幸地从其他进程窃取CPU,所以许多操作系统建议保持您的ISR非常短暂,只做什么是 >严格必需(例如处理任何紧急硬件的东西,并安排将正确处理该事件的任务)。所以在理论上,ISR应该这么简单,不需要被调试。



如果是硬件行为的问题,使用某种日志记录,我建议如果硬件并没有真正考虑到指令之间的长时间间隔,那么您可以在用户空间中写入大部分驱动程序,而您可以使用调试器!


Can breakpoints be used in interrupt service routines (ISRs)?

解决方案

Yes - in an emulator.

Otherwise, no. It's difficult to pull off, and a bad idea in any case. ISRs are (usually) supposed to work with the hardware, and hardware can easily behave very differently when you leave a gap of half a second between each instruction.

Set up some sort of logging system instead.

ISRs also ungracefully "steal" the CPU from other processes, so many operating systems recommend keeping your ISRs extremely short and doing only what is strictly necessary (such as dealing with any urgent hardware stuff, and scheduling a task that will deal with the event properly). So in theory, ISRs should be so simple that they don't need to be debugged.

If it's hardware behaviour that's the problem, use some sort of logging instead, as I've suggested. If the hardware doesn't really mind long gaps of time between instructions, then you could just write most of the driver in user space - and you can use a debugger on that!

这篇关于可以在ISR中使用断点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆