public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* possible regression in gdb 7.4 with -break-insert +0
@ 2012-03-21 15:02 Martin
  2012-03-21 15:41 ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Martin @ 2012-03-21 15:02 UTC (permalink / raw)
  To: gdb

I believe I found a regression in gdb 7.4. (Tested on Win 32bit Vista)

using "gdb -i mi", the command "-break-insert +0" should insert a 
breakpoint at the an offset of 0 lines from current.
- With previous versions of gdb, if the command was issued before 
-exec-run, then a breakpoint was inserted at the first line of code.
- With 7.4-2, it is inserted, but when running gives the error:
&"Error in re-setting breakpoint 1: No line 0 in file \"Test.pas\".\n"


To reproduce ( I use FreePascal 2.6 )

program Test;

begin
   writeln('Hello World');
end.

compile with:
    fpc.exe -g Test.pas

In the GDB output, I stripped some unrelated feedback

gdb 7.4 never stops. Also note the difference in "original-location"
gdb 7.3 stops as expected


GDB\7.4-2\gdb.exe -i mi

(gdb)
-file-exec-and-symbols Test.exe
^done
(gdb)
-break-insert +0
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004013fe",func="main",file="Test.pas",fullname="B:\\tmp\\bug0\\Test.pas",line="1",times="0",original-location="Test.pas:+0"}
(gdb)
-exec-run
=thread-group-started,id="i1",pid="7132"
=thread-created,id="1",group-id="i1"
~"[New Thread 7132.0x2418]\n"
^running
*running,thread-id="all"
(gdb)
&"Error in re-setting breakpoint 1: No line 0 in file \"Test.pas\".\n"
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="n",addr="<PENDING>",pending="Test.pas:+0",times="0",original-location="Test.pas:+0"}
Hello World
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1",exit-code="0"
*stopped,reason="exited-normally"
(gdb)



GDB\7.3-2\gdb.exe -i mi

-file-exec-and-symbols Test.exe
^done
(gdb)
-break-insert +0
^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x004013fe",func="main",file="Test.pas",fullname="b:\\tmp\\bug0\\test.pas",line="1",times="0",original-location="Test.pas:1"}
(gdb)
-exec-run
=thread-group-started,id="i1",pid="7200"
=thread-created,id="1",group-id="i1"
~"[New Thread 7200.0x17e8]\n"
^running
*running,thread-id="all"
(gdb)
*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x004013fe",func="main",args=[],file="Test.pas",fullname="b:\\tmp\\bug0\\test.pas",line="4"},thread-id="1",stopped-threads="all"
(gdb)



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

* Re: possible regression in gdb 7.4 with -break-insert +0
  2012-03-21 15:02 possible regression in gdb 7.4 with -break-insert +0 Martin
@ 2012-03-21 15:41 ` Keith Seitz
  2012-03-21 15:44   ` Keith Seitz
  0 siblings, 1 reply; 3+ messages in thread
From: Keith Seitz @ 2012-03-21 15:41 UTC (permalink / raw)
  To: Martin; +Cc: gdb

On 03/21/2012 08:01 AM, Martin wrote:
> I believe I found a regression in gdb 7.4. (Tested on Win 32bit Vista)
>
> using "gdb -i mi", the command "-break-insert +0" should insert a
> breakpoint at the an offset of 0 lines from current.
> - With previous versions of gdb, if the command was issued before
> -exec-run, then a breakpoint was inserted at the first line of code.
> - With 7.4-2, it is inserted, but when running gives the error:
> &"Error in re-setting breakpoint 1: No line 0 in file \"Test.pas\".\n"

I can reproduce this with CVS HEAD today. I believe this is fallout from 
the ambiguous linespec patch, but I did not investigate it, because I've 
just submitted a monstrous patch to rewrite most of this area (linespecs).

I mention this because on my archer-keiths-linespec-rewrite branch 
(which is CVS HEAD + my linespec rewrite patch), this appears to work:

$ ./gdb -q gdb
Reading symbols from /home/keiths/work/archer/linespec/linux/gdb/gdb...done.
(top-gdb) b +0
Breakpoint 1 at 0x455153: file ../../archer/gdb/gdb.c, line 25.
(top-gdb) r -nx -q
Starting program: /home/keiths/work/archer/linespec/linux/gdb/gdb
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, main (argc=1, argv=0x7fffffffe0a8) at 
../../archer/gdb/gdb.c:29
29	  memset (&args, 0, sizeof args);

Compare to CVS HEAD:

$ ./gdb -nx -q gdb
Reading symbols from 
/home/keiths/sources/gdb/git/virgin/linux/gdb/gdb...done.
(top-gdb) b +0
Breakpoint 1 at 0x487343: file ../../gdb/gdb/gdb.c, line 20.
(top-gdb) r -nx -q
Starting program: /home/keiths/sources/gdb/git/virgin/linux/gdb/gdb -nx -q
Error in re-setting breakpoint 1: No line 0 in file "../../gdb/gdb/gdb.c".
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

So when my patch is approved (might take many days yet), this should be 
working again. I'm afraid that doesn't help you much now, though...

Keith

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

* Re: possible regression in gdb 7.4 with -break-insert +0
  2012-03-21 15:41 ` Keith Seitz
@ 2012-03-21 15:44   ` Keith Seitz
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Seitz @ 2012-03-21 15:44 UTC (permalink / raw)
  To: gdb

On 03/21/2012 08:41 AM, Keith Seitz wrote:
> So when my patch is approved (might take many days yet), this should be
> working again. I'm afraid that doesn't help you much now, though...

PS. I'll add a test for this...

Keith

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

end of thread, other threads:[~2012-03-21 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21 15:02 possible regression in gdb 7.4 with -break-insert +0 Martin
2012-03-21 15:41 ` Keith Seitz
2012-03-21 15:44   ` Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).