From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34864 invoked by alias); 24 Mar 2018 19:32:28 -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 34426 invoked by uid 89); 24 Mar 2018 19:32:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*u:6.1, H*UA:6.1, HContent-Transfer-Encoding:8bit, day X-HELO: userp2120.oracle.com Received: from userp2120.oracle.com (HELO userp2120.oracle.com) (156.151.31.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Mar 2018 19:32:26 +0000 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2OJGSfq195183; Sat, 24 Mar 2018 19:32:15 GMT Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2gwvph80j1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 19:32:15 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2OJWEeh024114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 24 Mar 2018 19:32:14 GMT Received: from ubhmp0002.oracle.com (ubhmp0002.oracle.com [156.151.24.55]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w2OJWEIU028239; Sat, 24 Mar 2018 19:32:14 GMT Received: from [172.27.35.125] (/108.88.88.153) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 24 Mar 2018 19:32:14 +0000 Subject: Re: [PATCH 3 PR gdb/16959] gdb hangs in infinite recursion To: Simon Marchi Cc: Pedro Alves , gdb-patches@sourceware.org References: <1521840352-75024-1-git-send-email-weimin.pan@oracle.com> <58d0f0759e471fb7862da336ba18bde6@polymtl.ca> <71719916-38d0-dd84-e79c-0e9d24dda5aa@oracle.com> <1571cea710a01e250774e10b211672e6@polymtl.ca> From: Wei-min Pan Message-ID: <1fdfd913-55d2-121a-6228-8e99e3ed4619@oracle.com> Date: Sat, 24 Mar 2018 19:32:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1571cea710a01e250774e10b211672e6@polymtl.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8841 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=933 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803240225 X-SW-Source: 2018-03/txt/msg00490.txt.bz2 On 3/24/2018 12:23 PM, Simon Marchi wrote: > On 2018-03-24 14:54, Wei-min Pan wrote: >> Please note the check_typedef() call (now redundant and removed) >> before calling cp_print_value_fields(). >> So passing the resolved type is correct. > > I think it's better if functions don't assume too much what other > functions need (original type vs real type). cp_print_value_fields may > not require the real type today, but maybe that will change one day, > and that call will have to be changed (if we even notice it).  So in > that sense, it's better to always pass down the original type and let > functions get the real type for their own use if they need it. > > Simon The original code is like: -      type = check_typedef (type); -      cp_print_value_fields (type, value_enclosing_type (val), So it's passing the real type. Do you think that we still need to pass the original type? Weimin