This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Single-stepping through INT nn instructions



> > So you're trying to step *into* an int, not over it, right?
> 
> I meant this: suppose the debuggee is stopped right in front of the
> INT nn instruction.  Now I want to do a "stepi" in GDB.

Hmm.  The system call seems to happen on the instruction *after* the
int, so I think I have no idea what's going on here.  I don't think
GDB can really "simulate" an `int' in this context.  Let me know what
you come up with.

(gdb) run
Starting program: /home/jimb/play/wr 

Breakpoint 1, main () at wr.c:3
3         write (1, "foobar\n", 7);
(gdb) stepi
0x8048129       3         write (1, "foobar\n", 7);
(gdb) display/i $pc
1: x/i $eip  0x8048129 <main+5>:        pushl  $0x805948c
(gdb) stepi
0x804812e       3         write (1, "foobar\n", 7);
1: x/i $eip  0x804812e <main+10>:       pushl  $0x1
(gdb) 
0x8048130       3         write (1, "foobar\n", 7);
1: x/i $eip  0x8048130 <main+12>:       call   0x804ca90 <__write>
(gdb) 
0x804ca90 in __write ()
1: x/i $eip  0x804ca90 <__write>:       pushl  %ebx
(gdb) 
0x804ca91 in __write ()
1: x/i $eip  0x804ca91 <__write+1>:     movl   0x10(%esp,1),%edx
(gdb) 
0x804ca95 in __write ()
1: x/i $eip  0x804ca95 <__write+5>:     movl   0xc(%esp,1),%ecx
(gdb) 
0x804ca99 in __write ()
1: x/i $eip  0x804ca99 <__write+9>:     movl   0x8(%esp,1),%ebx
(gdb) 
0x804ca9d in __write ()
1: x/i $eip  0x804ca9d <__write+13>:    movl   $0x4,%eax
(gdb) 
0x804caa2 in __write ()
1: x/i $eip  0x804caa2 <__write+18>:    int    $0x80
(gdb) 
0x804caa4 in __write ()
1: x/i $eip  0x804caa4 <__write+20>:    popl   %ebx
(gdb) 
foobar
0x804caa5 in __write ()
1: x/i $eip  0x804caa5 <__write+21>:    cmpl   $0xfffff001,%eax
(gdb) 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]