bug-gdb
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Nested control structures in Apple GDB broken?


From: Ryan Govostes
Subject: Nested control structures in Apple GDB broken?
Date: Sun, 12 Dec 2004 16:45:26 -0500

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]