Hi, i can reproduce your bug, but i am afraid we can not do anything about this easily (more at the end)....
I have modified your example like this:
#define strLength 60
/* function prototypes */
void sort(char [][strLength], int);
/* void swap(char [], char []); */
int main(void)
{
char names[4][strLength] = {"Florida000000000000000000000xxxxxxxxxxxxxxxxxxxxxx",
"Oregon",
"California",
"Georgia"};
now if we look at the output of the gdb log we get this:
> output names
->{"Florida", '0' <repeats 21 times>, 'x' <repeats 22 times>, "\000\000\000\000\000\000\000\000\000", "Oregon", '\000' <repeats 53 times>, "California", '\000' <repeats 49 times>, "Georgia", '\000' <repeats 52 times>}
as here is visible gdb does not give us any hints where the nested array is ending (the names) and where the next is starting. As you would expect because internally a multi dimensional array in c is a continuous memory block.
The only way to distinguishe this would be to count the actual elements. So first look at the output of the what is call
> whatis names
->type = char [4][60]
and then parse the output of "names" accordingly by counting all characters and <repeats x times> occurrences.
This will probably not happen....
AndrewCot is currently working on a new type of gdb plugin, that makes output parsing a lot better (see
https://forums.codeblocks.org/index.php/topic,25058.0.html ) I will look into this the next week and i think we will probably introduce this plugin in codeblocks in the future for a better debugging experience.
I have not tested it until now, so i do not know exactly if this "quirk" you have reported is different in the new plugin...