This is the mail archive of the gdb-prs@sources.redhat.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]

gdb/54: xbreak is broken (off by 1).



>Number:         54
>Category:       gdb
>Synopsis:       xbreak is broken (off by 1).
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 12 00:18:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Fred Reiss
>Release:        5.0rh-5 Red Hat Linux 7.1
>Organization:
>Environment:
Default Red Hat Linux 7.1 installation on a Pentium III.
>Description:
xbreak sets its breakpoints one byte too high.
>How-To-Repeat:
[wuzzy:~] 15) gcc -g hello.c
 
[wuzzy:~] 16) gdb a.out
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) xbreak main
Breakpoint 1 at 0x804847d
(gdb) disas main
Dump of assembler code for function main:
0x8048460 <main>:       push   %ebp
0x8048461 <main+1>:     mov    %esp,%ebp
0x8048463 <main+3>:     sub    $0x8,%esp
0x8048466 <main+6>:     sub    $0xc,%esp
0x8048469 <main+9>:     push   $0x80484e8
0x804846e <main+14>:    call   0x804833c <printf>
0x8048473 <main+19>:    add    $0x10,%esp
0x8048476 <main+22>:    mov    $0x0,%eax
0x804847b <main+27>:    leave
0x804847c <main+28>:    ret
End of assembler dump.
(gdb) ru
Starting program: /home/phred/a.out
Hello, world!
 
Program exited normally.
(gdb)
>Fix:
You probably want to subtract DECR_PC_AFTER_BREAK from the
address at which xbreak currently sets its breakpoint.
>Release-Note:
>Audit-Trail:
>Unformatted:


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