* [PATCH] gdb-cross-canadian: build gdb with python support
@ 2011-12-16 14:05 Eric Bénard
2011-12-21 8:51 ` Eric Bénard
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2011-12-16 14:05 UTC (permalink / raw)
To: openembedded-core; +Cc: fcooper
* python support is needed for providing finer scripting control
in gdb, and for remote controling gdb for example from qtcreator
* gdb/configure tries to autodetect python using python executable
with --includes --ldflags --exec-prefix to get the right flags
As it's difficult to achieve in OE's context, we generate a
script which will return the right values and make gdb's build
system happy. This idea was taken from the following article :
http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
* tested using angstrom & armv7 target & qtcreator 201005 & 2.4.0
Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: fcooper@ti.com
---
meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
index ec0748e..e0e6e30 100644
--- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -4,4 +4,22 @@ DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
BPN = "gdb"
-DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk"
+DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk python-nativesdk"
+RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
+ python-nativesdk-codecs python-nativesdk-netclient"
+
+EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+ --includes) echo "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/" ;;
+ --ldflags) echo "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+ --exec-prefix) echo "/usr" ;;
+ *) exit 1 ;;
+esac
+exit 0
+EOF
+ chmod +x ${WORKDIR}/python
+}
\ No newline at end of file
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2011-12-16 14:05 [PATCH] gdb-cross-canadian: build gdb with python support Eric Bénard
@ 2011-12-21 8:51 ` Eric Bénard
2011-12-21 22:12 ` Zhang, Jessica
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2011-12-21 8:51 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Le 16/12/2011 15:05, Eric Bénard a écrit :
> * python support is needed for providing finer scripting control
> in gdb, and for remote controling gdb for example from qtcreator
> * gdb/configure tries to autodetect python using python executable
> with --includes --ldflags --exec-prefix to get the right flags
> As it's difficult to achieve in OE's context, we generate a
> script which will return the right values and make gdb's build
> system happy. This idea was taken from the following article :
> http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> * tested using angstrom& armv7 target& qtcreator 201005& 2.4.0
>
> Signed-off-by: Eric Bénard<eric@eukrea.com>
> Cc: fcooper@ti.com
> ---
> meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 20 +++++++++++++++++++-
> 1 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> index ec0748e..e0e6e30 100644
> --- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> @@ -4,4 +4,22 @@ DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
> PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> BPN = "gdb"
>
> -DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk"
> +DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk python-nativesdk"
> +RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
> + python-nativesdk-codecs python-nativesdk-netclient"
> +
> +EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
> +
> +do_configure_prepend() {
> +cat> ${WORKDIR}/python<< EOF
> +#! /bin/sh
> +case "\$2" in
> + --includes) echo "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/" ;;
> + --ldflags) echo "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> + --exec-prefix) echo "/usr" ;;
> + *) exit 1 ;;
> +esac
> +exit 0
> +EOF
> + chmod +x ${WORKDIR}/python
> +}
> \ No newline at end of file
any comment concerning this patch ?
Thanks
Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2011-12-21 8:51 ` Eric Bénard
@ 2011-12-21 22:12 ` Zhang, Jessica
2011-12-21 23:08 ` Eric Bénard
0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Jessica @ 2011-12-21 22:12 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Hi Eric,
Can you submit the patch against qt layer or meta-oe instead of oe-core, since python enabled gdb shouldn't be turned on by default in oe-core based on its usage, qtcreator, etc.
Thanks,
Jessica
-----Original Message-----
From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Eric Bénard
Sent: Wednesday, December 21, 2011 12:51 AM
To: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH] gdb-cross-canadian: build gdb with python support
Le 16/12/2011 15:05, Eric Bénard a écrit :
> * python support is needed for providing finer scripting control
> in gdb, and for remote controling gdb for example from qtcreator
> * gdb/configure tries to autodetect python using python executable
> with --includes --ldflags --exec-prefix to get the right flags
> As it's difficult to achieve in OE's context, we generate a
> script which will return the right values and make gdb's build
> system happy. This idea was taken from the following article :
> http://www.mentby.com/doug-evans-2/python-enabled-gdb-on-windows-and-relocation.html
> * tested using angstrom& armv7 target& qtcreator 201005& 2.4.0
>
> Signed-off-by: Eric Bénard<eric@eukrea.com>
> Cc: fcooper@ti.com
> ---
> meta/recipes-devtools/gdb/gdb-cross-canadian.inc | 20 +++++++++++++++++++-
> 1 files changed, 19 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> index ec0748e..e0e6e30 100644
> --- a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> +++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
> @@ -4,4 +4,22 @@ DESCRIPTION = "cross-canadian gdb for ${TARGET_ARCH} target - GNU debugger"
> PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
> BPN = "gdb"
>
> -DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk"
> +DEPENDS = "ncurses-nativesdk expat-nativesdk gettext-nativesdk readline-nativesdk python-nativesdk"
> +RDEPENDS += "python-nativesdk-core python-nativesdk-lang python-nativesdk-re \
> + python-nativesdk-codecs python-nativesdk-netclient"
> +
> +EXTRA_OECONF_append = "--with-python=${WORKDIR}/python"
> +
> +do_configure_prepend() {
> +cat> ${WORKDIR}/python<< EOF
> +#! /bin/sh
> +case "\$2" in
> + --includes) echo "-I${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${exec_prefix}/include/python${PYTHON_BASEVERSION}/" ;;
> + --ldflags) echo "-L${STAGING_DIR}/${HOST_ARCH}-nativesdk${HOST_VENDOR}-${HOST_OS}${libdir}/python${PYTHON_BASEVERSION}/config/config -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
> + --exec-prefix) echo "/usr" ;;
> + *) exit 1 ;;
> +esac
> +exit 0
> +EOF
> + chmod +x ${WORKDIR}/python
> +}
> \ No newline at end of file
any comment concerning this patch ?
Thanks
Eric
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2011-12-21 22:12 ` Zhang, Jessica
@ 2011-12-21 23:08 ` Eric Bénard
2011-12-21 23:52 ` Zhang, Jessica
0 siblings, 1 reply; 7+ messages in thread
From: Eric Bénard @ 2011-12-21 23:08 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Hi Jessica,
Le 21/12/2011 23:12, Zhang, Jessica a écrit :
> Can you submit the patch against qt layer or meta-oe instead of oe-core, since python enabled gdb shouldn't be turned on by default in oe-core based on its usage, qtcreator, etc.
>
I can submit that to meta-oe (as qt is inside oe-core) but having a gdb with
python can
also make sense in oe-core as this is not dedicated to qtcreator but gives
very good scripting capabilities to debug with gdb :
http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Python
Eric
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2011-12-21 23:08 ` Eric Bénard
@ 2011-12-21 23:52 ` Zhang, Jessica
2012-01-04 17:28 ` Khem Raj
0 siblings, 1 reply; 7+ messages in thread
From: Zhang, Jessica @ 2011-12-21 23:52 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Hi Eric,
Yes, understand the usage and advantage, but still think apply the patch in meta-oe first then if later on there's strong demand for this feature we can pull into oe-core is the right approach.
Thanks,
Jessica
-----Original Message-----
From: openembedded-core-bounces@lists.openembedded.org [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of Eric Bénard
Sent: Wednesday, December 21, 2011 3:08 PM
To: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH] gdb-cross-canadian: build gdb with python support
Hi Jessica,
Le 21/12/2011 23:12, Zhang, Jessica a écrit :
> Can you submit the patch against qt layer or meta-oe instead of oe-core, since python enabled gdb shouldn't be turned on by default in oe-core based on its usage, qtcreator, etc.
>
I can submit that to meta-oe (as qt is inside oe-core) but having a gdb with
python can
also make sense in oe-core as this is not dedicated to qtcreator but gives
very good scripting capabilities to debug with gdb :
http://sourceware.org/gdb/current/onlinedocs/gdb/Python.html#Python
Eric
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2011-12-21 23:52 ` Zhang, Jessica
@ 2012-01-04 17:28 ` Khem Raj
2012-01-05 16:34 ` Richard Purdie
0 siblings, 1 reply; 7+ messages in thread
From: Khem Raj @ 2012-01-04 17:28 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On (21/12/11 23:52), Zhang, Jessica wrote:
> Hi Eric,
>
> Yes, understand the usage and advantage, but still think apply the patch in meta-oe first then if later on there's strong demand for this feature we can pull into oe-core is the right approach.
>
what are your reasons for it to not be in oe-core/master ?
python support is useful in gdb even on commandline
Or are you aware of any bugs that will destabilize gdb ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gdb-cross-canadian: build gdb with python support
2012-01-04 17:28 ` Khem Raj
@ 2012-01-05 16:34 ` Richard Purdie
0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2012-01-05 16:34 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, 2012-01-04 at 09:28 -0800, Khem Raj wrote:
> On (21/12/11 23:52), Zhang, Jessica wrote:
> > Hi Eric,
> >
> > Yes, understand the usage and advantage, but still think apply the patch in meta-oe first then if later on there's strong demand for this feature we can pull into oe-core is the right approach.
> >
>
> what are your reasons for it to not be in oe-core/master ?
> python support is useful in gdb even on commandline
> Or are you aware of any bugs that will destabilize gdb ?
I think there are going to be two groups of people on this, the people
who want it and the people who don't. How about a PACKAGECONFIG option
for this?
I suspect over time the request will come in for gdb itself too which is
why I'm thinking ahead to that...
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-05 16:42 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 14:05 [PATCH] gdb-cross-canadian: build gdb with python support Eric Bénard
2011-12-21 8:51 ` Eric Bénard
2011-12-21 22:12 ` Zhang, Jessica
2011-12-21 23:08 ` Eric Bénard
2011-12-21 23:52 ` Zhang, Jessica
2012-01-04 17:28 ` Khem Raj
2012-01-05 16:34 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox