1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 14:12:10 +02:00
Commit graph

1525 commits

Author SHA1 Message Date
Jonah Graham
121d748c2c Bug 516053: Enable extending of MIBreakpointsManager/Synchronizer
This involves API improvements and documentation to allow extenders
to extend these DSF services.

Change-Id: Ieb87a6fca757794c9f950d610bb6999e8a86e30d
2017-05-05 09:51:19 -04:00
Jonah Graham
903da92803 Bug 516244: Allow subclasses to provide the current CLI context
Change-Id: I8138f16bb57433af1690dbd77a735c810cef052f
2017-05-05 09:42:33 -04:00
Jonah Graham
d4ecd37bb1 Bug 516053: Allow MIBreakpointDMData to be extended
New API to allow third-parties to extend MIBreakpointDMData with their
own custom Breakpoint handling.

Includes deperecating of MIBreakpointNature that was not used anywhere
in CDT except within internals of MIBreakpointDMData. It arguably
should never have been API in the first place.

Change-Id: I6bcdf2ccaa28d15835ab022648b9b4b0aa7498a7
2017-05-05 08:35:48 -04:00
Jonah Graham
a36ecd3839 Bug 516053: Allow MIBreakpoint to be extended
New API to allow third-parties to extend MIBreakpoint with their
own custom Breakpoint handling.

Change-Id: I64abfc41916a2053cfbed7e3db2357fbf2572050
2017-05-05 08:32:35 -04:00
Jonah Graham
6edd1c6a53 Bug 499778: Stop losing stacktraces in tests
Rather than try/catch/fail just let exception cascade so that the full
stacktrace is available in the test results.

The braces have been left in place for scoping and to minimize changes.

Change-Id: I5407829ea964f828e3f996794489a7b884de25fb
2017-04-28 21:11:27 +01:00
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
Jonah Graham
6473183440 Fix typo in javadoc
Change-Id: I24a3a59423b8c9a153abc9e4d99f94d7760aa3a2
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-04-26 05:03:08 -04:00
Jonah Graham
98a578cf94 Bug 515768: Don't install BPs that are entirely filtered
This check already existed for modifying breakpoints, but didn't exist
for creating new breakpoints or installing initial breakpoints.

Change-Id: I5ff5ce0b3ac603ccffa49bd98d60f7202505a7bd
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-04-25 14:42:47 +01:00
Jonah Graham
a797534968 Bug 515756: Allow extending classes to provide getFilterExtension
This affects the synchronizer as it now should defer to the manager
to get the filter extension, instead of trying to load it directly.

Change-Id: I0e646f115ba089453c56f2cc356a4e0a99a1a3b7
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-04-25 12:08:22 +01:00
Jonah Graham
fffe6bbf80 Bug 515653: Fix SWT disposed exception
Change-Id: I2d39961189552602464ee96e0464eba060fcfb03
2017-04-24 07:35:06 -04:00
Jonah Graham
1670530ffb Bug 515307: Run test order of magnitude faster
Remove massage timeouts for places waiting for no events
This is a partial revert of c19640498d
which was part of Bug 499784.

Change-Id: Ib66ed5eaf45977d4ffae77358deaf1f593e005c6
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-04-15 03:43:52 -04:00
Jonah Graham
54f2d8770f Bug 515307: Run test order of magnitude faster
The test was much too conservative on how long it waited for an event
to arrive. On my machine the time was 10 ms, so I set a baseline time
to wait of 100 ms allowing time for additional event to arrive.

Change-Id: Ic435d360e8781936682c19b838aeec13fa3d60bd
2017-04-15 03:43:07 -04:00
Jonah Graham
18a6002f07 Bug 515304: profiles to parallelize testsuite
Change-Id: I02095334c2176bfb9a2968d91b6175af37123f5b
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-04-14 20:03:36 -04:00
Marc Khouzam
868db5b9b6 Bug 512180: Ensure previous launch is fully terminated
DsfTerminateCommand leaves a timeout job on the executor queue, remove
it proactively so the executor doesn't sit around just waiting
for it to terminate.

Change-Id: If26411a5b6e0d35a1c45582e91ba62d24cef6bbb
2017-03-27 15:08:46 -04:00
Marc Khouzam
a66ccee4f0 Bug 379225: Address FindBugs issues for DSF-GDB
Change-Id: Id0bb91c7aaef0e356d1989e1dc949542813d2309
2017-03-23 13:59:28 -04:00
Simon Marchi
184747164d Various enhancements to download-build-gdb.sh
I ran shellcheck [1] on the script and it found various minor things to
improve.

 - Use $(...) instead of `...` to run commands in a subshell.
 - Wrap all variables in quotes, in case there are spaces.

At the same time, I noticed a few other things:

 - Use "#!/usr/bin/env bash" instead of "#!/bin/bash", in case the user
   uses a bash not at /bin/bash.
 - Use "set -o errexit" instead of "set -e" for better readability.
 - Use "set -o nounset" to generate errors if trying to read unset
   variables.
 - Pass CXXFLAGS in addition to CFLAGS, since GDB is now in C++.
 - Use ${CFLAGS:-} instead of ${CFLAGS}, in case CFLAGS is not set
   (because of "set -o nounset").
 - Don't check for result of getopt.  If it fails, the script ends
   immediatly due to errexit.

[1] http://www.shellcheck.net/

Change-Id: If73f3510e46ca80d542d47c29c55b48b8b0bc697
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2017-03-23 13:33:45 -04:00
Jonah Graham
87c75513e0 Bug 400628: Add extra info to error message
Change-Id: I8102f1ad0fd6f2fc9f83bba8606098cf8f19b893
2017-03-07 15:26:57 -05:00
Mikhail Khodjaiants
cf51cb6b13 Bug 367256 - Debugger doesn't handle invalid breakpoints properly
Change-Id: I4a86015c61164edf9a7840acb40b7b74a4cf8e61
2017-03-07 11:34:58 -05:00
Jonah Graham
6ca1d5cc28 Bug 512180: Ensure previous launch is fully terminated
This has two parts.
1) In the base test itself check that the executor is shutdown.
2) GDBBackend leaves a timeout job on the executor queue, remove
it proactively so the executor doesn't sit around just waiting
for it to terminate.

Change-Id: I9fc10f70031430f4613e0edc95093a60cf695e90
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-03-07 09:21:15 -05: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
808df2490b Make MIExpressionsTest.testUpdateOfPointer use SyncUtil
Modify MIExpressionsTest.testUpdateOfPointer so that it only uses
synchronous methods.  There is no change of behavior intended, the test
should do pretty much the same thing as before, but should be a bit more
readable.

One difference is that we don't need to re-create the
IExpressionDMContext objects when we want to re-evaluate the
expressions (after stepping the 2nd time).  We can just call
getExpressionValue on the again, which will trigger a -var-update.

Change-Id: I09bb914b097888bf3146df0096eb9d824441ffa8
Signed-off-by: Simon Marchi <simon.marchi@polymtl.ca>
2017-03-06 10:44:14 -05:00
Jonah Graham
7e71d2b9b9 Bug 512180 and Bug 501906: Minimize unstable tests
As deleting launch configurations has a race condition that can
cause them not to become undeletable, only delete them for the tests
that they really need to be deleted for.

Change-Id: I040cbc83ba29a9f3a791b0bf4348a3179792ec65
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-03-04 05:35:33 -05:00
Bruno Medeiros
5a71bf21d8 Bug 449104: Enhance Register Grouping for multi processes
This patch adds support to GDBRegisters for persisting the register
group configuration on a per-process/per-core basis. The default
behavior of GDBRegisters is not modified. Instead, subclasses must
override getPersistenceIdForRegisterGroupContainer(IContainerDMContext)
to enable the new behavior, and provide a persistence id that is stable
across launches.

Update: fixed bug in RegisterGroupDescriptor.getContainerId()

Change-Id: I284df3ee215d9a4a9f72f3dca9aba5c16ca4b850
Signed-off-by: Bruno Medeiros <bruno.do.medeiros@gmail.com>
2017-02-28 15:41:10 -05:00
Marc Dumais
5a384894c6 Revert "Bug 512303 - [tests] job debug-tests-master-all-gdb-versions has issues"
This reverts commit ad845e6c3a.

Change-Id: I58e75b3a59b87c3a718aa9cd8fd56afd5188161f
2017-02-17 14:43:04 -04:00
Marc Dumais
ad845e6c3a Bug 512303 - [tests] job debug-tests-master-all-gdb-versions has issues
Disabling test suites MIExpressionsTest and StepIntoSelectionTest for
GDB < 7.5. 

Change-Id: I93b7739fc8c93a90f205122f6332754e99f739ca
2017-02-16 14:10:15 -05:00
Alvaro Sanchez-Leon
1517b88854 Add a default file to enable/disable tracing for the debug tests
The dsf.debug.options file can be updated to
run o.e.cdt.tests.dsf.gdb with debug information by changing its
corresponding value from "false" to "true".

Change-Id: I1faa5fdb2bfd11ce3e6e599e2cbeefcfa19ce3b6
2017-02-15 17:29:38 -04:00
Alvaro Sanchez-Leon
40aca4d51d Bug 511243 - Tests validating program-interrupt using CLI or MI
The tests validate the use of CLI (i.e. Ctrl-C) or MI (i.e.
-exec-interrupt) to interrupt the target program.

The MI command is used when the target is running in async mode,
which is mandatory when using the Full CLI console.

At the time of writing, async mode is not supported for Windows and
MAC, therefore these tests rely on a new mechanism to override specific
DSF-GDB services.

Change-Id: Ie4ab30f07640d112fff9aec2b4f348a27bfe188b
2017-02-15 16:52:22 -04:00
Marc Khouzam
c0e72388c7 Allow tests to use GDBs with versions of the form 7.12.50.201702140
Change-Id: I97e5cc7d6a702d743eba2d90bd73df8de3375de4
2017-02-15 11:04:18 -05:00
Marc Khouzam
78c9a0bb5e Validate GDB version in debug tests
Change-Id: Ic8f0b7494a19d20630536dd992ed035f52f0f3e7
2017-02-14 11:01:23 -05:00
Marc-Andre Laperle
0046099052 releng: Make use of Tycho POM-less functionality
This removes a lot of pom.xml from the source tree. This is using the
"POM-less" Tycho functionality.
See
https://wiki.eclipse.org/Tycho/Release_Notes/0.24#POM-less_Tycho_builds

One advantage of this is that you do not need to update the version in
the pom.xml when you change it in the MANIFEST.MF because the pom.xml is
automatically generated. This also reduces a lot of the duplicated
information and pom.xml repetition.

- Maven 3.3 and up is required.
- Only eclipse-plugins and eclipse-features can be pom-less.
Repositories, target and others still have pom.xml.
- New parent poms are added because a parent is necessary directly one
level above the plug-in/feature that will have its pom generated
- Some test plug-ins had to be renamed .test -> .tests because it's
required so that it detects that it's a test plug-in
- Some suites were renamed so that they all use the same consistent name
"AutomatedIntegrationSuite"
- Profiles were added for the more common test configurations. They are
activated by the presence of simple .properties files that only serve to
activate the correct profile. The profiles:
  - One for UI tests (UI present and start in UI thread)
  - One for SWTBot tests (UI present and do not start in UI thread)
Other test plug-ins that are too different are kept intact and still
have
a pom.xml
- Fragments are kept intact since they all have different target
platform configurations

Change-Id: I9d73380eb766f547830c552daf08053a30b1845c
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-02-13 23:19:56 -04:00
Marc Khouzam
123508549d Add printouts to debug unit tests
Currently, the debug unit tests only print which GDB version is
requested
and only if tracing is enabled; we have run into bugs where we would
have greatly benefited in easily seeing what version of GDB was
actually launched.

This change makes each test print what version of GDB is requested
and which one is actually run.  It also makes the test print this
information
all the time, one line per test, instead of only when tracing is
enabled.

Change-Id: Id19d625170b4f956d6205929062c280ac3ecc3b8
2017-02-13 12:49:27 -04:00
Marc Khouzam
74d67c7b38 Method to allow customizing the line length in trace printouts
Change-Id: If89987dc3cbfce1d2a329968346b6a3908fa5196
2017-02-13 12:49:13 -04:00
Alvaro Sanchez-Leon
d06db08a30 Bug 506073 - Support address "range" when adding a memory watchpoint
Change-Id: If3130ed52df95b0481d95477727fc2f419251ade
Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
2017-02-07 13:52:25 -04:00
Marc Dumais
7dbe0de0fe Bug 511727 - NPE in org.eclipse.cdt.tests.dsf.gdb.tests.AutomatedSuite
Change-Id: I5f24d617e1577812ba86e44acf4228192f77ab7f
2017-02-07 09:57:15 -05:00
Marc Dumais
86189eeb86 Bug 510924 - Alt+Enter on breakpoint shows incomplete properties dialog
When using the "Alt-Enter" shortcut with a breakpoint selected, the
properties dialog that is created is missing some fields. This seems to
be caused by the fact that the dialog, when summoned in this way, is
created using a wrong context: an ICLineBreakpoint instead of the
expected CBreakpointContext. That context is then used to fetch
properties from the store, which fails.

This is a naive fix that attempts to work around this by creating a
proper context from the breakpoint.

Change-Id: I2b7c86965d09898dd1cd7eeb3c3f704bb2995e20
2017-02-07 10:55:19 -04:00
Marc Dumais
7f6e7f8c9b Bug 510615 - Launch dialog, handle spaces in gdb path
The path to GDB is set in the launch dialog, under the Debugger tab. If
the path to GDB contains one or more spaces, and is not within double
quotes, GDB will not be found and the launch will fail. 

This patch improves the use cases around the "Browse" button, to select
GDB's path. 

1) if the user clicks on the "Browse" button, the browse dialog will
open in the correct place, no matter the presence of space(s).
2) When GDB's path is selected with the "Browse" button, it's then set
in the "GDB debugger" field. This patch looks at the selected path and
adds surrounding double quotes if there is any space within, and strips
any double quotes if there are no spaces. 


Change-Id: I202f574772965af3a491d449b9e9a97e8c61e2b0
2017-02-07 09:48:23 -05:00
Alvaro Sanchez-Leon
f6f53aa705 Bug 511243 - MI async mode shall not be activated for all cases when
using GDB 7.12

This solution makes the following changes:

* With GDB 7.12, use async mode as long as the Full GDB console is
supported or if the launch is configured for Non stop mode

* with GDB 7.12, don't always use MI to interrupt the service, use the
CLI when the async mode is off

Change-Id: I92c466e028b400f9054298739cd80efac18bd03a
2017-02-06 15:09:32 -05:00
Jonah Graham
e93de453f8 Bug 509897: Use View Management for Debugger Console
Change-Id: I509d3b5679e2ab236f8cd09b122ffae603a5fc51
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2017-02-06 06:15:19 -05:00
Marc-Andre Laperle
02a04cebad Fix API errors with Eclipse 4.7
- Adding default methods can now be ignored
- Adding fields is now an error but we probably want to ignore this
because it is quite restrictive

Change-Id: Ie57c69f54c64e4913d1498b02e86d00c93f8101a
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-01-30 14:11:36 -04:00
Marc Khouzam
d941a275b4 Add JUnit test to verify a query is answered as expected.
Change-Id: I603a89822e1fcbb1e7126150fd8e4de17fd7a141
2017-01-27 09:32:24 -05:00
Marc Khouzam
8d0a0717e2 Auto-generate source features using tycho.
This commit removes explicit source features and has tycho create them
automatically, along with all other source features that were not
previously defined.  The logic to auto-generate is in the root pom.xml

For all pre-existing source feature, the name presented to the user has
been changed to use the default name used by Tycho, which is "Developer
Resources".  This will provide a more standard user-experience with
respect to other source features built by Tycho.

Existing SDK features are kept for backwards compatibility.

All the names of the auto-generated source features that replace an
existing source feature have stayed the same except for the
'testsrunner' feature; for that one name change, a p2.inf file is added
to allow upgrading from the old named feature to the new named feature.

Change-Id: Ie632e798c93898fd828f88df4983fc43e2749d22
2017-01-25 16:14:03 -04:00
Marc Khouzam
add2a14628 Bug 507950 - Answer query on MI channel to avoid GDB waiting forever
With GDB 7.12, it is possible to receive queries on the dedicated MI
channel.  This channel is not accessible or shown to the user so if we
don't answer, GDB will wait forever.

This patch blindly answers 'y' to any query on the MI channel unless it
has already been answered automatically (which happens when we don't use
the full console).

Change-Id: I0e208fc3495ce6ba57b3e477661f47e50680fd88
2017-01-24 18:15:49 -04:00
Marc Dumais
6d85d40cb8 Adding GDB 7.12.1 to the download-build-gdb.sh script
Change-Id: I52125b13ac3af41b8063fc8dff408d09bbb4c2a6
2017-01-23 10:58:37 -05:00
Marc Khouzam
bfea9deb90 Bug 303808: Example of ConsolePageParticipant for Debugger Console
This commit also enables a richer set of enablement checks when
contributing ConsolePageParticipants to the Debugger Console view.

Change-Id: I34aa010fd9cfa91f24781e2bef5ba41b9525eab0
2017-01-19 15:40:47 -05:00
Marc Khouzam
c8ce2587e8 Bug 303808: Update ConsolePageParticipant for GDB process
This patch officially limits the ConsolePageParticipant to handling
consoles from the platform's console view, and not any consoles from the
new Debugger Console view.  The code currently behaves like this, but
this patch cleans it up and no longer even checks for GDB consoles.

The ConsolePageParticipant used to provide two things for the GDB
console, when it was part of the platform's Console view:
1- it would select the GDB console when the GDB process was selected
2- it would provide a 'save' button for the GDB console

For #1, when the GDB process is selected in the debug view, this patch
selects the same inferior console as when the launch is selected which
is the last inferior console. As for the synchronization of the Debugger
Console views, it is already handled by each console itself.

For #2 the save button must be handled differently based on the
different type of debugger console (basic vs full).  This should be done
in another commit.  Besides, the code, before this patch, was not adding
the save button to the debugger consoles since those consoles are not an
instanceof org.eclipse.debug.ui.console.IConsole as first checked in
ConsolePagePartipant#isConsoleGdbCli()

Change-Id: I0813ad2261633ce8630ab5842f06a047868856e8
2017-01-19 15:27:33 -05:00
Marc Khouzam
d780df14c2 Bug 303808: Make it easier to extend Debugger Console pages
To perform actions on the GdbFullCliConsole, it is important to provide
access to the terminal widget.  This patch adds the new method
GdbFullCliConsolePage#getTerminalViewControl() to give access to the
ITerminalViewControl.

Also, to be consistent with the platform's ConsoleView, this patch also
adds the same groups in the toolbar.  Namely
IConsoleConstants.LAUNCH_GROUP and IConsoleConstants.OUTPUT_GROUP.
Extenders can use these groups to add their buttons to the Debugger
Console view.

Change-Id: I217ce54ada63796de776c6b4cb6b925c3feb7eea
2017-01-19 11:02:17 -04:00
Alvaro Sanchez-Leon
1afc08fea8 Bug 507336 - Dynamic Printf parameters format may not be clear
The Properties dialog displayed for a Dynamic printf breakpoint
display a "printf ("  field, however the end parenthesis is not added
and not expected as part of the parameter list as the ending parenthesis
is added internally.

If the user adds it to complete the opening parenthesis the printf does
not work.

This update adds a validation to this field so if the user adds a final
parenthesis, the dialog will display an error message and the OK button
will be disabled.

Change-Id: Ib25c5a11176c6f92c7367246483be0f703e145bd
2017-01-17 13:43:16 -04:00
Alvaro Sanchez-Leon
028eb67a17 Bug 509895 - GdbBasicCliConsole left running after platform shutdown
when launch fails

Change-Id: I5879f5ed770e63c11077e091f18c5766b243bd88
2017-01-17 12:49:15 -04:00
Marc Khouzam
be7ee1e018 Must use DSF Executor to fetch service.
Change-Id: I3750fe262a3c507d26fb761fa6adad0b715313c3
2017-01-14 08:15:47 -05:00
Marc-Andre Laperle
6adc3c29a6 Bug 509737 - Disable full GDB console on Mac
Until we can figure out a nice fix for it. See bug for the findings
so far. Hopefully this will just be a stopgap.

Change-Id: Id4f7d91645fd25b140d3eb256da5ebdedc1d0e3f
Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
2017-01-06 11:23:44 -05:00