This is the mail archive of the gdb-patches@sourceware.org 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: Dejagnu testing issue


>>>>> "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


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