From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6974 invoked by alias); 25 Jan 2017 18:27:58 -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 6953 invoked by uid 89); 25 Jan 2017 18:27:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1758 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; Wed, 25 Jan 2017 18:27:56 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2D763D952; Wed, 25 Jan 2017 18:27:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0PIRqT2030673; Wed, 25 Jan 2017 13:27:53 -0500 Subject: Re: [PATCH v2 5/5] Eliminate make_cleanup_ui_file_delete / make ui_file a class hierarchy To: Simon Marchi References: <1484617147-2506-1-git-send-email-palves@redhat.com> <1484617147-2506-6-git-send-email-palves@redhat.com> <5533317a1fdb2e5f36e64731aef84993@polymtl.ca> <4a6cce94-1533-36e9-6015-330e2e014a98@redhat.com> <558e1e55-23eb-716e-8117-c18d7bded7b8@redhat.com> <79c06dbccef0c33309d208316be207f4@polymtl.ca> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <444a7dc6-8af1-8471-db49-596ffe4bd2a9@redhat.com> Date: Wed, 25 Jan 2017 18:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <79c06dbccef0c33309d208316be207f4@polymtl.ca> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-01/txt/msg00548.txt.bz2 On 01/24/2017 06:29 PM, Simon Marchi wrote: > >> diff --git a/gdb/guile/scm-disasm.c b/gdb/guile/scm-disasm.c >> index d06c481..bf3c424 100644 >> --- a/gdb/guile/scm-disasm.c >> +++ b/gdb/guile/scm-disasm.c >> @@ -162,7 +162,7 @@ gdbscm_disasm_print_address (bfd_vma addr, struct >> disassemble_info *info) >> static int >> gdbscm_print_insn_from_port (struct gdbarch *gdbarch, >> SCM port, ULONGEST offset, CORE_ADDR memaddr, >> - struct ui_file *stream, int *branch_delay_insns) >> + string_file *stream, int *branch_delay_insns) > > Reference instead of pointer? I don't really mind, it's just that > you've used references in other places (e.g. the compile code) when > changing a ui_file pointer to a more specific type. I failed to notice this comment, sorry. Yeah, I think I had changed most places, but there will be places I didn't, mainly to avoid growing the patch too much with not-that-useful churn. Here, we have: static int gdbscm_print_insn_from_port (struct gdbarch *gdbarch, SCM port, ULONGEST offset, CORE_ADDR memaddr, string_file *stream, int *branch_delay_insns) { struct disassemble_info di; int length; struct gdbscm_disasm_data data; di = gdb_disassemble_info (gdbarch, stream); and the only use of "stream" in the function is passing the pointer to gdb_disassemble_info, so I left it be. grepping the diff for "string_file \*", I get: + string_file *stream, int *branch_delay_insns) +string_file * + return (string_file *) m_streams.back (); + string_file *mi_stream = main_stream (); + struct string_file *stream = new string_file (); + string_file *main_stream (); Looks like it may have been the only place. Thanks, Pedro Alves