From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16503 invoked by alias); 12 Dec 2013 04:23:00 -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 16489 invoked by uid 89); 12 Dec 2013 04:22:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f170.google.com Received: from mail-wi0-f170.google.com (HELO mail-wi0-f170.google.com) (209.85.212.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 12 Dec 2013 04:22:58 +0000 Received: by mail-wi0-f170.google.com with SMTP id hq4so193217wib.1 for ; Wed, 11 Dec 2013 20:22:55 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.80.137 with SMTP id r9mr155429wjx.88.1386822175256; Wed, 11 Dec 2013 20:22:55 -0800 (PST) Received: by 10.194.123.4 with HTTP; Wed, 11 Dec 2013 20:22:55 -0800 (PST) In-Reply-To: <52A8BA3D.9020403@redhat.com> References: <5265022F.8060203@mentor.com> <52654A2C.9010202@redhat.com> <529707C7.4040504@mentor.com> <5298AE7C.6020607@redhat.com> <529C80D2.2080608@mentor.com> <529C9B42.20600@redhat.com> <529D62F7.80701@mentor.com> <52A22582.8040509@redhat.com> <52A40015.207@mentor.com> <52A61E86.3020005@redhat.com> <52A750AA.1080807@redhat.com> <52A75A05.60006@redhat.com> <52A8BA3D.9020403@redhat.com> Date: Thu, 12 Dec 2013 04:23:00 -0000 Message-ID: Subject: Re: [PATCH] Eliminate UNSUPPORTED_ERROR. From: Doug Evans To: Pedro Alves Cc: Hui Zhu , gdb-patches ml Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00461.txt.bz2 On Wed, Dec 11, 2013 at 11:17 AM, Pedro Alves wrote: > On 12/11/2013 04:33 PM, Doug Evans wrote: >>> > - /* Should we fallback to ye olde GDB script mode? */ >>> > - if (script_ext_mode == script_ext_soft >>> > - && e.reason == RETURN_ERROR && e.error == UNSUPPORTED_ERROR) >>> > - { >>> > - fseek (stream, 0, SEEK_SET); >>> > - script_from_file (stream, (char*) file); >>> > - } >>> > - else >>> > - { >>> > - /* Nope, just punt. */ >>> > - throw_exception (e); >>> > - } >>> > + /* Fallback to GDB script mode. */ >>> > + fseek (stream, 0, SEEK_SET); >>> > + script_from_file (stream, (char*) file); >> Remove the fseek and cast. > > Hmm, indeed the fseek doesn't look necessary. Will do. However, > that makes me wonder whether I'm missing something, as it doesn't > look necessary before my patch either. Was it ever really > needed? I think I added it to be extra conservative in case source_python_script happened to read from the file. [I know it normally wouldn't read and then throw an UNSUPPORTED_ERROR, but I'm guessing I didn't want this code to assume that.] Now that we're not even calling source_python_script the need is gone. I see you added it (and the unnecessary cast too ;-) ) in: > https://www.sourceware.org/ml/gdb-patches/2010-04/msg00110.html > but I can't tell why. script_from_file was changed to take a const char *arg the prior week. Presumably I just didn't update that part of the patch.