🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gdb.bug
Article #1237

Re: Nested control structures in Apple GDB broken?

#1237
From: Andrew Cagney
Date: Mon, 13 Dec 2004 19:47
57 lines
3324 bytes
Ryan Govostes wrote:

> However, if I try this:
> 
>     if($r3 == 0)
>     printf "$r3 is 0.\n"
>     else
>     if($r3 > 0)
>     printf "$r3 is greater than 0.\n"
>     else
>     printf "$r3 is less than 0.\n"
>     end
>     end

On Fedora Core 3 I'm seeing:

GNU gdb 6.3.50_2004-12-12-cvs
Copyright 2004 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 "powerpc-unknown-linux-gnu"...Using host 
libthread_db library "/lib/tls/libthread_db.so.1".

Setting up the environment for debugging gdb.
Breakpoint 1 at 0x1005c41c: file /home/scratch/GDB/src/gdb/utils.c, line 
873.
Breakpoint 2 at 0x1009ae7c: file 
/home/scratch/GDB/src/gdb/cli/cli-cmds.c, line 193.
(top-gdb) b main
Breakpoint 3 at 0x1004e62c: file /home/scratch/GDB/src/gdb/gdb.c, line 31.
(top-gdb) run
Starting program: 
/home/scratch/GDB/N-localhost-powerpc-unknown-linux-gnu/gdb/gdb

Breakpoint 3, main (argc=0x1, argv=0x7ffff944)
     at /home/scratch/GDB/src/gdb/gdb.c:31
31        args.argc = argc;
(top-gdb) if($r3 == 0)
  > printf "$r3 is 0.\n"
  >else
  > if($r3 > 0)
   > printf "$r3 is greater than 0.\n"
   >else
   > printf "$r3 is less than 0.\n"
   >end
  >end
$r3 is greater than 0.
(top-gdb) print $r3
$1 = 0x1
(top-gdb)

of course this GDB won't help you.

Andrew
Technical Details
Message-ID: <mailman.5693.1102968135.27204.bug-gdb@gnu.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!newshosting.com!nx02.iad01.newshosting.com!newsfeed.news2me.com!headwall.stanford.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
References: <22209C2A-4C87-11D9-B4F8-001124311056@gmail.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f5053,474656eb7a13e92a
X-Google-Attributes: gidf5053,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsread.com!newsprint.newsread.com!63.218.45.11.MISMATCH!newshosting.com!nx02.iad01.newshosting.com!newsfeed.news2me.com!headwall.stanford.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
From: Andrew Cagney <cagney@gnu.org>
Newsgroups: gnu.gdb.bug
Subject: Re: Nested control structures in Apple GDB broken?
Date: Mon, 13 Dec 2004 14:47:52 -0500
Lines: 59
Approved: bug-gdb@gnu.org
Message-ID: <mailman.5693.1102968135.27204.bug-gdb@gnu.org>
References: <22209C2A-4C87-11D9-B4F8-001124311056@gmail.com>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.Stanford.EDU 1102967508 27684 199.232.76.165 (13 Dec 2004 19:51:48 GMT)
X-Complaints-To: news@news.stanford.edu
Cc: bug-gdb@gnu.org
To: Ryan Govostes <rgovostes@gmail.com>
Envelope-to: bug-gdb@gnu.org
User-Agent: Mozilla Thunderbird 0.8 (X11/20041020)
X-Accept-Language: en-us, en
In-Reply-To: <22209C2A-4C87-11D9-B4F8-001124311056@gmail.com>
X-BeenThere: bug-gdb@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Bug reports for GDB, the GNU debugger" <bug-gdb.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/bug-gdb>
List-Post: <mailto:bug-gdb@gnu.org>
List-Help: <mailto:bug-gdb-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-gdb>,
 <mailto:bug-gdb-request@gnu.org?subject=subscribe>