This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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: GDB/MI Output Syntax


Nah, this works just fine.

The problem is that the sample extension actually adds a command called "sha1". In interactive mode, tcl resolves shortened commands to the full name if the resolution is unique. So if you do:

$ tclsh
% info commands sha*
% package require Tclsha1
0.5
% info commands sha*
sha1
% sha -string hello
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
% sha1 -string hello
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d

But in script mode, Tcl doesn't complete commands for you (to better catch errors in scripts). So that's why you were getting the error when you tried to use the "sha" command in DejaGnu. If you used the sha1 command, it would work:

inghji:tot-shlib-experiment/build/gdb > make check RUNTESTFLAGS="--D1"
Nothing to be done for all...
rootme=`pwd`; export rootme; \
srcdir=../../../gdb/src/gdb/testsuite ; export srcdir ; \
EXPECT=`if [ -f ${rootme}/../../expect/expect ] ; then echo ${rootme}/../../expect/expect ; else echo expect ; fi` ; export EXPECT ; \
EXEEXT= ; export EXEEXT ; \
RPATH_ENVVAR=$rootme/../../expect:$rootme/../../libstdc++: $rootme/../../tk/unix:$rootme/../../tcl/unix:$rootme/../../bfd: $rootme/../../opcodes:$RPATH_ENVVAR; \
export RPATH_ENVVAR; \
if [ -f ${rootme}/../../expect/expect ] ; then \
TCL_LIBRARY=${srcdir}/../../tcl/library ; \
export TCL_LIBRARY ; fi ; \
/Volumes/ThePlayground/Users/jingham/Work/gdb-sources/tot-shlib- experiment/gdb/src/gdb/../dejagnu/runtest --D1
1: set frame_version 1.4.2.x


dbg1.0> package require Tclsha1
0.5
dbg1.1> sha1 -string hello
aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d

I actually think that building Bob's parser into a Tcl C extension & using that with the DejaGnu testsuite would be brilliant. Not only would it ensure that we keep the output correctly parseable, but it would mean that we could solve the problem the current testsuite has that when you add a field to some mi command (which should be a backwards compatible operation) you have to go fix ALL the test cases. If you used the parser to read the MI output into a Tcl array, then the tests could just query the array for the elements they wanted to test, and not be bothered by elements that they were not concerned with testing.

Jim


On Aug 27, 2004, at 9:04 AM, gdb-digest-help@sources.redhat.com wrote:


From: Michael Chastain <mec.gnu@mindspring.com>
Date: August 26, 2004 3:16:43 PM PDT
To: keiths@redhat.com
Cc: gdb@sources.redhat.com, bob@brasko.net
Subject: Re: GDB/MI Output Syntax


Keith Seitz <keiths@redhat.com> wrote:
I've got three letters (okay, words) for you: TEA.

Interfacing Tcl and C is TRIVIAL.

Keith

I left out a part: it's nontrivial for TCL code that's running in a TCL interpreter that's already linked into 'expect', a program that we did not build, to interface with a C library.

lib/gdb.exp can load the TEA sample shared object without error, but the
new commands are not available.


ERROR: (DejaGnu) proc "sha -string hello" does not exist.

When I run the same 'expect' binary standalone interactively, it can
load the TEA sample library and the new commands are available.  Go
figure.

All the parts are there, but we're not currently using them and they
fail the smoke test.  Multiply by a dozen hosts and that's what I call
nontrivial.




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