From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15328 invoked by alias); 7 Oct 2016 17:38:36 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 15300 invoked by uid 89); 7 Oct 2016 17:38:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=H*r:sk:gdb@sou, Tim, H*F:U*tim X-HELO: mail-io0-f177.google.com Received: from mail-io0-f177.google.com (HELO mail-io0-f177.google.com) (209.85.223.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Oct 2016 17:38:25 +0000 Received: by mail-io0-f177.google.com with SMTP id q192so54349131iod.0 for ; Fri, 07 Oct 2016 10:38:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=dY0NYej4uXjHFbBgAHNtmLIWsb13GbFvJeOlyNzrmaU=; b=RsIYiVRkMPCMk23o9faBqISqn5LsmWU8fZVS6s0+2m2ZLVfkN5qNhafKBNfTBrFAst vD7IUhVGYysPJlUzhgXUGN6NUBdIy5xVh3Q6pUMbYducyEA/0pmeqG0cI+zXnN5AplXd fwpR9EkYDX2A5e2CB9fBSsxhX3pfCHbLophVG8kIFtXOl2FCcB1mXugaFbT6IimE3ruJ 58Hl+YNZ9oZ4wRYGbOQYUg0wsTjjaDwKAOPimM9MBdNwjPzZEICruhArgLKjaII6K2A8 cFjbHC+RU/FbX9fMayeU/1s+/+aQWHofdH0xDWZRbbnWn6hh9dLEhTe9lAXzlAPpBRvg ksnw== X-Gm-Message-State: AA6/9RkrfGg8GjI163Aavpw7IN1XmdfkxDfNWBXdk5FeCbMukIw8+ZF1xchXZCC8cZq8J2wQCHgWxmxCjsPpJQ== X-Received: by 10.107.180.214 with SMTP id d205mr23844852iof.203.1475861904087; Fri, 07 Oct 2016 10:38:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.17.41 with HTTP; Fri, 7 Oct 2016 10:38:23 -0700 (PDT) From: Tim Newsome Date: Fri, 07 Oct 2016 17:38:00 -0000 Message-ID: Subject: can target code change architecture setting? To: gdb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00011.txt.bz2 I=E2=80=99m working with riscv gdb support. One problem people occasionally run into is that riscv has both 32- and 64-bit variants. The current gdb code just assumes 64-bit by default (unless a file is specified, and then it gets the info from the ELF info). If such a gdb connects to a 32-bit target, bulk register reads end up wonky, and writes send too much data which confuses OpenOCD. Currently the user needs to do something like set arch riscv:rv32 to work around this. Is it possible for riscv-tdep.c to have some kind of callback function that is called when gdb connects to a server, and for that function to change the register width? If so, gdb could read the riscv misa (instruction set architecture information) register and transparently reconfigure. I looked, but I didn=E2=80=99t see any obvious callbacks that get called wh= en connecting to a target. Thank you, Tim