Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* RE: "xbreak" command in GDB ?
@ 2002-01-25  0:24 Sarnath K - CTD, Chennai.
  0 siblings, 0 replies; 10+ messages in thread
From: Sarnath K - CTD, Chennai. @ 2002-01-25  0:24 UTC (permalink / raw)
  To: Eli Zaretskii, k_sarnath; +Cc: gdb

Hi,

The following is the session demonstrating
failure of "xbreak" on GDB Version 5.1 (for i386), running
on Linux kernel 2.4.0/Pentium III. GDB was configured
for "i686-pc-linux-gnu".

Source:

[root@boost /tmp]# cat xbreak.c
int main()
{
        a();
}

int a()
{
        int i=0, j=0;

        return 0;
}

Compilation:

[root@boost /tmp]# cc -g -o xbreak xbreak.c

Debug session:

[root@boost /tmp]# ./gdb ./xbreak
GNU gdb 5.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 "i686-pc-linux-gnu"...
(gdb) xbreak a
Breakpoint 1 at 0x80483c6
(gdb) run
Starting program: /tmp/./xbreak

Program exited normally.
(gdb) disassemble a
Dump of assembler code for function a:
0x80483ac <a>:  push   %ebp
0x80483ad <a+1>:        mov    %esp,%ebp
0x80483af <a+3>:        sub    $0x8,%esp
0x80483b2 <a+6>:        movl   $0x0,0xfffffffc(%ebp)
0x80483b9 <a+13>:       movl   $0x0,0xfffffff8(%ebp)
0x80483c0 <a+20>:       xor    %eax,%eax
0x80483c2 <a+22>:       jmp    0x80483c4 <a+24>
0x80483c4 <a+24>:       leave
0x80483c5 <a+25>:       ret
End of assembler dump.

Conclusion:
 The "xbreak" command says that it has set the bkpt at
0x80483c6. But the disassembly says that the last instruction
(ret) is at location 0x80483c5. Is this a bug ?

Thanks,
Sarnath


^ permalink raw reply	[flat|nested] 10+ messages in thread
[parent not found: <EF836A380096D511AD9000B0D021B52754B482@narmada.ctd.hcltech .com>]
* RE: "xbreak" command in GDB ?
@ 2002-01-25  0:33 Sarnath K - CTD, Chennai.
  0 siblings, 0 replies; 10+ messages in thread
From: Sarnath K - CTD, Chennai. @ 2002-01-25  0:33 UTC (permalink / raw)
  To: Pierre Muller; +Cc: gdb

>Simply try 
>./gdb ./gdb
>break main
>xbreak main
>disas main

 GDB never exits via the leaving point
of main() function, I suppose.
It exits via "quit_command" function.
I vaguely remember this ( when I was
browsing GDB source code.) So this test
might not reflect things correctly.
Correct me if I am wrong

Sarnath


^ permalink raw reply	[flat|nested] 10+ messages in thread
* "xbreak" command in GDB ?
@ 2002-01-24  1:33 Sarnath K - CTD, Chennai.
  2002-01-24 23:46 ` Eli Zaretskii
  2002-01-31 12:43 ` Michael Snyder
  0 siblings, 2 replies; 10+ messages in thread
From: Sarnath K - CTD, Chennai. @ 2002-01-24  1:33 UTC (permalink / raw)
  To: gdb

Hi All,
 The "xbreak" command (and hence "txbreak" ) 
in GDB Version 5.1 doesnt seem to work
properly.
 A minute investigation showed that it is
setting a break-point at a posn
1 past the last instrn of the "function". 
 Looks like a bug. Pardon me if I am wrong.
Maintainers can look into this.

Ciao,
Sarnath


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-01-31 20:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25  0:24 "xbreak" command in GDB ? Sarnath K - CTD, Chennai.
     [not found] <EF836A380096D511AD9000B0D021B52754B482@narmada.ctd.hcltech .com>
2002-01-25  1:20 ` Pierre Muller
2002-01-28 11:18   ` Elena Zannoni
  -- strict thread matches above, loose matches on Subject: below --
2002-01-25  0:33 Sarnath K - CTD, Chennai.
2002-01-24  1:33 Sarnath K - CTD, Chennai.
2002-01-24 23:46 ` Eli Zaretskii
2002-01-25  0:27   ` Pierre Muller
2002-01-31 12:45     ` Michael Snyder
2002-01-31 12:39   ` Michael Snyder
2002-01-31 12:43 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox