NetBSD Problem Report #38185

From christos@zoulas.com  Thu Mar  6 18:14:41 2008
Return-Path: <christos@zoulas.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 3A4C063B88C
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  6 Mar 2008 18:14:41 +0000 (UTC)
Message-Id: <20080306181437.BD08856542@rebar.astron.com>
Date: Thu,  6 Mar 2008 13:14:37 -0500 (EST)
From: christos@zoulas.com
Reply-To: christos@zoulas.com
To: gnats-bugs@gnats.NetBSD.org
Subject: gdb does not step properly.
X-Send-Pr-Version: 3.95

>Number:         38185
>Category:       toolchain
>Synopsis:       gdb does not step properly.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 06 18:15:04 +0000 2008
>Closed-Date:    
>Last-Modified:  Sun May 01 06:09:11 +0000 2016
>Originator:     Christos Zoulas
>Release:        NetBSD 4.99.1
>Organization:
	Chaos and Entropy
>Environment:
System: NetBSD rebar.astron.com 4.99.1 NetBSD 4.99.1 (ASTRON) #2: Fri Sep 8 15:10:53 EDT 2006 christos@rebar.astron.com:/usr/src/sys/arch/i386/compile/ASTRON i386
Architecture: i386
Machine: i386
>Description:
	Gdb "step" "next" or "stepi" does not work when entering a function
	breakpoint.
>How-To-Repeat:
	$ cat > ~/.calendar
	1
	2
	3
	^D
	$ gdb calendar
	(gdb) break isnow
	(gdb) run
	(gdb) print endp
	1
	(gdb) step
	(gdb) print endp
	2
>Fix:
	?

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: toolchain-manager->skrll
Responsible-Changed-By: skrll@NetBSD.org
Responsible-Changed-When: Fri, 21 Mar 2008 12:57:51 +0000
Responsible-Changed-Why:
take


From: Patrick Welche <prlw1@cam.ac.uk>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: toolchain/38185 gdb does not step properly.
Date: Fri, 13 Feb 2015 11:32:43 +0000

 This works for me on 7.99.4/amd64 - bug fixed?

 GNU gdb (GDB) 7.7.1

 (gdb) print endp
 $1 = 0x7f7ff7b15110 "1"
 (gdb) step
 260             if (!(v1 = getfield(endp, &endp, &flags)))
 (gdb) print endp
 $2 = 0x7f7ff7b15110 "1"

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sat, 14 Feb 2015 07:39:32 +0000
State-Changed-Why:
Assume fixed? Both gdb and calendar have moved on somewhat...


From: "William D. Jones" <thor0505@comcast.net>
To: <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: toolchain/38185
Date: Sat, 4 Apr 2015 22:41:00 -0400

 On my Raspberry Pi Model A, even the version of GDB that Patrick Welche is 
 using has this bug. I am not able to test Christos' exact code/setup. 
 However, here is an example program (ignore the "Reset CPU" messages- I'm 
 playing with a CPU over RPI GPIO), compiled without optimization (and of 
 course containing the -g option), showing the problem exists on my machine:

 rpi-ptrain# gdb -v
 GNU gdb (GDB) 7.7.1
 Copyright (C) 2014 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
 and "show warranty" for details.
 This GDB was configured as "arm--netbsdelf-eabihf".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>.
 Find the GDB manual and other documentation resources online at:
 <http://www.gnu.org/software/gdb/documentation/>.
 For help, type "help".

 rpi-ptrain# gdb -q buf65test
 Reading symbols from buf65test...done.
 (gdb) l 78
 73         if(write_ctrl_line(gpiofd, PHI2, 1) == -1) /* PHI2 high, so next 
 toggle starts new cycle. */
 74         {
 75           printf("Fail...: %s\n", strerror(errno));
 76         }
 77         write_ctrl_line(gpiofd, RESB, 0);
 78         toggle_ctrl_line(gpiofd, PHI2);
 79         toggle_ctrl_line(gpiofd, PHI2);
 80         toggle_ctrl_line(gpiofd, PHI2);
 81         toggle_ctrl_line(gpiofd, PHI2);
 82         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) b 78
 Breakpoint 1 at 0x10a30: file buf65test.c, line 78.
 (gdb) r
 Starting program: /home/wjones/src/buf65test/buf65test
 Reset CPU...

 Breakpoint 1, main (argc=1, argv=0xbfffcdbc) at buf65test.c:78
 78         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) s
 Data at transceiver: 0
 [Inferior 1 (process 4147) exited normally]
 (gdb)


 Same thing happens with n(ext):
 rpi-ptrain# gdb -q buf65test
 Reading symbols from buf65test...done.
 (gdb) b 78
 Breakpoint 1 at 0x10a30: file buf65test.c, line 78.
 (gdb) r
 Starting program: /home/wjones/src/buf65test/buf65test
 Reset CPU...


 stepi doesn't work properly either, only executing two instructions before 
 giving up on breakpoints.
 Breakpoint 1, main (argc=1, argv=0xbfffcdbc) at buf65test.c:78
 78         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) n
 Data at transceiver: 0
 [Inferior 1 (process 834) exited normally]
 (gdb)

 rpi-ptrain# gdb -q buf65test
 Reading symbols from buf65test...done.
 (gdb) b 78
 Breakpoint 1 at 0x10a30: file buf65test.c, line 78.
 (gdb) r
 Starting program: /home/wjones/src/buf65test/buf65test
 sReset CPU...

 Breakpoint 1, main (argc=1, argv=0xbfffcdbc) at buf65test.c:78
 78         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) stepi
 0x00010a34      78         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) stepi
 0x00010a38      78         toggle_ctrl_line(gpiofd, PHI2);
 (gdb) stepi
 Data at transceiver: 0
 [Inferior 1 (process 848) exited normally]
 (gdb)

 The u(ntil) command doesn't work either. So basically, I have no 
 single-stepping. I have no idea whether this is related to the bug as 
 Christos described, but since it matches the symptoms, I figure it's worth 
 adding my feedback.

 Sincerely,

 --
 William D. Jones 

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, gnats-admin@netbsd.org, 
 netbsd-bugs@netbsd.org, christos@zoulas.com
Cc: 
Subject: Re: toolchain/38185
Date: Sun, 05 Apr 2015 09:48:00 +0100

 On 04/05/15 03:45, William D. Jones wrote:
 > The following reply was made to PR toolchain/38185; it has been noted by GNATS.
 >
 > From: "William D. Jones" <thor0505@comcast.net>
 > To: <gnats-bugs@NetBSD.org>
 > Cc:
 > Subject: Re: toolchain/38185
 > Date: Sat, 4 Apr 2015 22:41:00 -0400
 >
 >   On my Raspberry Pi Model A, even the version of GDB that Patrick Welche is
 >   using has this bug. I am not able to test Christos' exact code/setup.
 >   However, here is an example program (ignore the "Reset CPU" messages- I'm
 >   playing with a CPU over RPI GPIO), compiled without optimization (and of
 >   course containing the -g option), showing the problem exists on my machine:

 Can you make buf65test and source available?

 Thanks,
 Nick

From: "William D. Jones" <thor0505@comcast.net>
To: <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: toolchain/38185
Date: Sun, 5 Apr 2015 20:41:21 -0400

 Here is a download link to the test program's source, binary, and Makefile. 
 It should compile without any external dependencies other than requiring the 
 comp set. Since between writing the previous post and now, I added a 
 REPLoop, so now stepping after line 78 breakpoint goes into the loop without 
 stopping at subsequent statements! For the I2C ioctls() to succeed, attach a 
 PCF8574 (http://www.ti.com/lit/ds/symlink/pcf8574.pdf) to /dev/iic1 (the 
 SDA/SCL lines on the RPI’s Model A/B (not A+/B+) GPIO), or just force them 
 to return a dummy value.

 https://dl.dropboxusercontent.com/u/20852311/buf65test.tar.gz

 Sincerely,

 --
 William D. Jones 

From: "William D. Jones" <thor0505@comcast.net>
To: <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: toolchain/38185
Date: Thu, 7 May 2015 00:01:52 -0400

 Has there been any progress re: this bug (at least what I suspect to either 
 be a regression or the same bug)? I'm still checking this bug report 
 periodically, but responses from others have not been sent to me via email 
 for whatever reason.

 Nick, the link to the source code should still be valid.

 Thanks in advance for the help!

 Sincerely,
 --
 William D. Jones
 thor0505@comcast.net 

State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sun, 01 May 2016 06:09:11 +0000
State-Changed-Why:
feedback received


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.