From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5097 invoked by alias); 15 May 2013 18:08:15 -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 5084 invoked by uid 89); 15 May 2013 18:08:15 -0000 X-Spam-SWARE-Status: No, score=-4.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 15 May 2013 18:08:14 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Ucg7Y-0002SX-N5 from Luis_Gustavo@mentor.com ; Wed, 15 May 2013 11:08:12 -0700 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 15 May 2013 11:07:33 -0700 Received: from [172.30.8.147] ([172.30.8.147]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 15 May 2013 11:07:33 -0700 Message-ID: <5193CEE3.4040506@codesourcery.com> Date: Wed, 15 May 2013 18:08:00 -0000 From: Luis Machado Reply-To: lgustavo@codesourcery.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: Mike Frysinger CC: "'gdb-patches@sourceware.org'" Subject: Re: [RFC, gdbserver] Avoid defining linux_read_offsets when the target does not need it References: <519370AE.50908@codesourcery.com> <201305151206.57607.vapier@gentoo.org> <5193B71E.30402@codesourcery.com> <201305151312.46470.vapier@gentoo.org> In-Reply-To: <201305151312.46470.vapier@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-05/txt/msg00554.txt.bz2 On 05/15/2013 07:12 PM, Mike Frysinger wrote: > On Wednesday 15 May 2013 12:26:06 Luis Machado wrote: >> On 05/15/2013 06:06 PM, Mike Frysinger wrote: >>> On Wednesday 15 May 2013 07:25:34 Luis Machado wrote: >>>> uClibc-based targets can load their programs in an offset in memory, and >>>> this information has historically been communicated to gdbserver via >>>> ptrace with the following options: PT_TEXT_ADDR, PT_DATA_ADDR and >>>> PT_TEXT_END_ADDR. >>> >>> well, not to be pedantic, but this is for FLAT programs, not uClibc >> >> Ok. uClibc has been used here due to its gdbserver-specific #if guard >> explicitly checking for UCLIBC and mmu-lessness. > > because no other C lib supports FLAT currently :) Ah, that explains it. :-) >>>> We have a target that uses loadmaps as opposed to the above mechanism. >>>> It is just another ptrace request, but it doesn't use linux_read_offsets >>>> at all. >>> >>> you mean FDPIC ? gdb already supports that and uses a different set of >>> ptrace requests for that. ideally, gdb nor gdbserver should not be tied >>> to a specific file format (what format it happened to be compiled for). >>> instead, gdbserver should support all formats and then gdb detects the >>> format and changes its requests based on that. >> >> Not FDPIC, but DSBT. I agree gdb/gdbserver should be format-agnostic, >> but it grew like this. Let's not extend the uglyness though. > > i thought someone already committed support for DSBT, and i helped merge some > of the FDPIC differences. it was for the c6x port iirc. That is correct, but there are a few differences in the loadmap format between targets. My idea is to clean that up and make it more generic without having to use #if blocks inside linux-low.c. Luis