1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Commit graph

1192 commits

Author SHA1 Message Date
Alvaro Sanchez-Leon
384e9759c4 Bug 459114 - [visualizer] Make it possible to override the construction of the data model
Change-Id: Ib2af550136fa3ca638fd970e3c2e40ddf597ba80
2015-02-16 13:44:26 -05:00
Marc Khouzam
0e041e8e86 Bug 459688 - Label in breakpoint thread filter dialog should match debug
view 

Change-Id: I3d74c3316f5acbf2b6aadc0b6e99e7081384f401
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-02-11 11:17:47 -05:00
Marc Khouzam
2c1113c590 Bug 456959 - Disable test for versions of GDB that don't support it
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-02-07 19:33:34 -05:00
Marc-Andre Laperle
afd11359e6 Extract test VM args to common property base.test.vmargs
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>
2015-02-06 13:02:28 -05:00
Alena Laskavaia
d3718b536f Bug 458091 - Debug frames - cache part II
- 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
2015-02-04 14:24:07 -05:00
Simon Marchi
3cf7241ccb debug tests: Remove fWait field from GDBProcessesTest
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>
2015-02-04 11:26:29 -05:00
Simon Marchi
a96fcd5a37 debug tests: MIMemoryTest: Use assertEquals instead of assertTrue when
possible

Change-Id: If9fc8f3f0f1f2070b7bc4ea6dc23778001dc0092
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-04 11:22:18 -05:00
Alena Laskavaia
d41b69136d Bug 458091 - Debug frames - cache
- 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>
2015-02-02 10:22:56 -05:00
Simon Marchi
59854a48cd debug tests: Factor out duplicated code in MIMemoryTest.memoryCachedRead
Change-Id: I8ee7883e96e99d2daebe7a3748d4e5e6b3a165fe
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-01 20:47:19 -05:00
Simon Marchi
9ae9ed49f6 debug tests: Use SyncUtil's memory functions in MIMemoryTest
Change-Id: I47b9e4e65d418743da97bfddb78bfdce29f3c688
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-01 20:46:06 -05:00
Simon Marchi
e11bdc4502 debug tests: Use SyncUtil.readMemory in PostMortemCoreTest
Change-Id: I2572e7f9bef8512bd32df7c040f3f12506dc5453
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-01 20:44:45 -05:00
Simon Marchi
5500e418c9 debug tests: Use SyncUtil.readMemory in GDBConsoleSynchronizingTest
Change-Id: Ied75ccb790842a746f09e3d7b51bb9225891af96
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2015-02-01 20:41:45 -05:00
Marc Khouzam
624446b2c3 Bug 458499 - Unable to debug when GDB command contains additional
arguments

Change-Id: I0cfb07dd04d28062a653f76dbd23510d712e4c71
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-01-30 16:14:15 -05:00
Simon Marchi
b662f3b063 debug tests: Add memory access functions to SyncUtil
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>
2015-01-30 15:17:55 -05:00
Alena Laskavaia
5df84dcfe0 MIStack correct code style
- removed trailing whitespace
- added/removed curly braces according to cdt style
- corrected indentation using tabs only policy

Change-Id: I605f68ed47753e0486aef42049f2e7392cadf9d0
Signed-off-by: Alena Laskavaia <elaskavaia.cdt@gmail.com>
2015-01-29 14:43:39 -05:00
Alvaro Sanchez-Leon
d95f95521e Bug 458566 - [visualizer] NPE Closing the visualizer when the debug view is not present
Change-Id: I330a91f78504c4430dc39bd58dfb309a3ef6c18a
2015-01-27 13:17:36 -05:00
Alena Laskavaia
5a7e047ab5 Bug 458091 - Debug frames are missing or not shown in some cases
- 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>
2015-01-26 10:46:11 -05:00
Marc Dumais
674e89ad8f Bug 458076 - [visualizer] load of some cores missing when there are
multiple CPUs

Change-Id: Ice5e6d7447336ddaf678d37854783eff349e22bb
2015-01-26 08:17:25 -05:00
Simon Marchi
80ff1f872f debug tests: Factor out test in GDBConsoleSynchronizingTest
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>
2015-01-25 10:18:36 -05:00
Alena Laskavaia
7124bcc621 Enhanced Expressions: menu for add locals and registers in dsf
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
2015-01-23 20:14:12 -05:00
Marc Khouzam
b36c74eb6a Bug 214398: Small cleanup
Change-Id: Iff09cb9815bfc9913ad6cc69a94e6fe8f4cb4251
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-01-22 14:07:58 -05:00
Marc Khouzam
8855a845a3 Bug 456959 - Unit tests for bp after restart bug
Change-Id: Id25d6a6c7c2e094b5308ca42e2f1fa24c260f6af
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-01-21 08:13:07 -05:00
Alvaro Sanchez-Leon
6dda632d25 Bug 456959-Breakpoint Enable does not work after restarting the application
Change-Id: I97e1256a3c718ed653ad255bffe1fa67ae5368c2
2015-01-19 16:49:51 -05:00
Marc Khouzam
1e441c619d Missing @since tag
Change-Id: I26236d4b7d4b3bab5d06faf728209768efb15299
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-01-19 15:51:51 -05:00
Alena Laskavaia
8db788ee92 Bug 214398: Implement Load Symbols and Load Symbols for All
- 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
2015-01-19 14:58:18 -05:00
Simon Marchi
41065c06e1 Debug BaseTestCase: don't swallow exception
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>
2015-01-16 14:43:20 -05:00
Simon Marchi
ac6e5420d9 debug tests: Remove runToLine
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>
2015-01-16 14:42:04 -05:00
Simon Marchi
da85a41850 Force thread order in GDBProcessesTest.getThreadData
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>
2015-01-16 13:13:44 -05:00
Simon Marchi
3d264fbae0 debug tests: Cleanup filename references
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>
2015-01-16 12:32:58 -05:00
Marc Khouzam
b26f160e3b Update location to use for GDBs on HIPP
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>
2015-01-15 13:26:02 -05:00
Marc-Andre Laperle
5adce1b311 Add Mac support to script to download gdb
-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>
2015-01-15 10:43:05 -05:00
Marc Khouzam
2af91607ea Update GDB download script for GDB 7.8.2
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2015-01-15 09:39:18 -05:00
Marc Khouzam
7bbaa4d7b3 Avoid duplicate code in script
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>
2015-01-15 09:33:53 -05:00
Alena Laskavaia
eb5d03de5c dsf main debug tab: swapping project and binary fields
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
2015-01-15 09:07:46 -05:00
Simon Marchi
d0e93b665b debug tests: Introduce line "tags" to avoid hardcoding line numbers
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>
2015-01-15 08:44:42 -05:00
Simon Marchi
6a7b37ca6a Add script to download and build multiple versions of gdb automatically
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>
2015-01-12 15:25:09 -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
bbf27fec22 Bug 455408 - Improve GDB label in the debug view
Change-Id: Iff449cd71f57ebcd9c8888f9958853323a6b7c2b
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/38679
Tested-by: Hudson CI
Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
2015-01-07 15:03:35 -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
Marc Khouzam
c0ea87636e Bug 456738 - TraceFile tests cause failures
Change-Id: Ida45dbe1ba4d37f3bc0e668c30c05f616d585c55
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/39013
Tested-by: Hudson CI
Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
2015-01-07 14:52:32 -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
Marc Khouzam
eb66a8a2ee Bug 456942 - [junit] GDB does not report thread names in remote mode
Change-Id: I9ad3eefa715326ce6cc15f384cb13bbfd410f8db
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/39142
2015-01-07 11:30:25 -05:00
Marc Khouzam
5beb56ed69 Bug 455094 - StepIntoSelection cleanup after review
Change-Id: Id591e5c46ed86744b92c0931079fc798e39498ed
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/38177
2015-01-07 11:01:56 -05:00
Sergey Prigogin
252eaf4c0f Incremented CDT feature version to 8.6.0.
Change-Id: Ic90c8e6a68d21e5b90ec3fac997da6a95a29bedf
Signed-off-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
Reviewed-on: https://git.eclipse.org/r/39066
Tested-by: Hudson CI
2015-01-06 19:40:38 -05:00
Simon Marchi
4af00a316e MIRegistersTest: use more specific assert functions
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>
2015-01-05 17:01:22 -05:00
Vladimir Prus
7aa9cf6efc Bug 453920: Remove code duplication between MIVar and MIVarCreateInfo.
Change-Id: I1c291fa235fe77910b6bea7ad98f269d8949fc5c
Signed-off-by: Vladimir Prus <vladimir@codesourcery.com>
Reviewed-on: https://git.eclipse.org/r/37475
Tested-by: Hudson CI
2014-12-31 08:58:53 -05:00
Simon Marchi
9bbd8d4f3e debug tests: Don't catch exception in SyncUtil context getters
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>
2014-12-25 13:51:00 -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
806a0e65a4 Disable LaunchConfigurationAndRestartTest.testSourceGdbInit for gdb < 7.2
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>
2014-12-25 13:44:51 -05:00
Marc Khouzam
2b935a5172 Only enable remote tests for gdb versions >= 7.1
Change-Id: Ia42a2dc330d739181167bf5511ff976a36ab180f
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2014-12-24 13:50:04 -05:00