Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Serge CHATROUX <serge.chatroux@st.com>
To: Tom Tromey <tromey@redhat.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: Fri, 17 Sep 2010 14:42:00 -0000	[thread overview]
Message-ID: <A42F0F6AD104734CAC7D6B1963F60DD80116E3AF5D94@SAFEX1MAIL2.st.com> (raw)
In-Reply-To: <m3zkvla3xf.fsf@fleche.redhat.com>


I confirm that the modification to avoid the affectation 'cmdpy_object_type.tp_new = PyType_GenericNew' is not supported by gcc version 3.4.2 (mingw-special) but is now supported by newer compiler (above a 4.3-based, I tried with gcc 4.5.0).

Thank you for the following information:

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

I look at the Python documentation and I check that some standard modules of Python (sqlite) are conformed  to this rule but other don't (bz2, datetime).
I have to rewrite my patch because the affectation should be done before PyType_Ready() and I did it after!

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

I look at the initial list of developer that provides 'python.c' file:
	Vladimir Prus  <vladimir@codesourcery.com>
	Tom Tromey  <tromey@redhat.com>
	Thiago Jung Bauermann  <bauerman@br.ibm.com>
	Doug Evans  <dje@google.com>
I think that you and other maintainers will check my modifications carefully.

> 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?

Instead of embed the libpython.a, gdb look for the libpython2.6.so.1.0. 
I tried to compile with python --enabled-shared support because a user tells me that he have some issue in its environment.

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

I think that this issue occurs in the '_initialize_python' function that executes a simple script to create a couple objects which are used for Python's stdout and stderr.
For instance, it occurs if I set the PYTHONHOME variable to an invalid value.

In order to submit a new corrected patch, should I start a new mail thread or do I continue to use this mail thread?

Regards



  reply	other threads:[~2010-09-17 13:11 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
2010-09-17 14:42         ` Serge CHATROUX [this message]
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=A42F0F6AD104734CAC7D6B1963F60DD80116E3AF5D94@SAFEX1MAIL2.st.com \
    --to=serge.chatroux@st.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.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