From: Igor Khavkine <igor.kh@gmail.com>
To: gdb@sourceware.org
Subject: C99 variable length arrays
Date: Thu, 26 Jan 2006 13:49:00 -0000 [thread overview]
Message-ID: <ab2dc45b0601260541s5b9c3886nec50e813bbd61130@mail.gmail.com> (raw)
[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
next reply other threads:[~2006-01-26 13:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-26 13:49 Igor Khavkine [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ab2dc45b0601260541s5b9c3886nec50e813bbd61130@mail.gmail.com \
--to=igor.kh@gmail.com \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox