bitwise operations on registers

Daniel Jacobowitz drow@mvista.com
Wed Mar 27 14:55:00 GMT 2002


On Wed, Mar 27, 2002 at 04:41:43PM -0500, Andrew Cagney wrote:
> >
> >Can't really do this, but you can at least:
> >define current
> >((struct task_struct *)($esp & ~8191))
> >end
> >
> >(gdb) current
> >$33 = <blah>
> >(gdb) $33->pid
> 
> You've also got:
> 	(gdb) set $current = ($esp & ~8191)
> but that is only evaluated once (If I remember right).
> 
> The next step would be to add it to the stop-hook so it is executed 
> after every stop.

... or hook it up to Jim's new macro expander, perhaps?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list