🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ryan Govostes Sun, 12 Dec 2004 21:45
Nested control structures in Apple GDB broken?
#1236
Author: Ryan Govostes
Date: Sun, 12 Dec 2004 21:45
160 lines
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--
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads