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

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

问题描述

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

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

推荐答案

是-在模拟器中.

否则,不可以.很难实现,无论如何都是一个坏主意.通常,ISR应该与硬件一起使用,并且每条指令之间只有半秒的间隔,硬件的行为很容易就大不相同.

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.

ISR还会恶意地从其他进程中窃取" CPU,因此许多操作系统建议您将ISR保持极短的状态,并仅执行严格的必要操作(例如处理任何紧急硬件内容,并安排可以正确处理该事件的任务).因此,从理论上讲,ISR应该是如此简单,以至于不需要对其进行调试.

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天全站免登陆