From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92376 invoked by alias); 9 Mar 2015 15:42:09 -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 92363 invoked by uid 89); 9 Mar 2015 15:42:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 09 Mar 2015 15:42:07 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t29FfNVC032762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 9 Mar 2015 11:41:24 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t29FfL9J029785; Mon, 9 Mar 2015 11:41:22 -0400 Message-ID: <54FDBF21.4090400@redhat.com> Date: Mon, 09 Mar 2015 15:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Andy Wingo , gdb-patches@sourceware.org CC: asmundak@google.com Subject: Re: [PATCH v2] Add Guile frame unwinder interface References: <87oao7wi66.fsf@igalia.com> <87zj7msbly.fsf@igalia.com> In-Reply-To: <87zj7msbly.fsf@igalia.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00222.txt.bz2 On 03/09/2015 10:34 AM, Andy Wingo wrote: > +@var{register} names a register, and should be a string, for example > +@samp{rip}. @var{value} is the register value, as a @value{GDBN} > +value. Alternately, passing @code{#f} as the value will mark the > +register as unavailable. >From a glimpse over the code, I think this actually marks it as "" (optimized out), right? That would be the correct thing to do. Marking a register as "" is also possible, but it is a different thing -- it means the value exists, but gdb couln't get to it, because e.g., the core file is trimmed, or the ptrace interface is missing access to some registers. That said, you may want to consider how you'd expand the API to allow marking registers as unavailable. > +@end deffn > +The first argument should be a object. The second\n\ > +names a register, and should be a string, for example \"rip\". The\n\ > +third argument is the value, as a GDB value. Alternately, passing #f\n\ > +as the value will mark the register as unavailable." }, Likewise. > @@ -99,12 +111,17 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache, > volatile struct gdb_exception ex; > int res = 0; > > + if (is_unwinding) > + internal_error (__FILE__, __LINE__, > + _("Recursion detected while finding an unwinder.")); > old_cleanup = frame_prepare_for_sniffer (this_frame, unwinder); > > + is_unwinding = 1; > TRY_CATCH (ex, RETURN_MASK_ERROR) > { > res = unwinder->sniffer (unwinder, this_frame, this_cache); > } > + is_unwinding = 0; > if (ex.reason < 0 && ex.error == NOT_AVAILABLE_ERROR) > { > /* This usually means that not even the PC is available, > @@ -249,7 +266,8 @@ frame_unwind_got_constant (struct frame_info *frame, int regnum, > } Note that RETURN_MASK_ERROR does not catch all exceptions (notably, a ctrl-c/QUIT passes right through uncaught). > +/* Return nonzero if we are in the process of finding an unwinder for a frame. > + See the comments in get_current_frame(). */ No ()'s. > + > +extern int frame_unwind_is_unwinding (void); Thanks, Pedro Alves