NO

Author Topic: Drop-down list of contents of char array in debugger?  (Read 2468 times)

edw211

  • Guest
Drop-down list of contents of char array in debugger?
« on: June 16, 2011, 12:13:39 AM »
Hello all,

I recently chose Pelles C as my IDE with which to learn C. I just figured out how to use the debugger at C-level instead of assembly, and there is one customization I'd like to make if possible.

When I start my program, if I have a character array declared in my main(), it will show up in the Local tab as having a drop-down button so I can view the individual elements by index kind of like this:

str
    <0>    a
    <1>    b
    <2>    c

However, if I pass that array to a function, when I am in that function with the debugger, the parameter array will show up like this:

str "abc"

Is there any way I can change that so that I can always view an array as a drop-down list?


CommonTater

  • Guest
Re: Drop-down list of contents of char array in debugger?
« Reply #1 on: June 17, 2011, 05:04:31 PM »
I don't think there is.  You might consider posting this as a feature request.

Don't forget when in your function where the array is declared, C knows the size of the array but in a different function it only has a pointer to the array and no longer knows it's size...  The debugger can show strings because it can determine strlen() from the null terminator but other arrays will show as a pointer only -- size unknown.
« Last Edit: June 18, 2011, 02:56:57 AM by CommonTater »

edw211

  • Guest
Re: Drop-down list of contents of char array in debugger?
« Reply #2 on: June 17, 2011, 07:05:37 PM »
Yeah, that makes sense. Once again, thanks Tater.