From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3575 invoked by alias); 25 May 2012 09:56:44 -0000 Received: (qmail 3563 invoked by uid 22791); 25 May 2012 09:56:44 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 May 2012 09:56:21 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SXrFt-00024I-2f from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Fri, 25 May 2012 02:56:21 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 25 May 2012 02:55:59 -0700 Received: from localhost.localdomain (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Fri, 25 May 2012 02:56:20 -0700 From: Yao Qi To: Subject: [PATCH 2/3] Don't force interpreter sync mode in execute_gdb_command. Date: Fri, 25 May 2012 09:56:00 -0000 Message-ID: <1337939766-1579-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1337939766-1579-1-git-send-email-yao@codesourcery.com> References: <1337939766-1579-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes 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 X-SW-Source: 2012-05/txt/msg00965.txt.bz2 This patch is to fix the internal error reported in PR14135 FAIL: gdb.python/py-finish-breakpoint.exp: check MyFinishBreakpoint hit (GDB internal error) This internal error is caused by GDB fetches inferior event recursively (fetch_inferior_event -> bpstat_check_breakpoint_conditions -> gdbpy_should_stop -> execute_gdb_command -> fetch_inferior_event), and you can see backtrace in details in comment#2 in PR14135. It is caused by forcing interpreter to sync mode by this patch Flip the interpreter to synchronously wait for commands finishing, in command lists and similars http://sourceware.org/ml/gdb-patches/2011-09/msg00037.html This patch is correct, but I think we don't have to force interpreter into sync in execute_gdb_command. execute_gdb_command is called from two paths, 1. python_command. When we type 'python gdb.execute ("foo")", it goes in path, since interpreter_async has been set to zero in this path, we don't have to set it again in execute_gdb_command. 2. gdbpy_should_stop. When we write python script to do "gdb.execute ("foo")" in gdb.Breakpoint::Stop () method, async mode of interpreter doesn't matter. Because the commands people can use here are restricted to not "alter execute state of inferior", so it should be to issue second command when the first one is not finished. Noe that this patch doesn't fix all the fails in PR14135. gdb: 2012-05-24 Yao Qi PR 14135. * python/python.c (execute_gdb_command): Don't force the interpreter to sync mode. --- gdb/python/python.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/gdb/python/python.c b/gdb/python/python.c index 19eb7b5..2d2ed3a 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -441,9 +441,6 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) char *copy = xstrdup (arg); struct cleanup *cleanup = make_cleanup (xfree, copy); - make_cleanup_restore_integer (&interpreter_async); - interpreter_async = 0; - prevent_dont_repeat (); if (to_string) result = execute_command_to_string (copy, from_tty); -- 1.7.0.4