Article View: gnu.gdb.bug
Article #1236Nested control structures in Apple GDB broken?
From: Ryan Govostes
Date: Sun, 12 Dec 2004 21:45
Date: Sun, 12 Dec 2004 21:45
160 lines
5260 bytes
5260 bytes
--Apple-Mail-1-26674574
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
I've been having an issue with the version of GDB that comes with the
Apple Developer Tools, and I wanted to see if it is due to Apple's
changes to the code, or GDB itself. Here is the start up message when I
run GDB:
> GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16 21:42:28
> GMT 2004)
> Copyright 2003 Free Software Foundation, Inc.
> ...
The problem I've been having is that I cannot use nested control
structures. For instance, this will work just fine:
> if($r3 == 0)
> printf "$r3 is 0.\n"
> else
> printf "$r3 is not 0.\n"
> end
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
I get the message "Junk after end of expression." I believe this was
working in earlier versions, because I have some defined commands in my
.gdbinit file which have loops and such, but none of them work anymore.
For instance, when I run this command:
> # Searches for the start of the current function
> define fs
> set $i = $pc
> while(*$i != 0x7C0802A6)
> set $i = $i - 4
> end
> print $i
> end
I get another "Junk after end of expression." error, though I'm certain
that at the time I wrote it, the command worked fine.
I haven't tested to see if this is fixed in the developer tools which
will come with Mac OS 10.4 "Tiger", but I will try to find someone who
has a recent copy to see if the problem is fixed.
Regards,
Ryan Govostes
--Apple-Mail-1-26674574
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
charset=US-ASCII
I've been having an issue with the version of GDB that comes with the
Apple Developer Tools, and I wanted to see if it is due to Apple's
changes to the code, or GDB itself. Here is the start up message when
I run GDB:
<excerpt>GNU gdb 5.3-20030128 (Apple version gdb-330.1) (Fri Jul 16
21:42:28 GMT 2004)
Copyright 2003 Free Software Foundation, Inc.
...
</excerpt>
The problem I've been having is that I cannot use nested control
structures. For instance, this will work just fine:
<excerpt>if($r3 == 0)
printf "$r3 is 0.\n"
else
printf "$r3 is not 0.\n"
end
</excerpt>
However, if I try this:
<excerpt>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
</excerpt>
I get the message "Junk after end of expression." I believe this was
working in earlier versions, because I have some defined commands in
my .gdbinit file which have loops and such, but none of them work
anymore. For instance, when I run this command:
<excerpt># Searches for the start of the current function
define fs
set $i = $pc
while(*$i != 0x7C0802A6)
set $i = $i - 4
end
print $i
end
</excerpt>
I get another "Junk after end of expression." error, though I'm
certain that at the time I wrote it, the command worked fine.
I haven't tested to see if this is fixed in the developer tools which
will come with Mac OS 10.4 "Tiger", but I will try to find someone who
has a recent copy to see if the problem is fixed.
Regards,
Ryan Govostes<color><param>0000,6363,1212</param>
</color>
--Apple-Mail-1-26674574--
Technical Details
Message-ID:
<mailman.5440.1102888581.27204.bug-gdb@gnu.org>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f5053,474656eb7a13e92a,start X-Google-Attributes: gidf5053,public X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail From: Ryan Govostes <rgovostes@gmail.com> Newsgroups: gnu.gdb.bug Subject: Nested control structures in Apple GDB broken? Date: Sun, 12 Dec 2004 16:45:26 -0500 Lines: 163 Approved: bug-gdb@gnu.org Message-ID: <mailman.5440.1102888581.27204.bug-gdb@gnu.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Apple Message framework v619) Content-Type: multipart/alternative; boundary=Apple-Mail-1-26674574 X-Trace: news.Stanford.EDU 1102887956 5052 199.232.76.165 (12 Dec 2004 21:45:56 GMT) X-Complaints-To: news@news.stanford.edu To: bug-gdb@gnu.org Envelope-to: bug-gdb@gnu.org DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:return-path:mime-version:to:message-id:content-type:from:subject:date:x-mailer; b=qgb3Mny+agSSi4WdLuVQ4oiq8JZrcDqwBntjWjvT1iW0QmHFET3tlHLr11OmG6rdz+ErzIFsfpRx0u3G8JqZe16Qsg4E1pARLpgusK1T8/YvMhKTpRpupDY3kzjBz1KMPbjNwUKG2IOudXY5C0SY/aj/encyjWbDlkdGSTIzlFc= X-Mailer: Apple Mail (2.619) 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>