public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
* Some Python bugs
@ 2009-10-13 19:16 Daniel Jacobowitz
  2009-10-19 10:33 ` Phil Muldoon
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2009-10-13 19:16 UTC (permalink / raw)
  To: archer

I recently wrote a Python script to search through debug info and
generate some XML data I needed.  Here's a few issues I noticed
(from memory, please excuse typos):

* The Python bindings do not expose array bounds.  I had to use sizeof
to determine the size and assume the array was zero-indexed (which is
C-specific).

* Calling type.fields on an array type crashes.  It accesses
TYPE_N_BASECLASSES; cplus_stuff isn't allocated for non-structs.

* The archer branch calls PyGILState_Ensure in several places where it
should call ensure_python_env.  So python_language was often unset if
I tried 'gdb -ex "source -p file.py"'.  To work around it, I had the
end of file.py register a new gdb.Command, and called the command.

* There's no way to get at macro definitions (e.g. info macro).  Also,
GDB doesn't offer a list of all macros defined... I had to use
"complete print " and pass them all to info macro.

* It would be really useful to temporarily redirect GDB output to a
memory buffer, i.e. a version of gdb.execute that captured the
command's output.  Especially where there aren't specific Python
bindings for what I wanted.

-- 
Daniel Jacobowitz
CodeSourcery

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

end of thread, other threads:[~2009-10-19 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-13 19:16 Some Python bugs Daniel Jacobowitz
2009-10-19 10:33 ` Phil Muldoon

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).