From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23807 invoked by alias); 15 Mar 2002 05:03:46 -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 23726 invoked from network); 15 Mar 2002 05:03:45 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 15 Mar 2002 05:03:45 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16ljrZ-0006GO-00; Fri, 15 Mar 2002 00:02:45 -0500 Date: Thu, 14 Mar 2002 21:03:00 -0000 From: Daniel Jacobowitz To: Andrew Morton Cc: Andrew Cagney , Eli Zaretskii , gdb@sources.redhat.com Subject: Re: bitwise operations on registers Message-ID: <20020315000245.A23867@nevyn.them.org> Mail-Followup-To: Andrew Morton , Andrew Cagney , Eli Zaretskii , gdb@sources.redhat.com References: <3C8CCEAF.2030803@cygnus.com> <20020311103942.A9410@nevyn.them.org> <3C916697.5060302@cygnus.com> <3C9173AD.E2FBA5DA@zip.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C9173AD.E2FBA5DA@zip.com.au> User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00135.txt.bz2 On Thu, Mar 14, 2002 at 08:08:13PM -0800, Andrew Morton wrote: > Andrew Cagney wrote: > > > > Andrew, > > > > Sounds like a bug report is in order (http://sources.redhat.com/gdb/bugs) > > Done. Thanks, guys. > > Mind if I ask a little usage question while I'm here? > > The kernel has various funky tricks which I'd like to be > able to express in the debugger. For example, the currently-running > task's controlling structure is always at > > *($esp & ~8191). > > So it would be convenient to be able to do > > define current ((struct task_struct *)($esp & ~8191)) > > then > > (gdb) p current->pid Can't really do this, but you can at least: define current ((struct task_struct *)($esp & ~8191)) end (gdb) current $33 = (gdb) $33->pid > That's a simple one. More complex is a representation of > the kernel's trick of using negative offsetof() to go from > a doubly-linked-list structure back to the start of its containing > object. The list_entry() macro. > > But alas, as far as I know, none of this is possible. > > Any pointers to how one could set about doing all of this? No generic way to do it, you do have some userdefined function capability. As you find specific shortcomings, file bugs :) For instance: macros that return values would be useful. offsetof would be useful. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer