1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 09:25:31 +02:00
Commit graph

55 commits

Author SHA1 Message Date
Simon Marchi
9462c1db24 Bug 399494 - Consider all variable objects as not complex
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>
2017-04-28 10:59:24 -04:00
Simon Marchi
e14b87a88f Use line tags in MIExpressionsTest.testUpdateOfPointer
Running to different points of the test program using line tags is
easier and safer than stepping a certain number of times.  Since I want
to modify this test to add a pointer-behind-typedef test, I thought it
would be good to first convert it to line tags.

I also took the liberty of giving more meaningful names to the structure
fields, even though it doesn't change anything in the test.

Change-Id: Ife7e2ae8557789dfc7403df71ba5126ca84b80e0
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2017-03-06 10:44:15 -05:00
Simon Marchi
955afec343 Fixup for "[dsf-gdb] debug tests: Use line tags where possible"
Unfortunately previous commit was submitted too early. There were
two problems that this commit corrects:

1) clear line tags before each test run - side effect of Bug 508642

When a test marked with Intermittent fails, the next retry is executed
with the same class instance.  Therefore, the new try starts with a
non-empty fTagLocations.  The test trips on the check that there are no
duplicate tags.

2) Fix failing testStopAtMainWithReverse

A blank line got inserted into the test case, that
interfered with the test logic.

Change-Id: If4c28557eac7ee740b4e3a5eac5dd2726c39a35d
Also-by: Jonah Graham <jonah@kichwacoders.com>
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2016-12-04 12:06:00 +00:00
Simon Marchi
c389f49659 [dsf-gdb] debug tests: Use line tags where possible
The goal is to eliminate direct source line number references in tests,
so that modifying test cases is easier.

Change-Id: I9a4964478e9486bff137fb9aec199cee144c2af4
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2016-12-03 18:08:14 -05:00
Marc Khouzam
79e0972413 Add Inferior exit code test
Simple test to verify that the exit code of a process is properly set
for the console to read.

Change-Id: Ib7dca7a86732ad119dd57bb2681120d4a6222e5c
2016-02-25 09:09:25 -05:00
Jonah Graham
cedcf7655b Bug 472765: more complete tests for source path mapping
Add some more tests for source path mappings to ensure that the upcoming
change of using gdb's set substitute-path does not regress any issues.

Change-Id: I9067c8859293c3332439679cb1f663e36a4cc34e
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-01-06 12:46:20 -05:00
Jonah Graham
cc2099c4a0 Bug 478803 and Bug 478805: add tests for source lookup
Change-Id: If47f62a46164e4098e663f1eef1a0a8640a84009
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2015-10-01 22:31:39 +01:00
Simon Marchi
544dbb5af8 [debug tests] Remove superfluous breakpoint tag
There is a superfluous LINE_MAIN_BEFORE_THREAD_START that is causing
problems, remove it.

Change-Id: I57c4637ada0b5efda2848029e5216a13cf638067
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-18 11:34:54 -05:00
Simon Marchi
79c6c7d775 debug tests: Add test for thread name
This patch adds SyncUtil.getThreadData to make it easy to get the thread
data from the gdb thread number.

Change-Id: I948a8b87cc3afa64f3d73de23d4ace12ef4c0c1a
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/36870
Reviewed-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
Tested-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
2015-01-12 09:36:04 -05:00
Marc Khouzam
6a765aed3b Bug 456807 - Update Tracepoint tests to handle both 32bit and 64bit
architectures

Change-Id: I4325fadfec95efc263b72db8dbe446de31154169
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/39006
2015-01-07 14:54:33 -05:00
Simon Marchi
0f94c4a067 debug tests: Add thread compatibility layer and use it
Having a compatibility layer for threading operations, like the one we
have for sleep, will allow removing a lot of platform dependent code in
the test sources, therefore simplifying the tests themselves.

I changed MultiThread.cc and MultiThreadRunControl.cc as examples, but
there are other tests files that could benefit from it.

I also changed MultiThread.cc to remove all the synchronization based on
sleeps. It now works using thread barriers, which should make the tests
less prone to random failure (although I don't think these ones were
particularly flaky) and run faster (since we don't wait for nothing).

The fallouts of that change on the Java part of the tests are taken care
of as well.

Change-Id: I7be86a5727877638c0ff0a489d263ee6bbe84764
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/36814
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Hudson CI
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2015-01-07 12:36:59 -05:00
Simon Marchi
24301e7396 debug tests: Change -dwarf-2 to -g in tests Makefile
-gdwarf-2 was added specifically when the default debug format was
stabs, to force using the DWARF format. It is irrelevant nowadays, and
we want to let the compiler choose the DWARF version it prefers.

Change-Id: I300fab09b492704ca3d3a61446b8dd0ce36167c2
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38766
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-12-25 13:48:43 -05:00
Simon Marchi
c817c3aed5 debug tests Makefile: don't use -pthread when on Windows
Currently, I get the following error:

g++ -gdwarf-2 -pthread -o ../bin/MultiThreadRunControl.exe
MultiThreadRunControl.cc
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe:
cannot find -lpthread

I could install the pthreads package for mingw, and it would probably
work, but we don't use pthreads on windows, so it's better to just not
link with it.

Change-Id: I5deb58c5b69a98b77e9e9a4a744c6815c830cf20
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/37611
2014-12-11 13:02:58 -05:00
Simon Marchi
ab31b3bcbb debug tests: Trigger rebuild when any header file changes
We could go more complicated and only rebuild those source files that are
affected by the changes in the header files, but I think this is a good
compromise.

Change-Id: I508e8ca0176408c68a16e09c51f005446aace099
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/36797
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-11-24 16:15:15 -05:00
Simon Marchi
084aa63172 dsf-gdb tests: Improve tests Makefile
This changes the Makefile that builds test apps so that it uses the
proper Makefile structures, rather than a single shell command.

Also, this will compile .c files with gcc and .cc files with g++,
allowing to have both.

Also, I changed the .exe extension justification from "so that CVS does
not include it when making a patch" to "so that files are named the same
way in Linux and Windows". It seems more reasonable.

Change-Id: I4414b1dc5c31a9eaa7edaed30e53363b9a76dd8f
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/36488
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-11-20 09:06:53 -05:00
Simon Marchi
cee1a39898 Use consistent indentation in BreakpointTestApp.cc
Change-Id: I753591b8465ec57477989fee7bbaa0537a9d7dc7
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/35758
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-10-31 16:09:33 -04:00
Marc Khouzam
8c15651c03 Bug 436349 - JUnit test for step-return for a method returning void
Change-Id: Ia449c9f599e6c5c3af9e26b4014ade6a12ae58c3
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/27735
Tested-by: Hudson CI
2014-06-02 13:12:57 -04:00
Marc Khouzam
90648530f8 Bug 432888 - Missing rm.done() for a fetched child of an expression
Change-Id: Ia5b43d57d2bc0354786c5d276e091749fa64a87b
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/25108
2014-04-16 05:46:52 -04:00
Marc Khouzam
2a935a9926 Bug 341731 - Show values returned from function calls when doing a
step-return operation

Change-Id: I4ac5c64a940ffcbe75b21618a74f2c4eba93d27e
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/15377
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
IP-Clean: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
Tested-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
2014-02-13 14:38:56 -05:00
Marc Khouzam
c95780a092 Bug 415094 – Update Step Into Selection JUnit tests
Change-Id: I4e5a0afd8fc47444a3360f56650ebe966d837e04
Reviewed-on: https://git.eclipse.org/r/13840
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-08-14 14:51:03 -04:00
Marc Khouzam
b1052736a1 Bug Bug 382692 - Update MIExpressions JUnit tests to current CDT havior
Change-Id: I2de2b0b28774a4ee311ba76f54a71ac2f4735628
Reviewed-on: https://git.eclipse.org/r/13522
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-06-03 16:31:04 -04:00
Marc Khouzam
fcb46a9a5d Bug 409186 - Debug JUnit tests are not ready for 64bit machines
Change-Id: I2b5eabb506366949bf4dc75af6221f1ddd251898
Reviewed-on: https://git.eclipse.org/r/13292
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-05-28 14:51:22 -04:00
aleon
bb755a01be Bug 244865 – Support for Step Into Selection
First Implementation:
* Non-stop as well as All-stop debugging
* Function / Method name validation, arguments size validation
(no arguments signature yet)
* Ctrl-F5 as short key (consistent with JDT)
* Hyper link support with Ctrl-Shift click
* Junit Test (Services part)
Change-Id: I58903b4b6b7f9fd39a827f5297ad23ac3f96186d
Reviewed-on: https://git.eclipse.org/r/11305
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
IP-Clean: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2013-04-30 14:26:00 -04:00
Marc Khouzam
0248aa4474 Bug 397715 - [memory][expressions] Make use of GDB 7.6 new
=memory-changed MI event

Change-Id: I98c3cd273e185dfb1782527d7abd553351a163d9
Reviewed-on: https://git.eclipse.org/r/9662
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-01-25 11:09:44 -05:00
Marc Khouzam
9e6ee807a9 Bug 378834 - Update Debug JUnit tests to run on Hudson
Change-Id: Ie93ef3b2401b6823afd96504de1b5b5c577f1da4
Reviewed-on: https://git.eclipse.org/r/9656
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2013-01-14 14:52:06 -05:00
Marc Khouzam
cd7ffb2dbf Bug 394408: Support enhanced-expressions for local variables. This
includes special handling for array indices.  Furthermore, we now
require the '=' prefix for all glob-pattern expressions, including
registers.

Change-Id: If929d539b80d282df383c44d1487611fda928613
Reviewed-on: https://git.eclipse.org/r/8881
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2012-12-18 14:29:18 -05:00
Marc Khouzam
9dbd7f7213 Bug 381754: Group-expression support for Expressions view.
JUnit tests.

Change-Id: I5666d09a3abe71ef9c811fb94418c80da5b3a09e
Reviewed-on: https://git.eclipse.org/r/6701
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2012-07-10 15:52:46 -04:00
Marc Khouzam
1ef180e2ab Bug 381868: JUnit tests for casting expressions
Change-Id: I9e8c9986db8fac2599eb8f28cc60d42010d17a93
Reviewed-on: https://git.eclipse.org/r/6427
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2012-06-19 12:51:13 -04:00
Marc Khouzam
cfff2b91fb Bug 376901: JUnit tests for RTTI feature
Change-Id: Id72d0d170b8f78201a36d1f95da5ca7a3d07cfa5
Reviewed-on: https://git.eclipse.org/r/5868
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2012-05-07 16:11:51 -04:00
Marc Khouzam
efe3dd4be6 Bug 330974: If the user selects multiple nodes in the debug view most debug commands are disabled
Change-Id: I51d15347fd28ee550e9bd2b75c61e904e75b4c8b
Reviewed-on: https://git.eclipse.org/r/5650
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
2012-04-25 09:57:37 -04:00
Marc Khouzam
ad2208cc77 Bug 365541: Extra JUnit tests for partitions. Also, don't look for all the children of array_foo as it requires over 14000 MI commands, and makes the test take over 30 seconds. 2012-01-26 14:22:22 -05:00
Mikhail Khodjaiants
15ab0165f1 Bug 365541 - View an array variable whose length is very long (such as
10000) in the editor or Variable View, will cause the interface to die.
2012-01-26 11:59:27 -05:00
Marc Khouzam
d592d691aa Bug 346320: Add support for fast tracepoints 2011-07-25 15:29:42 -04:00
Sergey Prigogin
b48eb1807f Added bin directory to .gitignore 2011-06-25 16:22:34 -07:00
Marc Khouzam
cc88953450 Bug 346899: JUnits to test post-mortem core launch 2011-05-23 18:10:11 +00:00
Marc Khouzam
09499bd32c Bug 337893 - Tests for IMIRunControl.executeWithTargetAvailable, all-stop mode 2011-03-28 17:24:52 +00:00
Marc Khouzam
83c041d618 Bug 336008: [tests] JUnit tests for launch configuration and restart 2011-02-04 16:24:20 +00:00
Marc Khouzam
797697ad62 Bug 336008: [tests] JUnit tests for launch configuration and restart 2011-02-04 15:22:29 +00:00
Sergey Prigogin
b500c6c1cd Configurable formatting of constructor initializer lists. 2011-02-03 23:12:11 +00:00
Marc Khouzam
71ac61e6e2 Bug 336008: [tests] JUnit tests for launch configuration and restart 2011-02-01 19:20:06 +00:00
Marc Khouzam
6559679143 Bug 320277: More JUnit test to make sure we properly view variables of base class in derived class 2010-09-09 20:34:31 +00:00
Marc Khouzam
ffd8caf56d Bug 320277: JUnit test to make sure we properly view variables of base class in derived class 2010-09-09 12:34:11 +00:00
John Cortell
4972e64775 Adjust to the new dual POSIX/MSVC buildable MultiThread.cc. Also fix problems in the registers test 2010-05-27 21:20:45 +00:00
John Cortell
abef64cb07 Make dsf-gdb test programs buildable with MinGW. MinGW gdb has problems debugging a cygwin-built executable, so we need to build the test apps with MinGW when testing that debugger. Confirmed these modified files now build with both Cygwin and MinGW. 2010-05-26 19:38:11 +00:00
John Cortell
af21820551 Various expression tests where failing on Windows because of subtle differences in the compiler and the line tables it generates, and perhaps scoping behaviors. The code would end up on the trailing brace of a function, and all variables are out of scope there. 2010-05-25 23:01:40 +00:00
John Cortell
367979ea80 [248587] Support "Event' Breakpoints 2010-04-06 20:01:42 +00:00
John Cortell
57c6ba5fec [248587] Support "Event' Breakpoints 2010-04-06 19:32:14 +00:00
John Cortell
4ec5b596be Specify dwarf2 debug info. Default for 3.x is STABS, and that is an inferior format. At a minimum, C++ exception catchpoints don't work, and there is a class that tests them. 2010-04-05 17:38:41 +00:00
uid8941
d4367d5bba Add -m32 flag to make the tests programs build properly on 64-bit machines. 2010-03-09 14:35:32 +00:00
John Cortell
ebdc876c9b Fixed race condition test failure. The secondary thread, because it does nothing but a quick printf, was terminating before the test was able to check for its existence via IRunControl.getExecutionContexts(). Consequently, it would get one less thread than expected. 2010-03-04 22:14:37 +00:00