I have some c code to concatenate a string.
char str_cat[strlen(str1) + strlen(str2) + 1];
How do I check the sizeof str_cat in gdb? Right now it reports 0 with:
print sizeof(str_cat)
It does print the string, but how do I print it showing the null character?
Let me reword, how do I verify that str_cat is the proper size and has enough space?
str_catis a variable length array. Apparentlygdbdoes not how to deal with variable length arrays.There is an open ticket here regarding this issue:
http://sourceware.org/bugzilla/show_bug.cgi?id=9663
it mentions an existing patch but at least my
2012version7.4ofgdbdoes not include it.