This makes it easier to change arguments for all tests. As a side-effect,
all tests now enable assertion (-ea) and have the same max heap size, etc.
Change-Id: I0965d40ba3283efe7eacdf927f6c302ee0ab30f0
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
- added more comments and fixed copyright
- changed one the functions in cache class from private to public
- changed request for stack frames to request for stack depths in
getFrames fallback
- removed an extra private function which is not used anymore
Change-Id: I405e0ad61c6f9bf00bdccd041c0897f423f0b947
Re-using the waitor between tests possibly a dependency between tests
(e.g. on the order they are ran). It would be easy to forget to add an
fWait.waitReset() to a test and break another test.
It is safer to create a new one every time, while the performance hit is
negligible.
Change-Id: I404d240b29dddffb07899e7e529e7205282bd1d2
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
- Implemented cache for stack trace (replaces original stack depth
cache with a cache of frames and depth)
- This is mostly done to mitigate bugs in gdb but it will also help
speed up the debugger since the mi cache doesn't cache commands with
different limits and does not know that if we requested frames already
we don't need to ask about stack depth anymore
- In case of unrecoverable errors I will also return some constant
depth like 5, later the front end will ask to fill it up and in many
cases gdb will be happy to do that, even if it failed to report the
proper depth in the first place. We originally just returned 1 but it is
really not enough for most of the cases. This will result in potential
white gaps at the end of trace, but it is better then showing just the
first frame when we have errors
Change-Id: I24b42fd7ffea082e8064a9c5348fd95c5f7777be
Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com>
Unlike those in AsyncCompletionWaitor, these functions are based on
queries. The patch also changes occurences in MIMemoryTest where it
makes sense to use synchronous functions.
Change-Id: Id5e47b7634153d916bf896e47f6cc48f1a4727bd
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
- one case where debugger fails to return stack depth, but returns
correct stack frames
- second case where debugger fails to return stack frames when asked
without limit, but can return a specific frame
Both of these are workaround for GDB bugs where it fails to return data
consistently
Change-Id: I4fb0d4e850fbce6adc655849ec3f73c85adb1bdc
Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com>
Factor out the code for testSettingVariableWithSet and
testSettingVariableWithPrint.
testSettingVariableWithSetWithMemory is not exactly the same, so I
didn't factor it out.
Change-Id: Ib4e79eda4851ec2291fcf32054694b76e40c65ca
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Added a popup menu in expressions menu to add locals group
and registers group - for discoverability of this feature.
The menus are added to generic dsf but the command handlers
added to the gdb plugin, just in case somebody wants to implement
this for another dsf based debugger
Change-Id: Iab64e2a9f3a0c81f8bac939a2a5e94c67ef1daba
- switched default ui from actions to commands
- for DSF implemented this in DSF GDB
- for CDI implemented command wrappers
- created new API to support loading symbols in IModules service
(IModules2)
Change-Id: Id44f42fa9f0f3d7f22ff7dda07c0830262667d9c
Catching the exception and asserting false just hides the real reason,
making failures harder to debug.
Change-Id: I1a73fb5893da2762d0b9a9a496749643471f75b4
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/39787
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
runToLine uses gdb's -exec-until, which has a very strange and
unpredictable behaviour. It is safer to use runToLocation, which uses a
temporary breakpoint + continue.
Change-Id: If7bbbdd12570b50f38eb92f1748d10dff96f1f45
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/39769
Tested-by: Hudson CI
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
A change in gdb showed that we shouldn't rely on the order of threads
when they are all created at the same time.
The solution is to break after each thread is created, so that gdb takes
note of the new thread before we spawn another one. This way, they'll
always be in the same order.
Change-Id: Ia62dc0476163ad44bba52d51df95cf747d27da84
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/39712
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This patch attempts to standardize the naming and factor out the variables
that refer to source or executable files throughout the debug tests.
It removes definitions of paths that are already defined in BaseTestCase.
Also, it tries to name these consistently:
- filename of executable: EXEC_NAME
- filename of source: SOURCE_NAME
Finally, it replaces hardcoded paths at various places by constants at the top
of the test class.
Change-Id: Ib2ea3e46b41185fb9614ae6ad9d41c3b70154884
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38068
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Hudson CI
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This new location lends itself better to using our new GDB download
script
dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/scripts/download-build-gdb.sh
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
-Make sure getopt command is present (not included by default on Mac but
available through MacPorts
-Patch wrong include
Change-Id: I3ad1e19091896f8644ededa9d8200efe40bae82b
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/39438
Reviewed-by: Simon Marchi <simon.marchi@polymtl.ca>
Change-Id: Ia40f8fd676a7e2c302f06efa4ccf9fb77dc6dfc9
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/39421
Tested-by: Hudson CI
Reviewed-by: Simon Marchi <simon.marchi@polymtl.ca>
project field should be first since project selection
drives binary selection
Change-Id: I53a2832e283ac6f32876c6262ec9df1a4196bb6c
Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com>
Reviewed-on: https://git.eclipse.org/r/39625
Tested-by: Hudson CI
Hardcoding line numbers in tests make it a pain to modify the test sources.
The approach adopted in the gdb testsuite is to look for a specific string
in the source file and return the line number where it is found. I made a
similar system for the CDT debug tests.
I dubbed this system breakpoint tags, a tag being the string we look for in
the source file.
I modified the MIRunControlTest as an example, as well as GDBProcessesTest
and MIRegistersTest because they are re-using the same breakpoints.
SOURCE_PATH and EXEC_PATH were duplicated in many test cases, so I factored
them in BaseTestCase.
Change-Id: Id1e64b2064914005ab1d87e16704866aa1c8b9ec
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/36872
Tested-by: Hudson CI
Reviewed-by: Elena Laskavaia <elaskavaia.cdt@gmail.com>
This script can be used to download and build automatically multiple
versions of gdb, which is necessary when working on the CDT debug tests.
Change-Id: Ibf9ddac4efe8f80f480ae2bc9702b722bdc97192
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38737
Tested-by: Hudson CI
Reviewed-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Tested-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
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>
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>
Using more specific assert functions (e.g. assertEquals(a, b) rather than
assertTrue(a.equals(b)) helps a bit to make the test more readable. It can
also improve the display in the JUnit view, by showing expected and actual
values.
Also, there is no need to manually catch an exception and fail the test. If
an exception is thrown, the test will fail automatically.
Change-Id: I333cfd0d0ade41463dc773ab02e14df4b063a22f
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38617
Reviewed-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
Tested-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
Change-Id: I1c291fa235fe77910b6bea7ad98f269d8949fc5c
Signed-off-by: Vladimir Prus <vladimir@codesourcery.com>
Reviewed-on: https://git.eclipse.org/r/37475
Tested-by: Hudson CI
When catching the exception and failing the test manually, we loose the
information about the root cause of the problem. We let the exception
propagate so that JUnit will show a useful trace.
Change-Id: I1df26283f42b58b4dda68ab9e8c11cca27ae81c8
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38771
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
-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>
When executing the launch sequence in testSourceGdbInit, gdb 7.1 inserts
an extraneous \n in one of its replies, causing an assert to be hit.
Since we don't actively support that version, let's just disable the
test.
Change-Id: I9544835ead72e1701766d76fafa0e63f3b88911d
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
Reviewed-on: https://git.eclipse.org/r/38768
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>