This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: About GDB user-defined commands ?
- To: benoit dot millot at cstelecom dot com (Benoit MILLOT)
- Subject: Re: About GDB user-defined commands ?
- From: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Date: Mon, 21 Aug 2000 19:11:12 MET DST
- Cc: gdb at sourceware dot cygnus dot com
Try:
define dm
set var $taddr = $arg0
set var $tsize = $arg1
while $tsize != 0
if $tsize >= 10
monitor dm $taddr $tsize
set var $taddr = $taddr + 10
set var $tsize = $tsize - 10
else
monitor dm $taddr $tsize
set var $tsize = 0
end
end
end
> Hello,
>
> I want to develop a user-defined command for my own monitor
> which i have already implemented into gdb with nomitor ops..
>
> Can i use a new variable? (answear seems to be NO)
> Can i make operation (addition, ...) with input argument (arg0 ...)?
>
> example:
> user defined command dm :
>
> dm $arg0 $arg1
>
> while $arg0!=3D0
> if $arg1>=3D10
> monitor dm $arg0 $arg1
> $arg1 =3D $arg1 -10
> $arg0 =3D $arg0 +10
> else
> monitor dm $arg0 $arg1
> end
>
> I try this but it doesn't work and lines with $xxx =3D $ xxx + xxx
> disappear after the first exec.
> message : No symbol in cuurent context
>
> With line: SET $arg0 =3D $arg0 +10
> Left operand of assignement is not a Lvalue
>
> Any ides will be appreciated.
> Thanks.
>
> Beno=EEt
>
>
>
--
Peter Schauer pes@regent.e-technik.tu-muenchen.de