Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] MI behaviour - var-evaluate-expression

Hi,

I noticed that -var-evaluate-expression is called for variables that
could exist in other threads than the current one and wondered if this
is a bug or not (I've read the MI section in the gdb manual but
couldn't really find a proper spec for an MI controller)? So as an
example - if a user selects a thread in the thread list, CDT calls
-thread-select n, followed later by -var-create - * &(x) (for array
variables) in that thread, switches back to thread 1, then calls
-var-evaluate-expression for the array variable in the selected
thread. So what's happening is gdb is being asked to evaluate a
variable which exists in another thread. Normally this may be fine but
in a multi-core environment the other thread could use a different
address space in which case reading that variable will fail unless the
thread is switched to before.

Apologies if this makes no sense whatsoever...

Mike


Back to the top