From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 278CC385DC06 for ; Tue, 14 Apr 2020 10:46:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 278CC385DC06 Received: by mail-ed1-x531.google.com with SMTP id e5so16478946edq.5 for ; Tue, 14 Apr 2020 03:46:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kD8yw8/e83LB4lOqFYdYLA3oIX8J9Y2yxNVbzdVJuFc=; b=aHpbk45cp8G5v6DjTySnrop5dAKIMdpvef3fUYoUFy8rbtISgMCSKrcsWMvCJlBQNj bV10bwpQQ87FBO/e4CVqaxaP4rAaPQnby2NVIJ1SdFXZdDbjxLzUHU8W6VEV4NCGifj2 ziIIi4SYXgS52N6YnpQAMaHfzTiFsf62tDTxgE8i/uGwBJoh0s3BfjewKZ8VHmDLzHat W7zLCSybcjSOOZFExnhhvxKWDVZC/wgL/seP0zGvAuXh9Hr3PV999Cs6NN9njsChDYUq WhkqGbCKS514r3LOkuM3QLlJOE1x4m1wV4YXTTJ/FgSmKVqx1LA7DhDYCYpCizZql77U g1Cw== X-Gm-Message-State: AGi0PuYE0Lqz8HAdoAu5tTM0LpfTiMov3cuTZVuDmfehBN0uvZn04BCC 91ezzZT9RwJZbf6gqmyY8nzYO8pKVSAgBPUukACl6bvc X-Google-Smtp-Source: APiQypLr9RyOMc23LUKWvqKIkQq5ryRxCTeBaCeWOkgX66f48bVCf/MLYZzNUPXQBCOjdDC0Ny4xCnmR9ftw6wPfoTQ= X-Received: by 2002:a17:906:a94a:: with SMTP id hh10mr19670244ejb.338.1586861179122; Tue, 14 Apr 2020 03:46:19 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Omer Date: Tue, 14 Apr 2020 13:45:42 +0300 Message-ID: Subject: Re: Specifying target endianness via Remote Serial Protocol To: Luis Machado Cc: gdb@sourceware.org X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 10:46:21 -0000 Will older gdb's really break if we send them fields they don't know? The logical thing to do seems to me to just to discard them. I want to use remote gdb without giving it an elf to work with locally (for example if I want to debug some weird embedded system). I can somewhat circumvent the problem by giving gdb an empty elf with my wanted endianness, but I don't think it's the optimal solution. On Mon, 13 Apr 2020 at 16:04, Luis Machado wrote: > Hi, > > On 4/12/20 9:02 AM, Omer via Gdb wrote: > > Hi, > > > > While writing my own gdb stub, I noticed that there is no way to specify > > what endianness the target is using (I guess the logical place for that > > would be in the target.xml file). > > One can use "set endian" manually to fix that, but when debugging an ARM > > BE8 target, there is no way to specify that the code is little endian > > (currently byte_order_for_code is initialized to little only when > loading a > > BE8 elf). > > Shouldn't there be an additional field for target XML tag to specify > that? > > We could probably extend the XML descriptions to incorporate this, but > we may also have backwards compatibility issues with older GDB's by > returning new fields the target doesn't know how to parse properly. > > The way to fix this, right now, would be to teach GDB about other arch > variations using little endian, so GDB initializes the proper set of > architecture hooks and types. > > What arch variation are you working with? Doesn't the tools generate a > EF_ARM_BE8 flag to let GDB know it needs to assume little endian? >