TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Pascal Schmidt
from: Jasen Betts
date: 2004-05-23 13:10:32
subject: Debugger

Hi Pascal.

22-May-04 14:34:18, Pascal Schmidt wrote to Jasen Betts


 PS> Hi Jasen! :-)

 JB>> Extremely hard to do in software without interpreting the entire
 JB>> program.

 PS> Albeit slow, single-stepping the program should also work. ;) This
 PS> can be done by replacing the next instruction with an INT1 (one
 PS> byte opcode)

no, that won't work for data breakpoint set for read operations...
you need to interpret the op-codes to see which addresses they are referencing.

for a write breakpoint that'd almost work though - only missing when the
program overwrites the same value.

break is int3 iirc. (iAPX86 op-code "0xCC")

the other way to single-step is to arrange to have set the single-step flag
set. (this flag is cleared when the int-3 handler is called automatically
restored from the copy of flags on the stack when the reti returns from the
int-handler

 PS> Under Linux, one would use ptrace(2) instead

That may use the single-step flag...

 -=> Bye <=-

---
* Origin: If at first you don't succeed, the hell with it. (3:640/1042)
SEEN-BY: 633/267 270
@PATH: 640/1042 531 954 774/605 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.