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

* Re: Some Python bugs
  2009-10-13 19:16 Some Python bugs Daniel Jacobowitz
@ 2009-10-19 10:33 ` Phil Muldoon
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Muldoon @ 2009-10-19 10:33 UTC (permalink / raw)
  To: archer; +Cc: Daniel Jacobowitz

On 10/13/2009 08:16 PM, Daniel Jacobowitz wrote:
> 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):
>    

Daniel and I chatted on irc about these bugs/enhancements, and I 
volunteered to turn them into bugs so we could track them in bugzilla.

Cheers, Phil

List:

--

GDB.Values do not expose array bounds.

http://sourceware.org/bugzilla/show_bug.cgi?id=10804

GDB Type.fields() crashes on non-struct/class types

http://sourceware.org/bugzilla/show_bug.cgi?id=10805

Use ensure_python_env over PyGilState_Ensure

http://sourceware.org/bugzilla/show_bug.cgi?id=10806

Expose macro definitions to GDB Python API

http://sourceware.org/bugzilla/show_bug.cgi?id=10807

Allow GDB/Python API to capture and store GDB output

http://sourceware.org/bugzilla/show_bug.cgi?id=10808

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