This is the mail archive of the gdb-prs@sourceware.org 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]
Other format: [Raw text]

[Bug gdb/13508] gdb doesn't clean trap flag


http://sourceware.org/bugzilla/show_bug.cgi?id=13508

--- Comment #1 from Anderson Eduardo <andersonc0d3 at gmail dot com> 2011-12-16 03:10:42 UTC ---
Sorry lack of information, I pushed enter unintentionally.

When I use pushf instruction, gdb set trap flag but doesn't clean when return
to my program generating a SIGTRAP signal.

(gdb) disass main
Dump of assembler code for function main:
   0x080483b4 <+0>:    push   %ebp
   0x080483b5 <+1>:    mov    %esp,%ebp
   0x080483b7 <+3>:    pushf  
   0x080483b8 <+4>:    popf   
   0x080483b9 <+5>:    mov    $0x0,%eax
   0x080483be <+10>:    pop    %ebp
   0x080483bf <+11>:    ret    
End of assembler dump.
(gdb) b *main+3
Breakpoint 1 at 0x80483b7: file trapflag.c, line 4.
(gdb) r
Starting program: /home/XXXXXX/Coding/asm/trapflag 

Breakpoint 1, main () at trapflag.c:4
4            asm("pushf;popf");
(gdb) p/x $eflags
$1 = 0x246
(gdb) x/x $esp
0xbfd91b18:    0x00000000
(gdb) x/i $eip
=> 0x80483b7 <main+3>:    pushf  
(gdb) ni
0x080483b8    4            asm("pushf;popf");
(gdb) x/x $esp
0xbfd91b14:    0x00000346
(gdb) x/i $eip
=> 0x80483b8 <main+4>:    popf   
(gdb) ni
5            return 0;
(gdb) p/x $eflags
$2 = 0x346
(gdb) c
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
main () at trapflag.c:6
6    }
(gdb)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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