• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Variable length arrays in debugger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Variable length arrays in debugger


  • Subject: Re: Variable length arrays in debugger
  • From: Tverdokhleb Andrey <email@hidden>
  • Date: Wed, 1 Oct 2008 15:28:16 -0700

Jim,
On Oct 1, 2008, at 14:44 , Jim Ingham wrote:

My simple example works when I rename the source file to .m. So it isn't the ObjC front-end that's at fault.

Yes, I tried that too and it does work. First clue.

When gcc emits stabs, it omits all reference to variable length arrays. That's a never to be fixed bug in gcc 'cause nobody cares that much about stabs anymore...

But in DWARF, the debug information should know the array's type.

Second clue I needed - Stabs don't handle VLAs. After reading this I've checked actual generated gcc command lines used to build my project and found that some lower level build config option overrides top level DWARF with Stabs+. After fixing it started to work as expected!
Size of the array is shown as [-1] and UI can't unfold it, but this is more like a usability issue and that's probably what you was talking about before.


So few examples for history and google (in gdb shell or window Expressions):
Direct references to VLA elements like array[3] work.
*array@10 or array[0]@10 unfolds to first 10 elements.
array[2]@3 unfolds to 3 elements starting from 2.


I hope that [-1] kludge will be fixed some day, but now I'm a happy camper anyway :)

Thank you very much for all your help!
Andrey
_______________________________________________
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


References: 
 >Variable length arrays in debugger (From: Tverdokhleb Andrey <email@hidden>)
 >Re: Variable length arrays in debugger (From: Howard Moon <email@hidden>)
 >Re: Variable length arrays in debugger (From: "Sean McBride" <email@hidden>)
 >Re: Variable length arrays in debugger (From: Jim Ingham <email@hidden>)
 >Re: Variable length arrays in debugger (From: Tverdokhleb Andrey <email@hidden>)
 >Re: Variable length arrays in debugger (From: Jim Ingham <email@hidden>)
 >Re: Variable length arrays in debugger (From: Tverdokhleb Andrey <email@hidden>)
 >Re: Variable length arrays in debugger (From: Jim Ingham <email@hidden>)

  • Prev by Date: Extra variable copy
  • Next by Date: Re: iPhone development with distcc
  • Previous by thread: Re: Variable length arrays in debugger
  • Next by thread: Re: Variable length arrays in debugger
  • Index(es):
    • Date
    • Thread