public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* C99 variable length arrays
@ 2006-01-26 13:49 Igor Khavkine
  2006-01-26 15:08 ` Daniel Jacobowitz
  0 siblings, 1 reply; 5+ messages in thread
From: Igor Khavkine @ 2006-01-26 13:49 UTC (permalink / raw)
  To: gdb

[First posted to bug-gdb@gnu.org, but that list looks rather dead.]

I'm using GDB to debug some code that uses local variable length
arrays. This feature is available for C as of the C99 standard. GCC
has support for it.

Sadly, GDB doesn't seem to be smart enough to figure out the size of
the arrays at run time. This leads to things like 'print array[1][2]'
at the GDB prompt not printing the same value as would 'printf("%g\n",
array[1][2])' in the code. This is a problem for multidimensional
arrays especially. Needless to say, this makes the code more difficult
to debug.

The GDB bug database has PR 1796 [1] dedicated to this exact issue.
However, the report is over a year old and I couldn't find any work
done on it. If this problem is easy to fix for some GDB hacker, I hope
this email brings it to their attention. If not, and no-one else has
the time to look into it, I'm getting sufficiently annoyed by the bug
to try my own hand at fixing it. Unfortunately, I'm completely
unfamiliar with the internals of GDB and am not sure where to look in
the GDB source code or the debugging info generated by GCC. Any
pointers (no pun intended :-) would be appreciated.

Thanks in advance.

Igor

[1] http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=1796

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-01-27  0:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-26 13:49 C99 variable length arrays Igor Khavkine
2006-01-26 15:08 ` Daniel Jacobowitz
2006-01-26 23:33   ` Igor Khavkine
2006-01-27  0:02     ` Daniel Jacobowitz
2006-01-27  8:15       ` Igor Khavkine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).