About GDB user-defined commands ?

Benoit MILLOT benoit.millot@cstelecom.com
Mon Aug 21 06:34:00 GMT 2000


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



More information about the Gdb mailing list