mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-20 07:25:23 +02:00
![]() There are cases where we consider some variables as complex when they are not. In particular, if a pointer is declared using a typedef, is will be considered complex with the current code. This is because it has a child (the pointed value), but CDT doesn't know it's a pointer. One of the consequence is that we assume the value is not modifiable. Therefore, we won't update its value when it changes, and we won't let the user edit it. Initially I thought it would be safe to assume that variables with two or more children are complex, but pointers to structures have as many children as the structure has fields. Therefore, a pointer to a structure, declared as a typedef, will still be wrongfully considered as complex. Since there's no easy way to know for sure whether a variable is complex, just assume everything is simple. I added a test to verify that the value of a pointer declared using a typedef will update correctly in CDT as it changes in the program. There are two distinct scenarios, pointers that are variables and pointers that are fields of structures. Instead of adding content to testUpdateOfPointer, I decided to make a similar test method, testUpdateOfPointerTypedef. The original test method was getting too long and was difficult to follow. I think it's good to keep them short and focused. Another test verifies that the same kind of pointer can properly be written/modified by the user. Change-Id: If43b3b6e49cd4a20ea929c2a096745a32de14cd0 Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca> |
||
---|---|---|
.. | ||
org.eclipse.cdt.dsf.gdb | ||
org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui | ||
org.eclipse.cdt.dsf.gdb.multicorevisualizer.ui.tests | ||
org.eclipse.cdt.dsf.gdb.tests | ||
org.eclipse.cdt.dsf.gdb.ui | ||
org.eclipse.cdt.examples.dsf.gdb | ||
org.eclipse.cdt.gnu.dsf-feature | ||
org.eclipse.cdt.gnu.multicorevisualizer-feature | ||
org.eclipse.cdt.tests.dsf.gdb | ||
pom.xml |