Re: Dejagnu testing issue

Tom Tromey
2011-10-20T15:02:24Z

>>>>> "Kevin" == Kevin Pouget <kevin.pouget@gmail.com> writes:

Kevin> how can I read a value from what GDB writes, and use it later to
Kevin> validate some tests.

Kevin> For instance, the pid:

Kevin> I know it's it "info inferiors" --> ".*process HERE .*", I would like
Kevin> to save it, and then do something like "detach", "attach $PID"

Kevin> (don't get me wrong, I know there are some alternatives to get the
Kevin> PID, but I really want to read it from a GDB command)

You can do it, with some difficulty, using gdb_test_multiple and
examining expect_out in your match. This is done in some places in the
code.

Kevin> By the way, is it a normal that I can't set a thread breakpoint this way:

>> break <somewhere> thread $_thread
>> Junk after thread keyword.

Kevin> (that would have bypassed the problem described above !)

Yes, the 'thread' modifier just takes an integer.
You can use eval though:

eval "break ... thread %d", $_thread

Tom