Re: Option for viewing all values of an array?
Re: Option for viewing all values of an array?
- Subject: Re: Option for viewing all values of an array?
- From: Jocelyn Houle <email@hidden>
- Date: Mon, 25 Jan 2010 19:50:47 -0500
I just tried it (to learn), and it sounds like it would be:
p *my_array@100
Non-obj-C apps don't have access to the 'po' command (I get a "Unable to locate _NSPrintForDebugger or _CFPrintForDebugger in child process" error).
BTW, if your array is an array of structures, GDB will expand all of the struct's members for you...
On 2010-01-25, at 19:29, Roland King wrote:
> p my_array@100
>
> .. or something very like that. If gdb doesn't know what type of array you have you sometimes need to cast the my_array
>
> p ((double*)my_array)@100
>
> That's all typed in mail and I normally end up trying a few combos until I get it right.
>
> Jens Alfke wrote:
>> On Jan 25, 2010, at 3:48 PM, Jonathon Kuo wrote:
>>> Cool. How about for a C array, like float my_array[1000]?
>> Hm. You can type "po my_array[0]" (assuming the items are Obj-C objects; otherwise use the "p" command) and then repeat for each index. There might be a way to automate that using clever GDB syntax, but I don't know how.
>> —Jens _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Xcode-users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> This email sent to email@hidden
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden