From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 61807 invoked by alias); 27 Feb 2015 22:47:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 61796 invoked by uid 89); 27 Feb 2015 22:47:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 27 Feb 2015 22:47:07 +0000 Received: from EUSAAHC002.ericsson.se (Unknown_Domain [147.117.188.78]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 34.9B.03307.27F90F45; Fri, 27 Feb 2015 17:46:42 +0100 (CET) Received: from [142.133.110.232] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.80) with Microsoft SMTP Server id 14.3.210.2; Fri, 27 Feb 2015 17:47:04 -0500 Message-ID: <54F0F3E8.6010005@ericsson.com> Date: Fri, 27 Feb 2015 22:47:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH 07/36] Make array object extern References: <1423524046-20605-1-git-send-email-palves@redhat.com> <1423524046-20605-8-git-send-email-palves@redhat.com> In-Reply-To: <1423524046-20605-8-git-send-email-palves@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00841.txt.bz2 On 02/09/2015 06:20 PM, Pedro Alves wrote: > Compiling python.c in C++ mode, we get: >=20 > ...src/gdb/python/python.c: At global scope: > ...src/gdb/python/python.c:106:31: error: storage size of =E2=80=98GdbM= ethods=E2=80=99 isn=E2=80=99t known > static PyMethodDef GdbMethods[]; > ^ >=20 > Fix it by making the affected array objects extern. >=20 > gdb/ChangeLog: > 2015-02-09 Pedro Alves >=20 > * python/python.c (GdbMethods): Rename to ... > (python_GdbMethods): ... this and make extern. > (GdbModuleDef): Rename to ... > (python_GdbModuleDef): ... this and make extern. > --- > gdb/python/python.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/gdb/python/python.c b/gdb/python/python.c > index 9854c79..a13638f 100644 > --- a/gdb/python/python.c > +++ b/gdb/python/python.c > @@ -103,10 +103,10 @@ const struct extension_language_defn extension_lang= uage_python =3D >=20=20 > int gdb_python_initialized; >=20=20 > -static PyMethodDef GdbMethods[]; > +extern PyMethodDef python_GdbMethods[]; >=20=20 > #ifdef IS_PY3K > -static struct PyModuleDef GdbModuleDef; > +extern struct PyModuleDef python_GdbModuleDef; > #endif >=20=20 > PyObject *gdb_module; > @@ -1712,11 +1712,11 @@ message =3D=3D an error message without a stack w= ill be printed."), > PyEval_InitThreads (); >=20=20 > #ifdef IS_PY3K > - gdb_module =3D PyModule_Create (&GdbModuleDef); > + gdb_module =3D PyModule_Create (&python_GdbModuleDef); > /* Add _gdb module to the list of known built-in modules. */ > _PyImport_FixupBuiltin (gdb_module, "_gdb"); > #else > - gdb_module =3D Py_InitModule ("_gdb", GdbMethods); > + gdb_module =3D Py_InitModule ("_gdb", python_GdbMethods); > #endif > if (gdb_module =3D=3D NULL) > goto fail; > @@ -1932,7 +1932,7 @@ gdbpy_initialized (const struct extension_language_= defn *extlang) >=20=20 > #ifdef HAVE_PYTHON >=20=20 > -static PyMethodDef GdbMethods[] =3D > +PyMethodDef python_GdbMethods[] =3D > { > { "history", gdbpy_history, METH_VARARGS, > "Get a value from history" }, > @@ -2044,7 +2044,7 @@ Return a tuple containing all inferiors." }, > }; >=20=20 > #ifdef IS_PY3K > -static struct PyModuleDef GdbModuleDef =3D > +struct PyModuleDef python_GdbModuleDef =3D > { > PyModuleDef_HEAD_INIT, > "_gdb", Hi Pedro, I think you forgot one instance of GdbMethods, used when building with Python 3. This should fix it: =46rom 33c839c7bb4bb201fa20f22e0935831b7e1de27f Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 27 Feb 2015 17:40:36 -0500 Subject: [PATCH] Fix Python 3 build Rename forgotten GdbMethods to python_GdbMethods. gdb/ChangeLog: * python/python.c (python_GdbModuleDef): Rename GdbMethods to python_GdbMethods. --- gdb/python/python.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index a13638f..c3ffbae 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -2050,7 +2050,7 @@ struct PyModuleDef python_GdbModuleDef =3D "_gdb", NULL, -1, - GdbMethods, + python_GdbMethods, NULL, NULL, NULL, --=20 2.1.4