1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00
Commit graph

1413 commits

Author SHA1 Message Date
Marc Khouzam
25a42fbdce Bug 497592 - Wait for request to GDB for inferior name to be completed
GDBProcesses_7_0 would fetch the name of a process as soon as it learned
of the process through the =thread-group-started event; however, if
there was a call to IProcesses.getExecutionData() before the name was
received, the service would return the wrong name.

This commit fetches the name when IProcesses.getExecutionData() and uses
a CommandCache to do it.  That way, if a call to
IProcesses.getExecutionData() is made before the name is received, the
request will be cached until the name is available.

Furthermore, the cache allows to handle the case where the target is
unavailable, which can happen in all-stop mode and we disabled stopping
at main.

Change-Id: Ia75d3c677e189f87e9ec2864c744a870a0a18407
2016-07-20 11:08:10 -04:00
Marc Khouzam
0c87249a55 Bug 497349 - Reverse debug is always enabled when attaching to a process
Change-Id: I3761e57fb625cab31e013676d3eda7f214496918
2016-07-08 16:21:24 -04:00
Marc Khouzam
5a5e9872cb Bug 497206: Remote-attach fails attach if binary not specified in launch
The core exception we used to throw when the program patch was not
present is necessary for GDBBackend#getProgramPath() to set the path to
an empty value instead of returning null.

Although we could have made GdbLaunch#getProgramPath return and empty
string to fix this problem, I thought we should play it safe and behave
like we used to in case something else needed that exception thrown.

Change-Id: I4684226c731aedef50bdeb37accdf2a2feb818b5
2016-07-08 16:19:41 -04:00
Adam Ward
9b4dba0458 Bug 496415. Show reason for crash when core debugging.
Changes:
When a core debugging session starts a MIConsoleStreamOuput is received
by MIRunControlEventProcessor or MIRunControlEventProcessor_7_0 which
contains a string of the form "Program terminated with signal <signal>,
<reason>". The signal and reason are parsed from the string and a new
signal event created and dispatched. The label of the last executing
thread (one that received the signal) in the debug view then shows the
signal that caused the core file to be created

Testing:
Tested on Windows and a Lubuntu VM

Change-Id: I02fa4b2fe458005f159341fcbcaaaa2fe57a7871
Signed-off-by: Adam Ward <award@blackberry.com>
2016-07-04 14:09:17 -04:00
Marc Khouzam
61492f65a2 Create constant for initial GDB inferior 'i1'
Change-Id: Ie1c0f52b11ac60735365987c89468917e311bf82
2016-07-02 21:01:20 -04:00
Marc Khouzam
e52031c676 Bug 495623: Use new flags in =record-change from upcoming GDB release
With the next GDB (probably named 7.12), we are provided with the type
of record that was started.
  =record-started,thread-group="i1",method="btrace",format="bts"
  =record-started,thread-group="i1",method="btrace",format="pt"
  =record-started,thread-group="i1",method="full"

We make use of this information in GDBRunControl_7_10 to avoid sending
an 'info record' command.

Note that because MI adds fields in a backwards-compatible way, it was
much simpler to modify GDBRunControl_7_10 instead of creating a new
GDBRunControl_7_12 (whose name may even be wrong if GDB's next version
is not actually 7.12).

Change-Id: I869b3c0ff648d5e38081e06a7063613bbb9266dc
2016-06-27 16:03:00 -04:00
Marc Khouzam
783787af25 Bug 496818 - Cannot find executable if working directory is not default
Originally, to determine the program path, GDBBackend's constructor
would call:

   ICProject cproject = LaunchUtils.getCProject(lc);
   fProgramPath = LaunchUtils.verifyProgramPath(lc, cproject);
   
When we made the change in 192bfff688 we
didn't keep that logic and lost some functionality.

This commit re-instates the original logic.

Change-Id: Ifbee2273517c41ad6ebdc9980261ed36d651f130
2016-06-27 15:47:28 -04:00
Marc Khouzam
9e1e981b4d Move the rest of the CDT plugins to java 8
This change was generated using the script:
releng/scripts/ChangeJavaVersion.sh

Change-Id: I2ad96dc682a5acb8529c3edec40de279c331b5a4
2016-06-22 14:51:43 -04:00
Marc Khouzam
0c39193a39 Fix wrong javadoc
Change-Id: Ie4388f47fad9a1ed760fbe4576e01d408c0ca6ba
2016-06-20 14:24:00 -04:00
Doug Schaefer
5d2cbaaa1c Cherry picking changes from the CDT 9 branch for Qt and Arduino.
Change-Id: I85eca2b8bb0447d4dd703030c41d90c1f9bcdf89
2016-06-13 21:23:10 -04:00
Alvaro Sanchez-Leon
39007977fa Adding GDB 7.11.1 to the download-build-gdb.sh script
Change-Id: Ic22f35bb5bac2c3ac1fb394073b168d48259f4f6
2016-06-01 15:54:26 -04:00
Marc Khouzam
93fa9c00a6 Allow to more easily extend GDBControl service.
Change-Id: Iec5ef773222390237d4665fb9bd3daa5b3cae947
2016-05-26 09:39:18 -04:00
Jonah Graham
69d3441795 Bug 494504 - Reverse API changes to GdbDebugServicesFactory
This change reverses the breaking API changes made to
GdbDebugServicesFactory as part of Bug 488909 while retaining the
code cleanup done in that bug.

Change-Id: If269fa5e38e0c019a8f5ce9aa927f27da70f43ee
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-05-25 10:33:22 -04:00
Marc Khouzam
9655088708 Provide a timeout for query that might run in UI thread.
GdbReverseToggleCommand extends AbstractDebugCommand so as to be able to
block without risking a deadlock.  However, this only applies to
doExecute() and isExecutable().

GdbReverseToggleCommand has two other methods that use queries, and
those are at risk of a deadlock: isReverseToggled() and
getReverseDebugMethod().  Those queries must have a timeout to avoid any
risk of deadlock.

Change-Id: Ia410b8f102638965ccbf8ac9deda06dc4efc5f0d
2016-05-10 08:48:16 -04:00
Alvaro Sanchez-Leon
08d975066c Bug 492779: GdbLaunch#initialize() catches exceptions, then ignores them
Change-Id: I0d8dbdfbed2477517439466cd3f255ff8ce0fbd1
Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
2016-05-02 15:06:03 -04:00
Mikhail Khodjaiants
f3faebccce Bug 486955 - Add "Stop on startup" option to "Debug New Executable"
dialog

Change-Id: I3f29453e999e19d1e045fe73bc09fd9deb164ac7
2016-04-28 16:03:37 -04:00
Jonah Graham
b2300cbcfe Bug 485107: ensure correct adapter factory is being used
Ensure that the correct adapter factory is being used for each
adapter type.

Change-Id: Ibd401bb16c6320a49285cae4618a80a1bc318da3
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-04-27 17:14:03 +01:00
Alex Blewitt
12904409a3 Bug 492304 - Fix NLS warnings
Eclipse warns if a String literal does not have a `//$NON-NLS-<n>$`
entry at the end of the line. However, for historic or formatting
reasons, many such occurrences in the CDT source have an intermediate
whitespace, such as `// $NON-NLS-<n>$`

Fix these so that the whitespace is removed between the // and $
characters.

Change-Id: Idc12398fe6e9d619af1d0b1b73fb8b6180da223c
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-25 22:53:30 +01:00
Alvaro Sanchez-Leon
b2db3a489c Bug 489513 - Show registers in the traditional memory render
Change-Id: I9ddbbeb9c8345f006004d9d2982a778d28c6d68c
2016-04-25 17:03:49 -04:00
Alex Blewitt
6bdca5f4a2 Bug 492230 - Replace buffer.append(a+b) calls
When using a `StringBuilder` or `StringBuffer` to create a string message,
using implicit string concatenation inside an `.append()` call will
create a nested StringBuilder for the purposes of creating the arguments,
which will subsequently be converted to a String and then passed to
the outer StringBuilder.

Skip the creation of the intermediate object and String by simply
replacing such calls with `buffer.append(a).append(b)`.

Where values are compile time String constants, leave as is so
that the javac compiler can perform compile-time String concatenation.
Ensure that NEWLINE isn't appended in such a way since it is not
a compile time constant `System.getProperty("line.separator")`

Change-Id: I4126aefb2272f06b08332e004d7ea76b6f02cdba
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-25 11:38:47 -05:00
Alvaro Sanchez-Leon
e21fc12f90 Bug 489512 - Show local variables in the traditional memory render
Change-Id: I48d633e8f6979fd91e9150856fd77fccffdee299
2016-04-24 21:39:15 -04:00
Alex Blewitt
2356a29c70 Bug 492200 - Replace StringBuffer with StringBuilder
There are many opportunities for replacing `StringBuffer` with
`StringBuilder` provided that the type isn't visible from the
public API and is used only in internal methods. Replace these
where appropriate.

Change-Id: Ic2f50c5b6f3c3a4eae301bb3b40fb6faed235f79
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-21 22:17:03 -05:00
Alex Blewitt
2114f6b108 Bug 491984 - Replace .equals("") with .isEmpty()
In many cases a String's empty status is tested with `.equals("")`.
However, Java 1.6 added `.isEmpty()` which can be more efficient since
it compares the internal length parameter only for testing. Replace
code using the `.isEmpty()` variant instead.

Some tests for `"".equals(expr)` can be replaced with `expr.isEmpty()`
where it is already known that the `expr` is not null; however,
these have to be reviewed on a case-by-case basis.

Change-Id: I3c6af4d8b7638e757435914ac76cb3a67899a5fd
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-19 13:35:54 -04:00
Alex Blewitt
470de4e66b Bug 491945 - Remove new String() from expressions
Replace all occurrences of `new String(expr)` with `expr` provided that the
`expr` is not a byte array or a char array.

Change-Id: Iecae801b83084908b60b9e146eba87550eac640d
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-18 23:34:01 +01:00
Alex Blewitt
ca4e5b10ee Bug 491945 - Remove new String() literals
Occurrences of `new String("...")` have been replaced with a direct reference
to the literal it was wrapping.

Change-Id: Iefb49a009f210db59e5724e0a232dba2e13292b1
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-18 23:30:05 +01:00
Alex Blewitt
809598db9d Bug 491945 - Remove new String()
Occurrences of `new String()` have been replaced with the equivalent `""` and
additional NON-NLS tags have been inserted in where appropriate.

Change-Id: I54cf71dcd0d5a92a675a71166d66949533de502b
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-18 23:15:05 +01:00
Alex Blewitt
fc07efa909 Bug 491825 - Remove primitive wrapper creation
Using `new Integer` and other wrapper types such as `new Character` results in
potential extra heap utilisation as the values are not cached. The built-in
`Integer.valueOf` will perform caching on numbers in the range -128..127 (at
least) using a flyweight pattern. In addition, parsing `int` values can be done
with `Integer.parseInt` which avoids object construction.

Adjust tests such as `"true".equals(expr)` to `Boolean.parseBoolean(expr)`.

Change-Id: I0408a5c69afc4ca6ede71acaf6cc4abd67538006
Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>
2016-04-16 12:17:48 -04:00
Sergey Prigogin
b91b69775f Bug 491825 - Remove uses of new Boolean and friends
Change-Id: Ie358c8385c278472f3b86851f6fc219007bb9b5c
2016-04-15 15:20:15 -04:00
Jonah Graham
6f249f12c1 Bug 472765: Restore test comments post refactoring
During the testsuite refactoring that significantly improved the DSF
suite (Commit 528de33113) some info
was lost from the code. This resurrects those comments.

Change-Id: I0a11dee2dcabb0800306880fc7c6217374bc337a
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-04-13 11:41:28 -04:00
Marc Khouzam
f9d3a184aa Replace hard-coded versions with constants
Change-Id: I8653157bd1d351eb07f58b4b404edfdaaa0e756e
2016-04-07 15:44:44 -04:00
Marc Khouzam
ddf2dea0aa Provide Supported and Unsupported lists of GDB versions
Allow to easily run only Supported or Unsupported tests

Only run Supported versions in test suites

Change-Id: I0d628c8aea28dad77df7943b8b1ee18df5bb6bcf
2016-04-07 15:40:26 -04:00
Marc Khouzam
519e1c91ab Cosmetics
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
2016-03-31 18:45:30 -04:00
Marc Dumais
90a56a1e7d Bug 489278 - [disassembly] hover does not work for registers
Change-Id: Idc547e93d1e1f4a4085ce0f1e846964780065043
2016-03-30 09:41:49 -04:00
Marc Khouzam
6d5e31038c Bug 488661: Simplification of reverse debugging code
Most changes are cosmetics (name of local variables, javadoc, etc).
The note-worthy ones are:

1- Change terminology in IChangeReverseMethodHandler to be a little clearer.
This causes changes in multiple files, but it was all automated.

2- Remove ReverseDebugMethod.INVALID which was used as an error code
and not a ReverseDebugMethod value.

3- In GdbReverseToggleCommand, provide a different error message
if there is a failure to set ProcessTrace vs BranchTrace and tell user what to do.

4- Reworked GdbReverseToggleCommand#getReverseDebugMethod in attempt
to make the code easier to understand.  No actual change in functionality.

Change-Id: Ibdc14faff1220e6a20319644b49e641c2101e762
2016-03-29 08:59:41 -05:00
Alvaro Sanchez-Leon
82b74d3cb6 Bug 489398 - Support memory spaces in IExpressionDMAdress
When an address is resolved from an expression, the resulting address
may carry a memory space provided by the backend to associate
this address to a particular memory space.

The current interface for the memory space service (e.g.
IMemorySpaces2) can be used to parse the memory space contained in the
expression.

This update adds:
1) A new API method to resolve the memory space of an
IExpressionDMAddress instance
2) The use of the memory space service to attempt to resolve the memory
space.

Note: if there is no memory space service, the memory space defaults to
an empty string, which does not affect the default behaviour i.e.
when memory spaces are not used.

Change-Id: Idfe5669b26f84ee4e3e78f96f229ced75e6ec5c3
2016-03-23 21:17:51 -04:00
raddepal
7a73b0035f Bug 488661 - Moving the last trace method to GdbReverseToggleCommand
This patch solves Bug 488661 by moving last trace method to
GdbReverseToggleCommand. Since it is instantiated on a per session
basis.


Change-Id: Idafa196c7af36373ca08d5fc7de63024fe824c2b
Signed-off-by: raddepal <ravitheja.addepally@intel.com>
2016-03-23 08:56:19 -05:00
Alvaro Sanchez-Leon
16b3fbcfd6 GDB Automatic remote launch, NP Exception check
Null pointer checks were missing in GdbLaunch e.g. to cover the case
when the instance is not fully initialized e.g. invalid gdbserver path.

Change-Id: Ie5b593417aa831cb5b35b19f31d2b0a03b1fdc86
Signed-off-by: Alvaro Sanchez-Leon <alvsan09@gmail.com>
2016-03-22 15:23:17 -05:00
Marc Khouzam
9781f7bfa8 Don't require gdbserver to be present for local tests to pass
The TraceFileTest.java file has three tests which depend on each other.
Inter-dependency between tests is not good.  This commit removes it.

Change-Id: Id910a5cea741c85959679e4b0a6981f603f19d13
2016-03-22 16:16:11 -04:00
Marc Khouzam
c58c554e3a Bug 489777: Remove method returning thread as ints
Method MIThreadListIdsInfo#getThreadIds() has been removed.  MIThreadListIdsInfo#getStrThreadIds() should be used instead.

Change-Id: Id6fb924a96b193012eaae0c8811b386873cd411c
2016-03-20 07:28:52 -05:00
Alvaro Sanchez-Leon
ba6eb9e0f0 Bug 489777 - [API] Replace thread id type from int to String
in preparation for the introduction of thread groups syntax in GDB,
thread id needs to be handled as a String.

Change-Id: I379a92de9755ba0532265519ee70d1e199de811b
2016-03-19 21:03:51 -04:00
Jonah Graham
a56abb4783 Bug 472765: use Strings for backend path in Map Entries
Preserve the user supplied backend path as a string so that it matches
what GDB (backend) later reports as a file name to resolve.

Condensed history:

Traditionally in source mapping container, the backend path was stored
as an IPath and that was used to compare against the debug information
being returned by GDB. This worked well when the platform compiled for
matched the platform run on, but when there was Windows/Linux together
that did not work. So as part of Bug 393791 a workaround was done to try
and use hand crafted MapEntrySourceContainer.createPath() instead of
Path constructor to preserve some of the differences. This solution had
its limitations too as UNC paths still could not be represented, See
open Bug 386675.

Change-Id: I4c8f62114a2c6019dc9d07ce446ac424be8b230c
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-03-19 19:44:19 -04:00
Marc Khouzam
8d4ea57654 Bug 488950 - Remove "New..." button from 'Connect' dialogue
Change-Id: Ia60e7a9e1e6d211bbe4c137f3ff5f7368ab68e83
2016-03-19 19:38:27 -04:00
Marc Khouzam
11c94f2755 Bug 489683 - Fix typo while changing API
Change-Id: I1e5e5f92564c486e2f14da9a7f3a4e15598ba069
2016-03-19 13:05:12 -04:00
Marc Dumais
c0109d378d Bug 489683 - Change the breakpoint "number" from an int to a String
Change-Id: I33a8ca95f6894c360c95260433945cdf1b529bc3
2016-03-18 22:21:21 -05:00
Alena Laskavaia
1cb7faae95 Support -Dcdt.tests.dsf.gdb.versions=all for gdb tests
Change-Id: I7b0921f3dfc41e75f2f32b270712c0eda7fc96a4
2016-03-18 22:31:20 -04:00
Jonah Graham
25023542e8 Fix version range check in SourceLookupTest
Change-Id: Ief38312449c67073c6a6503f27807b455fa4066c
Signed-off-by: Jonah Graham <jonah@kichwacoders.com>
2016-03-18 22:30:33 -04:00
Marc Dumais
16ed5ea208 Bug 489216 - [memory view] memory space sometimes wrongly set, during
the restoring of memory monitors

Change-Id: Iab8554aef0ca24d2643440f1ba845eb253e29676
2016-03-18 12:43:32 -04:00
Alena Laskavaia
528de33113 Flattening rest of gdb tests
this commit removes and merges rest of gdb tests in favor of using
parametrized tests

Change-Id: I352545c2ea3d76154c8079f8efa9aa5d4a3e0032
2016-03-18 09:39:45 -04:00
Marc Khouzam
e977bb4953 Bug 472765: Add extra sourceLookup test
Change-Id: I98c11a2f4e231d6bc0e0bb53ea1e0b3465c9a976
2016-03-18 06:30:41 -04:00
Marc Khouzam
7856453f30 Bug 488909: Unify services factory classes to extend more easily
From org.eclipse.cdt.debug.gdbjtag.core, constructor
GdbJtagDebugServicesFactory.GdbJtagDebugServicesFactory(String)
has been replaced by
GdbJtagDebugServicesFactory.GdbJtagDebugServicesFactory(String,
ILaunchConfiguration)

From org.eclipse.cdt.dsf.gdb, constructor
GdbDebugServicesFactory.GdbDebugServicesFactory(String)
has been replaced by
GdbDebugServicesFactory.GdbDebugServicesFactory(String,
ILaunchConfiguration)

From org.eclipse.cdt.dsf.gdb, class GdbDebugServicesFactoryNS has been
removed and its logic was merged into class GdbDebugServicesFactory

Change-Id: Ifecba752cfc12da62f1447027b11c0bb1f7c0171
2016-03-17 14:31:45 -04:00