From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4355 invoked by alias); 16 Jul 2003 02:46:48 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 3458 invoked from network); 16 Jul 2003 02:46:45 -0000 Received: from unknown (HELO localhost.redhat.com) (66.30.197.194) by sources.redhat.com with SMTP; 16 Jul 2003 02:46:45 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 171942B7F; Tue, 15 Jul 2003 22:46:45 -0400 (EDT) Message-ID: <3F14BC94.4070405@redhat.com> Date: Wed, 16 Jul 2003 02:46:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: RFC: Unpredictable register set operations References: <20030715220923.GA30513@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg00183.txt.bz2 > I'm sure this has come up before, but I couldn't find a discussion anywhere > so I'll just have to ask again... It come up before: http://sources.redhat.com/ml/gdb/2003-06/msg00108.html > Consider PowerPC and the $ps register (MSR). When debugging a kernel or > embedded application, GDB has pretty complete control (?) over this > register. In GNU/Linux userspace, however, only two bits of it can be set. > The rest are read-only. > > So what happens if you "set $ps = 0"? Well, the right thing happens, but > until the next time the target stops "print $ps" will print 0. Which is not > actually the value of the $ps register. > > Here's the options that I see: > - Ignore and document this. > - Refetch registers after storing them. > - Invalidate registers for lazy re-fetch after storing them. > - Add a target hook for might-be-volatile registers, and invalidate > only those registers after storing them - or don't cache them at > all. > > Thoughts? Is this a problem worth fixing? This is a straight bug. The register cache should be marked as invalid after the store. What puzzles me is why store.exp doesn't tickle this, or is this a hangover from lval_register vs lval_reg_frame_relative? Andrew