From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2999 invoked by alias); 4 Mar 2009 15:02:09 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 2817 invoked by uid 22791); 4 Mar 2009 15:02:08 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Wed, 04 Mar 2009 15:02:00 -0000 From: Jan Kratochvil To: archer@sourceware.org Subject: [python] [commit] Fix crashes on missing `lib*/pythonX.Y/encodings/' Message-ID: <20090304150146.GA9361@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-SW-Source: 2009-q1/txt/msg00326.txt.bz2 commit b2d8ee40deb869373afc86c870c85aa720870072 Due to bugs in rpm wrt arch-specific dependencies one can get python-libs without python rpm installed. Thus `/usr/lib64/python2.5/encodings' may be missing. gdb/ Fix python crashes on missing `lib*/pythonX.Y/encodings/'. * python/python-frame.c (frapy_read_var): Return on NULL VAR_NAME. * python/python-value.c (valpy_binop): Use `break' to exit from the TRY_CATCH block. Do not call value_to_value_object on NULL RES_VAL. --- gdb/python/python-frame.c | 2 ++ gdb/python/python-value.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gdb/python/python-frame.c b/gdb/python/python-frame.c index c98dc39..c257ac3 100644 --- a/gdb/python/python-frame.c +++ b/gdb/python/python-frame.c @@ -418,6 +418,8 @@ frapy_read_var (PyObject *self, PyObject *args) volatile struct gdb_exception except; var_name = python_string_to_target_string (sym_obj); + if (!var_name) + return NULL; cleanup = make_cleanup (xfree, var_name); TRY_CATCH (except, RETURN_MASK_ALL) diff --git a/gdb/python/python-value.c b/gdb/python/python-value.c index de54b9d..2507fcd 100644 --- a/gdb/python/python-value.c +++ b/gdb/python/python-value.c @@ -349,11 +349,11 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other) a gdb.Value object and need to convert it from python as well. */ arg1 = convert_value_from_python (self); if (arg1 == NULL) - return NULL; + break; arg2 = convert_value_from_python (other); if (arg2 == NULL) - return NULL; + break; switch (opcode) { @@ -430,7 +430,7 @@ valpy_binop (enum valpy_opcode opcode, PyObject *self, PyObject *other) } GDB_PY_HANDLE_EXCEPTION (except); - return value_to_value_object (res_val); + return res_val ? value_to_value_object (res_val) : NULL; } static PyObject * -- 1.6.0.6