From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107046 invoked by alias); 9 May 2018 16:33:32 -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 107018 invoked by uid 89); 9 May 2018 16:33:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-yb0-f169.google.com Received: from mail-yb0-f169.google.com (HELO mail-yb0-f169.google.com) (209.85.213.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 May 2018 16:33:29 +0000 Received: by mail-yb0-f169.google.com with SMTP id i13-v6so12543402ybl.4 for ; Wed, 09 May 2018 09:33:29 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GjhpYPTWnTJ1cqzecZ8Xkog+/qJ2G6Xdmh47M8YX6EY=; b=a0AUOE8r1O/fxFy9M31Xc1THo2ePyZnrRVvkB9QfwvSYzBtzGynqNqHWWfF6+SVpdq yw36ed9BkZ5sPYNgc+r9nwGXyu0tsgMTr1/eDlzm9LtpTfH0onQxx5y3czlFyIbSigWC 9IargzUgGA4lkxnhePhaSUEPJvDNkxFohJgL+F+LlZGiBhgimOCtywbZo1tF7jNddxr4 /3kGy/hxktA82r7v5ThyztpA/hh4gqoMfycGsZRix+2ln5kN9UrJg/blEoaYuH0UFGHn /ShUKYVIou3mF17NX3h0jS0WTWOr2N21JDB58wJ/MKrkyk/ooEhj0p4LEWdcy4e29+Il sbZA== X-Gm-Message-State: ALKqPwd81N9Z1ZptDHlDViV9/HUDpeQY+JmfZbyHMNP5ICbZQtU2UMBC 5SKq9SuHxf+WmeWrYudpTxpi4F1gF73aDrzVFuM= X-Google-Smtp-Source: AB8JxZrP7I7V+lDlNfTqQ7rb9FdWtfKKpea+J3g4rWNG48YJebkXCKwEwQbcsiuJalpY2kncjuHxnlEVd43343k0q0Q= X-Received: by 2002:a25:8052:: with SMTP id a18-v6mr5467748ybn.523.1525883608021; Wed, 09 May 2018 09:33:28 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:3752:0:0:0:0:0 with HTTP; Wed, 9 May 2018 09:33:27 -0700 (PDT) In-Reply-To: <40e66129-0691-2519-00ac-0bc7009c06b6@redhat.com> References: <20180507171121.7746-1-jcmvbkbc@gmail.com> <40e66129-0691-2519-00ac-0bc7009c06b6@redhat.com> From: Max Filippov Date: Wed, 09 May 2018 16:33:00 -0000 Message-ID: Subject: Re: [PATCH v2] gdb: xtensa: handle privileged registers To: Pedro Alves Cc: gdb-patches@sourceware.org, Woody LaRue Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00207.txt.bz2 On Wed, May 9, 2018 at 7:43 AM, Pedro Alves wrote: > Thanks for the updated patch with the rationale in the > commit log. That helps. > > On 05/07/2018 06:11 PM, Max Filippov wrote: >> xtensa GDB may be used with both bare-metal and linux-based >> applications. In case of bare-metal application gdbserver is able to >> provide information about all CPU registers: both unprivileged and >> privileged. In case of linux-based application only a small subset of >> privileged state is available. Currently xtensa GDB only expects >> unprivileged registers in 'g' packets and it fails to communicate with >> server that sends both privileged and unprivileged registers. >> >> Allow bare-metal xtensa GDB to deal with both privileged and >> unprivileged registers by initializing tdep->num_regs with the total >> number of target CPU registers. Keep linux-based xtensa GDB >> functionality as is by copying tdep->num_nopriv_regs to tdep->num_regs. >> >> gdb/ >> 2018-05-07 Max Filippov >> >> * xtensa-linux-tdep.c (xtensa-tdep.h): New include. >> (xtensa_linux_init_abi): Limit tdep->num_regs by >> tdep->num_nopriv_regs. >> * xtensa-tdep.c (xtensa_derive_tdep): Calculate >> tdep->num_nopriv_regs and only copy it to tdep->num_regs if it's >> not initialized. > > I have a feeling that this would be best address with xml > target descriptions, but I really don't know enough about > xtensa to say for sure. This is OK with me as is. Thank you. Applied to master. -- Max