x86 #DB throwing exceptions effect on program state?

Emulation of old PCs, PC hardware, or PC peripherals.

x86 #DB throwing exceptions effect on program state?

Postby superfury » 2019-9-05 @ 08:04

What is the state when, for example, a single-step exception throws an exception? What is the state of registers in the causative task that has TF set? What about it's memory and register state(EIP, EFLAGS, memory accesses done by the instruction)?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: x86 #DB throwing exceptions effect on program state?

Postby Stenzek » 2019-9-05 @ 11:36

As far as I understand it, it's the same as a regular exception, except the IP pushed on the stack is after the instruction, not before.

Edit: Not sure about the EXT bit, though. Would have to check.
Stenzek
Newbie
 
Posts: 55
Joined: 2017-12-08 @ 08:30

Re: x86 #DB throwing exceptions effect on program state?

Postby superfury » 2019-9-05 @ 17:46

It's probably set, as the debug fault isn't triggered by the instruction at CS:(E)IP itself? Thus external?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands

Re: x86 #DB throwing exceptions effect on program state?

Postby Stenzek » 2019-9-06 @ 00:11

Yeah, one would think it'd be the same as INTO/BOUND/etc
Stenzek
Newbie
 
Posts: 55
Joined: 2017-12-08 @ 08:30

Re: x86 #DB throwing exceptions effect on program state?

Postby superfury » 2019-9-06 @ 08:41

What about the DR6 bits? Are they still going to be set during the double fault(#DB+exception=double fault)? Or are they only applied at the end of a succeeding #DB exception(when it commits the exception handler for the next instruction), instead of pushing the error code?
superfury
l33t
 
Posts: 3206
Joined: 2014-3-08 @ 11:25
Location: Netherlands


Return to PC Emulation

Who is online

Users browsing this forum: No registered users and 0 guests