bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inferior process receives SIGSEGV on invalid breakpoint


From: Xavier de Gaye
Subject: Inferior process receives SIGSEGV on invalid breakpoint
Date: Tue, 17 Feb 2004 08:22:54 -0500

The inferior process receives SIGSEGV when stopping at a breakpoint
set at an invalid program instruction address.

====================================================================
/* The foobar program */
main()
{
    int i;

    for (i = 0; ; i++)
    {
    printf("value %d\n", i);
    }
}
========================= ASM CODE ================================
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>: nop
0x8048467 <main+7>: movl   $0x0,0xfffffffc(%ebp)
0x804846e <main+14>:    mov    %esi,%esi
0x8048470 <main+16>:    sub    $0x8,%esp
0x8048473 <main+19>:    pushl  0xfffffffc(%ebp)
0x8048476 <main+22>:    push   $0x80484f4
0x804847b <main+27>:    call   0x804833c <printf>
0x8048480 <main+32>:    add    $0x10,%esp
0x8048483 <main+35>:    lea    0xfffffffc(%ebp),%eax
0x8048486 <main+38>:    incl   (%eax)
0x8048488 <main+40>:    jmp    0x8048470 <main+16>
End of assembler dump.
========================= GDB INPUT ================================
# GDB input - 0x8048471 is not a valid program instruction address
file foobar
break *0x8048471
run
========================= GDB OUTPUT ===============================
GNU gdb 5.3
Copyright 2002 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 "i586-pc-linux-gnu".
(gdb) Reading symbols from foobar...done.
(gdb) Breakpoint 1 at 0x8048471: file foobar.c, line 8.
(gdb) Starting program: /home/xavier/tmp/foobar 

Program received signal SIGSEGV, Segmentation fault.
0x08048473 in main () at foobar.c:8
8       printf("value %d\n", i);
(gdb) 
====================================================================



__________________________________________________________________
New! Unlimited Netscape Internet Service.
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
Act now to get a personalized email address!

Netscape. Just the Net You Need.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]