From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12443 invoked by alias); 20 Jul 2011 18:22:38 -0000 Received: (qmail 12431 invoked by uid 22791); 20 Jul 2011 18:22:37 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 20 Jul 2011 18:22:22 +0000 Received: from wpaz17.hot.corp.google.com (wpaz17.hot.corp.google.com [172.24.198.81]) by smtp-out.google.com with ESMTP id p6KIMKVF029605 for ; Wed, 20 Jul 2011 11:22:20 -0700 Received: from yxt3 (yxt3.prod.google.com [10.190.5.195]) by wpaz17.hot.corp.google.com with ESMTP id p6KILu0P017130 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Wed, 20 Jul 2011 11:22:19 -0700 Received: by yxt3 with SMTP id 3so273512yxt.4 for ; Wed, 20 Jul 2011 11:22:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.53.11 with SMTP id b11mr8230521ana.134.1311186138741; Wed, 20 Jul 2011 11:22:18 -0700 (PDT) Received: by 10.101.1.6 with HTTP; Wed, 20 Jul 2011 11:22:18 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 Jul 2011 18:46:00 -0000 Message-ID: Subject: Re: [Patch] More responsive QUITs From: Sterling Augustine To: Tom Tromey Cc: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary=001485f624a808be0804a88450b4 X-System-Of-Record: true 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: 2011-07/txt/msg00558.txt.bz2 --001485f624a808be0804a88450b4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2921 On Fri, Jul 15, 2011 at 1:46 PM, Tom Tromey wrote: >>>>>> "Sterling" =3D=3D Sterling Augustine writes: > > Sterling> Enclosed is a patch that adds calls to QUIT in various places w= hich > Sterling> makes GDB more responsive to CTRL-C. In particular, reading a s= ymbol > Sterling> file at start up can now be interrupted (although perhaps still= not as > Sterling> responsive as one might like), as well as various other long ru= nning > Sterling> operations. I know at least two GDB developers have one or anot= her of > Sterling> these on their TODO lists. > > Yeah, I'm one of those. > > Sterling> All three of these calls to QUIT have relatively close cleanup > Sterling> handlers: > [...] > > I agree these are safe as to their immediate surrounds; but the problem > is what happens later on. =A0That is, I think a quit when building > psymtabs will just leave the remaining psymtabs unread. =A0This will > greatly interfere with debugging. In my tests with the original patch, interrupting the startup symbol-file read leaves it unavailable, and therefore needing to be manually read or some such. That seemed reasonable to me. (But this feature leaks memory, and so I'm withdrawing that part. See below.) But interrupting any other time in the new locations doesn't leave things undebuggable in any way that I can see. Every operation that wasn't completed is retried on demand, and seems to work as far as I can tell. I'm happy to try tests other than poking around in some of my large files (where this is a real issue), if you have any suggestions. > We have lazy psymtab reading now. =A0So, it is tempting to try to record > where the processing was stopped and then restart it there. =A0However, > this may be difficult to do without leaking memory, due to the use of > obstacks. =A0Perhaps some leakage would be ok, though; or maybe by making > the granularity a single psymtab it would be possible not to leak at all > (not sure). I think that is already done. The new QUIT is guarded by "ps->readin", so you effectively restart where you left off. In any event, if I interrupt a long-process at one of the new quit points inside dwarf2read.c, then restart it and let it run to completion, GDB consumes slightly more memory than if I just start it and let it run to completion the first time. So the original patch leaks memory. However, without the QUITs inside dwarf2read.c, but leave the new one in map_symbol_filenames_psymtab then the leaks go away. This still solves my original tab-completion quitting problem, and I can still debug. This does remove the ability to break out of the initial symbol-file read, which would have been a nice feature, but sounds like one to defer to another day. Updated patch enclosed. Sterling 2011-07-20 Sterling Augustine * psymtab.c (map_symbol_filenames_psymtab): Call QUIT. --001485f624a808be0804a88450b4 Content-Type: text/x-patch; charset=US-ASCII; name="quit.diff" Content-Disposition: attachment; filename="quit.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gqcmbuvr0 Content-length: 590 SW5kZXg6IHBzeW10YWIuYwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBm aWxlOiAvY3ZzL3NyYy9zcmMvZ2RiL3BzeW10YWIuYyx2CnJldHJpZXZpbmcg cmV2aXNpb24gMS4zMApkaWZmIC1kIC11IC1yMS4zMCBwc3ltdGFiLmMKLS0t IHBzeW10YWIuYwkxMCBKdW4gMjAxMSAyMTo0ODowNCAtMDAwMAkxLjMwCisr KyBwc3ltdGFiLmMJMjAgSnVsIDIwMTEgMTg6MTg6MTAgLTAwMDAKQEAgLTEw OTMsNiArMTA5Myw3IEBACiAgICAgICBpZiAocHMtPnJlYWRpbikKIAljb250 aW51ZTsKIAorICAgICAgUVVJVDsKICAgICAgIGZ1bGxuYW1lID0gcHN5bXRh Yl90b19mdWxsbmFtZSAocHMpOwogICAgICAgKCpmdW4pIChwcy0+ZmlsZW5h bWUsIGZ1bGxuYW1lLCBkYXRhKTsKICAgICB9Cg== --001485f624a808be0804a88450b4--