From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9333 invoked by alias); 29 May 2014 09:00:52 -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 9320 invoked by uid 89); 29 May 2014 09:00:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS 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 ESMTP; Thu, 29 May 2014 09:00:50 +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 s4T90kFG024423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 May 2014 05:00:47 -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 s4T90ja8016547; Thu, 29 May 2014 05:00:46 -0400 Message-ID: <5386F73C.8000102@redhat.com> Date: Thu, 29 May 2014 09:00:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Andrew Burgess , gdb-patches@sourceware.org Subject: Re: [PATCH v3 3/4] Deprecate frame_stop_reason_string. References: <533EC5B7.6080600@broadcom.com> <1398855344-25278-1-git-send-email-aburgess@broadcom.com> <1398855344-25278-4-git-send-email-aburgess@broadcom.com> <53861C53.5060402@redhat.com> <538670AE.3050305@broadcom.com> In-Reply-To: <538670AE.3050305@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-05/txt/msg00719.txt.bz2 On 05/29/2014 12:26 AM, Andrew Burgess wrote: > On 28/05/2014 6:26 PM, Pedro Alves wrote: >> On 04/30/2014 11:55 AM, Andrew Burgess wrote: >> IMO, the real problem with its signature is the "frame_" in its name. >> The function converts an 'enum unwind_stop_reason' value to a string, >> so like other similar cases in the tree, how about renaming the function >> to match? E.g.: >> >> -const char *frame_stop_reason_string (enum unwind_stop_reason); >> +const char *unwind_stop_reason_to_string (enum unwind_stop_reason); > > I've gone with this suggestion, updated patch below. Is this OK to apply? Not yet, sorry. > * frame.c (frame_stop_reason_string): Rename to ... > (unwind_frame_stop_reason_string): this. This still has "frame" in the name, and misses the "to". Any reason for that? The specific suggestion had a logic -- convert "enum unwind_stop_reason" to "string" -> "unwind_stop_reason_to_string". That is just like target_waitstatus_to_string and target_xfer_status_to_string, for example. Without even looking at the function's declaration, I can tell that is converting the enum value. While "unwind_frame_stop_reason_string" without the "to" doesn't give me that impression, and is very much confusable with the new frame_stop_reason_string. > * frame.h (frame_stop_reason_string): Rename to ... > (unwind_frame_stop_reason_string): this. > * stack.c (frame_info): Update call to frame_stop_reason_string. > (backtrace_command_1): Likewise. > * guile/scm-frame.c (gdbscm_unwind_stop_reason_string): Likewise. > * python/py-frame.c (gdbpy_frame_stop_reason_string): Likewise. ... > diff --git a/gdb/frame.h b/gdb/frame.h > index ad03a0b..5acb2a2 100644 > --- a/gdb/frame.h > +++ b/gdb/frame.h > @@ -501,9 +501,11 @@ enum unwind_stop_reason > > enum unwind_stop_reason get_frame_unwind_stop_reason (struct frame_info *); > > -/* Translate a reason code to an informative string. */ > +/* Translate a reason code to an informative string. This returns a > + general string describing the stop reason, for a possibly frame > + specific reason string, use frame_stop_reason_string. */ Please remove this comment hunk from this patch, so that the patch remains independent, and so that it can go in immediately even if further discuss patch #4. -- Pedro Alves