flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution
I think the best place to see how the x86 debug registers are used is in the official Intel and AMD documents.
|
|||
![]() |
|
Fulgurance
I just use Intel. I have search on Intel Book, i have found section about Debug Register, but i don't understand when this register are writting by processor and how.
How i use this interrupt? It's not very clear https://software.intel.com/sites/default/files/managed/a4/60/325384-sdm-vol-3abcd.pdf Is it with stack only ? I don't understand very well |
|||
![]() |
|
revolution
You can use the MOV instruction read and write the debug registers.
Code: mov dr0,eax mov ebx,dr1 |
|||
![]() |
|
Fulgurance
Okay. And how I interpret value of this register ? And when ?
|
|||
![]() |
|
revolution
The layout of DR0..7 is quite complicated. Some registers enable various features with bit settings, and others hold linear breakpoint addresses.
Your code would write to the registers and the CPU will fault/trap when all the conditions are met. Then you catch the fault/trap with the normal exception mechanisms in your OS and show the user a breakpoint was reached. |
|||
![]() |
|
Fulgurance
No example ?
![]() Without example, it's quite difficult, this fonction isn't very documented... |
|||
![]() |
|
revolution
I assume you are writing your own OS based upon the forum you selected. So any example will rely upon how your OS works when exceptions happen, and how you interface with applications to allow setting the DR registers.
At the CPU level it is just a matter of setting the registers and waiting for the triggers to fire. Everything else is handled by the OS/debugger/application code. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2019, Tomasz Grysztar.
Powered by rwasa.