From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2441 invoked by alias); 3 Oct 2002 00:36:06 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2432 invoked from network); 3 Oct 2002 00:36:05 -0000 Received: from unknown (HELO mail-out1.apple.com) (17.254.0.52) by sources.redhat.com with SMTP; 3 Oct 2002 00:36:05 -0000 Received: from mailgate2.apple.com (A17-129-100-225.apple.com [17.129.100.225]) by mail-out1.apple.com (8.11.3/8.11.3) with ESMTP id g930a4i09562 for ; Wed, 2 Oct 2002 17:36:04 -0700 (PDT) Received: from scv3.apple.com (scv3.apple.com) by mailgate2.apple.com (Content Technologies SMTPRS 4.2.1) with ESMTP id ; Wed, 2 Oct 2002 17:36:04 -0700 Received: from inghji.apple.com (inghji.apple.com [17.201.22.240]) by scv3.apple.com (8.11.3/8.11.3) with ESMTP id g930a4309208; Wed, 2 Oct 2002 17:36:04 -0700 (PDT) Date: Wed, 02 Oct 2002 17:36:00 -0000 Subject: Re: event-loop.c changes Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v543) Cc: gdb@sources.redhat.com To: Elena Zannoni From: Jim Ingham In-Reply-To: <15771.31859.903292.158527@localhost.redhat.com> Message-Id: Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg00026.txt.bz2 Elena, On Wednesday, October 2, 2002, at 04:08 PM, Elena Zannoni wrote: > > Jim, I am looking at some of the changes in event-loop.c (from Keith's > branch). > > I am not sure about a couple of things: > > This comment: > > void > gdb_setup_readline (void) > { > /* This function is a noop for the async case. The assumption is > that > the async setup is ALL done in gdb_init, and we would only mess > it up > here. The async stuff should really go away over time. */ > > if (event_loop_p) > { > [...] > } > } > > You meant 'sync' instead of 'async'? Yup... > > > The creation of these: > gdb_stdout = stdio_fileopen (stdout); > gdb_stderr = stdio_fileopen (stderr); > gdb_stdlog = gdb_stderr; /* for moment */ > gdb_stdtarg = gdb_stderr; /* for moment */ > > Is done in main.c, then again here, in gdb-setup-readline(). > But a comment in gdb_disable_readline suggests that they really > shouldn't be created here at all. > /* FIXME - It is too heavyweight to delete and remake these > every time you run an interpreter that needs readline. > It is probably better to have the interpreters cache these, > which in turn means that this needs to be moved into > interpreter > specific code. */ Theoretically, I think this is true. But when we did some profiling of gdb under PB, this really didn't show up at all, and changing this didn't seem worth the effort. This only happens when you switch interpreters, and that is a pretty heavy-weight operation anyway, so this is in the noise. At the same time I was trying to get the interpreter stuff working, I was also fixing a bunch of bugs in getting a real asynchronous target to work (not just event_loop_p = 1, but with real async execution). One of the big problems was that if anything went the teeniest bit wrong, then the wrong stdio handler would be left in place and though in fact gdb was just stopped waiting for input, it thought it was still talking to the inferior, so it was effectively hung... So I was very suspicious about anything that mucked with the input & outputs to gdb at the time, which was probably why I was so harsh on this... But I got all the async stuff working without having to fix this, so... Jim -- Jim Ingham jingham@apple.com Developer Tools Apple Computer