Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Serge CHATROUX <serge.chatroux@st.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: GDB 7.2 - Patch proposal for the use of GDB/Python scripts on MinGW
Date: Mon, 13 Sep 2010 19:15:00 -0000	[thread overview]
Message-ID: <m3zkvla3xf.fsf@fleche.redhat.com> (raw)
In-Reply-To: <A42F0F6AD104734CAC7D6B1963F60DD80116E3AF5194@SAFEX1MAIL2.st.com>	(Serge CHATROUX's message of "Mon, 13 Sep 2010 13:44:09 +0200")

>>>>> "Serge" == Serge CHATROUX <serge.chatroux@st.com> writes:

Serge> +   cmdpy_object_type.tp_new = PyType_GenericNew; #endif

Tom> Just make your patch do this unconditionally on all hosts, with a
Tom> little (one line -- not as long as what you have above) comment
Tom> explaining where it is needed.  I think that is clearer than using
Tom> #ifdef all over.

Serge> I do not know how to avoid the '#if __MINGW32__' because this
Serge> modification is not needed for other systems (Linux, cygwin).

You can just use the MinGW code everywhere.

Serge> It seems that Daniel Jacobowitz succeed in compiling gdb over
Serge> MINGW without this modification.

Yeah, I don't know about that.  But, from
http://docs.python.org/extending/newtypes.html:

    We’d like to just assign this to the tp_new slot, but we can’t, for
    portability sake, On some platforms or compilers, we can’t statically
    initialize a structure member with a function defined in another C
    module, so, instead, we’ll assign the tp_new slot in the module
    initialization function just before calling PyType_Ready():

So it seems your change might be needed at least sometimes.

Tom> Perhaps this code and some surrounding code should be refactored so
Tom> that we can just avoid FILE* and use the same code path on all
Tom> hosts.

Serge> It could be great. I don't know the name of the Python scripting
Serge> support maintainers. It could be great to have their feedback.

If you want to do it, it is fine.

Serge> I set this feature to solve an issue that I had on Linux:
Serge> - I compiled Python support without the --enabled-shared support. 

Ok.

How does Python usually work in this setup?

Serge> 	gdb
Serge> 	'import site' failed; use -v for traceback

It seems that we could catch this error and disable the python support
at that time.

This error is very misleading because "gdb -v" won't actually help.
Ugh.

Tom


  reply	other threads:[~2010-09-13 18:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-10 13:58 Serge CHATROUX
2010-09-10 15:47 ` Tom Tromey
2010-09-13 17:09   ` Christophe Lyon
2010-09-13 17:41     ` Serge CHATROUX
2010-09-13 19:15       ` Tom Tromey [this message]
2010-09-17 14:42         ` Serge CHATROUX
2010-09-21 22:50           ` Tom Tromey
2010-09-11 16:34 ` Daniel Jacobowitz

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=m3zkvla3xf.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=serge.chatroux@st.com \
    /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