This is the mail archive of the mailing list for the Archer project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python] Add the script.

>>>>> "Thiago" == Thiago Jung Bauermann <> writes:

Thiago> Do I need to make install to be able to use the require facility?

Yeah, I'm afraid so.

Thiago> Is there a way to make GDB use the python library from the build
Thiago> directory? Perhaps by putting some code in $BUILD/gdb/.gdbinit?

Good idea.  I'll give it a try.  It would only work when run from the
build directory -- but I think in general there isn't a great way to
solve this problem anyway.

Thiago> Also, the other scripts have an "import gdb" line. Is it
Thiago> necessary when the script is loaded from the library dir? I
Thiago> added it to this script, just in case.

I believe it is needed if your script uses anything from the gdb

Thiago> +    def invoke (self, var):
Thiago> +	vars = set (var.string().split())

FWIW you could also make it a varargs-like function:

  def invoke (self, *vars):

Then users would call:

  $in_scope ("a", "b", "c")

IMO this is a bit more natural.

Also, I got rid of the strip() from my functions, on the theory that
users can just say what they mean :-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]