This is the mail archive of the
mailing list for the Archer project.
Re: [python] Add the in_scope.py script.
- From: Tom Tromey <tromey at redhat dot com>
- To: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- Cc: archer ml <archer at sourceware dot org>
- Date: Mon, 24 Nov 2008 10:24:16 -0700
- Subject: Re: [python] Add the in_scope.py script.
- References: <email@example.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Thiago" == Thiago Jung Bauermann <firstname.lastname@example.org> 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 :-)