From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109064 invoked by alias); 8 Dec 2016 20:13: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 109028 invoked by uid 89); 8 Dec 2016 20:13:25 -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,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sigframe, o64, O64, toolchains X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Dec 2016 20:13:23 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1cF54D-0006yu-Kb from Luis_Gustavo@mentor.com ; Thu, 08 Dec 2016 12:13:21 -0800 Received: from [172.30.6.208] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Thu, 8 Dec 2016 12:13:18 -0800 Reply-To: Luis Machado Subject: Re: [PATCH v2 2/3] Add FreeBSD/mips architecture. References: <20161206210015.40422-1-jhb@FreeBSD.org> <20161206210015.40422-3-jhb@FreeBSD.org> <7e2fac43-8a37-2883-1e91-1a95a5d767f2@codesourcery.com> <3686876.pSvlj3YOXd@ralph.baldwin.cx> To: John Baldwin , CC: From: Luis Machado Message-ID: Date: Thu, 08 Dec 2016 20:13:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <3686876.pSvlj3YOXd@ralph.baldwin.cx> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00218.txt.bz2 On 12/08/2016 02:08 PM, John Baldwin wrote: > On Thursday, December 08, 2016 12:47:42 PM Luis Machado wrote: >> On 12/06/2016 03:00 PM, John Baldwin wrote: >>> +static void >>> +mips_fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) >>> +{ >>> + enum mips_abi abi = mips_abi (gdbarch); >>> + >>> + /* Generic FreeBSD support. */ >>> + fbsd_init_abi (info, gdbarch); >>> + >>> + set_gdbarch_software_single_step (gdbarch, mips_software_single_step); >>> + >>> + switch (abi) >>> + { >>> + case MIPS_ABI_O32: >>> + tramp_frame_prepend_unwinder (gdbarch, &mips_fbsd_sigframe); >>> + break; >>> + case MIPS_ABI_N32: >>> + break; >>> + case MIPS_ABI_N64: >>> + tramp_frame_prepend_unwinder (gdbarch, &mips64_fbsd_sigframe); >>> + break; >>> + } >>> + >>> + set_gdbarch_iterate_over_regset_sections >>> + (gdbarch, mips_fbsd_iterate_over_regset_sections); >>> + >>> + /* FreeBSD/mips has SVR4-style shared libraries. */ >>> + set_solib_svr4_fetch_link_map_offsets >>> + (gdbarch, (gdbarch_ptr_bit (gdbarch) == 32 ? >>> + mips_fbsd_ilp32_fetch_link_map_offsets : >>> + mips_fbsd_lp64_fetch_link_map_offsets)); >>> +} >>> + >>> + >> >> Do we need to set a reasonable default in case abi is something unknown >> or undefined? Maybe as a fail-safe? > > Default in which sense, for the sigframe unwinder or something else? > I don't think there's any support in any toolchains I'm aware of to > generate FreeBSD binaries with other ABIs (no O64 in particular). > For the sigframe unwinders. I was mostly concerned about the switch construct without a default case for something invalid.