Commit Graph

517 Commits

Author SHA1 Message Date
hjk
7c29ae462b Debugger: Fix crash in combined debugging
Fixes regression introduced in f8ad72deb3: Slave engines don't
have a RunControl pointer of their own, use the master pointer.

Change-Id: I1c695a1454cafc3532fb1b79374fac4f3ead607e
Reviewed-by: hjk <hjk@qt.io>
2017-02-28 08:00:05 +00:00
Tobias Hunger
f8ad72deb3 Debugger: Report PID back to RunControl
Change-Id: I4830d2703de86c3fce8356271a2262c14c8f1307
Reviewed-by: hjk <hjk@qt.io>
2017-02-27 12:34:03 +00:00
hjk
66b19f334d Debugger: Provide a startup customization hook for 3rd party plugins
Change-Id: Ia587abcb1bdcdfbf192d3314610ec9addf370c9b
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-01-23 14:48:28 +00:00
hjk
3e8a1ea7ad ProjectExplorer: Move ProcessHandle to Utils for further re-use
Also, use qint64 instead of quint64, as this is what Qt uses.

Keep 0 for invalid PIDs, even if arguably -1 would be better,
but Qt uses 0, too.

Don't move 'toString', instead inline it into the only
caller, keeping translations intact.

Task-number: QTCREATORBUG-17596
Change-Id: Ie9411ea1d2031a5ab0a99bcb3ff48ee430afe254
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-01-17 11:19:12 +00:00
Eike Ziller
589fedf455 Merge remote-tracking branch 'origin/4.2'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/projectexplorer/kitinformation.cpp

Change-Id: I94299b069418586db97d1d596a252794e4037556
2016-12-20 17:14:19 +01:00
hjk
fc01d0ac46 Debugger: Use new shared result reporting infrastructure
Unify the watchPoint() interfaces, move the combined
implementation to the DebuggerEngine base.

Change-Id: Ic93aa760e7258197aed5eb7bfea257a40012cccf
Reviewed-by: hjk <hjk@qt.io>
2016-12-16 07:41:43 +00:00
hjk
26331f771a Debugger: Avoid messagesboxes on the same topic at the same time
Task-number: QTCREATORBUG-16971
Change-Id: I625f04cbd8f609c66597450dbad22ebc6eadcfe5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-12-14 14:10:14 +00:00
Orgad Shaneh
9c09ca9e42 Merge remote-tracking branch 'origin/4.2'
Change-Id: Ia98031eb87f1859c3736faa0cdd8b655e8a50689
2016-11-14 11:17:13 +02:00
Orgad Shaneh
f572f7da39 Debugger: Prevent popup on shutdown when debugger is running
* Run a debugger (of any kind)
* Close Qt Creator window
* When prompted to shutdown choose Yes
* An error message box appears with "Unexpected GDB exit"

This is not a real solution, but a quick hack to make the error message go.

2 soft assertions are also hit on this case:
SOFT ASSERT: "state() == EngineShutdownRequested" in file debuggerengine.cpp, line 1130
Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine") "InferiorShutdownRequested"
*** UNEXPECTED STATE TRANSITION: Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine")
"State changed from InferiorShutdownRequested(16) to EngineShutdownOk(21) [master]"

SOFT ASSERT: "state() == InferiorShutdownRequested" in file debuggerengine.cpp, line 1068
Debugger::Internal::GdbTermEngine(0x55ef651cea30, name = "GdbEngine") "DebuggerFinished"
UNEXPECTED STATE: 22  WANTED: 16 IN gdbengine.cpp:1841

They are *not* addressed in this patch.

Task-number: QTCREATORBUG-16770
Change-Id: I419f134e527a154dfbe1c85a3fd6629597a363f0
Reviewed-by: hjk <hjk@qt.io>
2016-11-14 07:37:53 +00:00
Frank Meerkoetter
e3b38b8a34 Fix dead stores in the debugger plugin
Found via the clang-static-analyzer

Change-Id: Ic461a8c369bef60081f7c2dfd9d6a778c64dbda0
Reviewed-by: hjk <hjk@qt.io>
2016-11-07 16:56:47 +00:00
Ulf Hermann
d771ba8921 Debugger: Don't clear unrelated views when updating locals
If the list of partial expressions is empty we need to tell the watch
handler that we are only updating the locals view, not e.g. the
inspector view.

Change-Id: Iedc74ffc66a8435faa272d053849b831f6b8cbbe
Task-number: QTCREATORBUG-16692
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-04 09:35:10 +00:00
Christian Stenger
ca3bcd811e Debugger: Provide way to process debuggee output further
Output coming from the debuggee was limited to be printed inside
the DebuggerLog and the Application Output pane, but the output
might be useful to process differently or even additionally to
the default logging.
Provide functionality to be able to add an output processor.

Change-Id: I715b90b28c64d3cf95bcc2a047a5aba1a56d1058
Reviewed-by: hjk <hjk@qt.io>
2016-08-31 04:39:16 +00:00
hjk
7c287eb6f9 Debugger: Drop Location::init()
We can do better with C++11.

Change-Id: Ie9e9cd4dfbbfc4ba29c0aa6bbfdf33ae7ac184fe
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-22 08:45:22 +00:00
hjk
588443b259 Debugger: Use a StandardRunnable for the debugger process
One step further to separate the debugger environment from the
inferior environment and to make it possible to configure a
working directory. Guessing one from the inferior's working
directory is not always a good idea.

Change-Id: I33d139c0f228ec0870556b82bc6aecca0a8e62d6
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-08-04 10:07:43 +00:00
hjk
6e925910b4 Debugger/BinEditor: Standardize interface
Change-Id: I4acf6bc7648e57c564e86023176ae3905a293a99
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2016-07-21 06:20:52 +00:00
hjk
2d79bdc29c Debugger: Remove some uses of semi-global currentEngine()
Make use of recent TreeModel improvements in various
tool views, push more operations into the engine-
owned data models, specifically context menu creation.

Change-Id: I479c97102b9fb81611c6461c6df1cec59295179a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-07-18 11:17:53 +00:00
hjk
2a104dcfe7 Debugger: Consolidate icon storage handling
We settled now on global objects being fine for the purpose
in Core and ProjectExplorer, so there's no point in using
something more fancy in the debugger.

Change-Id: I72e45f398c09d22894419c274dfbea77da0fc153
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-28 14:28:01 +00:00
hjk
5199f84f60 Debugger: Clean up debuggerengine.cpp
Some leftover stringfreeze workaround, plus QLatin1*.

Change-Id: I5e143af5cda64cb29b7769174187fc86185a89cb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-06-28 14:07:09 +00:00
hjk
78a800cb34 Debugger: Use dedicated structure for Qml server parameters
The main idea is to start using ProjectExplorer::Connection later.

Change-Id: Ie91eacdfb0e93ae142fec7ce32bcf554a5282122
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-14 06:25:34 +00:00
hjk
726b907cc3 Debugger: Remove debuggerstringutils.h
With QT_RESTRICTED_CAST_FROM_ASCII making GdbMi etc operate on
QString is feasible again. Take this as opportunity to move
debugger encoding handling closer to a 'conversion on input and
output if needed, storage in QString only' scheme.

Change-Id: I2f10c9fa8a6c62c44f4e6682efe3769e9fba30f7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-06-09 08:09:46 +00:00
Eike Ziller
73bb92c5a6 Merge remote-tracking branch 'origin/4.0'
Change-Id: I89c52ca2145a43c94d3366367ba72fde605dd577
2016-05-31 12:02:13 +02:00
hjk
74b6d2e708 Debugger: Clean up GdbEngine member data on finish
Restarting with cached outdated information is problematic.

Change-Id: I396da2fef96a161c1ab150134b8e65a758a16d58
Task-number: QTCREATORBUG-16355
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-27 12:34:20 +00:00
Eike Ziller
0c5bae640b Merge remote-tracking branch 'origin/4.0'
Change-Id: I80bc3371c6d7cf9f2d46cbcf8e79e4761213d8aa
2016-05-27 12:01:36 +02:00
David Schulz
0aca5808cb Debugger: Fix creator crash on spontanous debugger exit.
Task-number: QTCREATORBUG-16233
Change-Id: I27b9ab17243463924dc410b3b5ffb0795ef3e33c
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-19 05:00:07 +00:00
Eike Ziller
ec231b5910 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/valgrind/valgrindruncontrolfactory.cpp

Change-Id: I96c0f8cc3b49f8f55f45ef1f839857f878f532f4
2016-05-18 12:12:46 +02:00
hjk
e9e47ab452 Debugger: Allow re-evaluation of certain expressions without stepping
There are cases like changing an Evaluated Expression that make
re-evaluation necessary.

Change-Id: I51fe46b67399a59aebbdeb9c3e778795b1c52cf1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-17 16:01:52 +00:00
hjk
60f092f6bb Debugger: Cosmetics
Qt 5 connects, unused declaration, QLatin1Strings, ...

Change-Id: If09929993d750907ee3f4e2fa9f18acfcc28d9c1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-05-12 15:08:16 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
Christian Stenger
b2a3c4e48d Debugger: Fix expanding of watchers...
...that have not been looked up completely.

Task-number: QTCREATORBUG-16195
Change-Id: I163426ed8a7457e77584b1bb7d091f1d63954743
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-05-02 07:03:19 +00:00
hjk
a246e43220 Debugger: Make safety check safer
This amends change ad55631c.

Change-Id: If0679ee2f3559fd3d1b2ef57e7456a159dd25b3b
Task-number: QTCREATORBUG-16180
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2016-04-29 05:30:46 +00:00
Eike Ziller
4a826ada04 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	qtcreator.pri
	qtcreator.qbs

Change-Id: I0cbc9d335073e3234f472aa43f462eef9a9178aa
2016-04-22 15:13:58 +02:00
hjk
1827688dd0 Debugger: Use symbolFile for binary validation
In remote setups this is typically a local copy of the executable.

Change-Id: I2c4e38559245e7b2cb4a609b93d80fde2b999cec
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
2016-04-21 14:04:43 +00:00
Eike Ziller
ee8bf341c6 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/projectexplorer/session.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: I6946139f5e5fa3a9cdbb322fd50be248e2c0133f
2016-04-20 14:58:48 +02:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
hjk
ad55631cdf Debugger: Add safety net to avoid infinite lookups
Do not lookup the same item twice without intermediate stepping.

Dumpers could announce the existence of children but when asked
for them bail out or produced similar inconsistent output.
Better not depend on it.

Task-number: QTCREATORBUG-15352
Change-Id: I38532d08bb438b12b6eb202a06ff610670b1069f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-18 10:38:58 +00:00
Eike Ziller
5c87432260 Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp

Change-Id: I6ae2d37290643d69390f679a54f7596782f3d97f
2016-04-12 11:34:46 +02:00
hjk
e73a9c1b0d Debugger: Always sort local variables alphabetically.
It was there for GDB at a time, but never for the other backends.
Fix the GDB regression and make the sorting consistent across
backends.

Task-number: QTCREATORBUG-15296
Change-Id: If728c65f0c8ca4a8378c7cf5e53f1dadbfb72b29
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-11 09:35:07 +00:00
hjk
e9b1e493c2 Debugger: Move struct sorting logic to generic parser
Backends only have to specify whether an object members are sortable
in principle (e.g. all structs), and some numeric 'sortgroup' value
for member items (higher values are always sorted on top).

Change-Id: I10ce94580374fed48a35f058a575a1408d6801af
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-04-08 10:22:31 +00:00
hjk
d27d51050c Debugger: Use kit macro expander instead of global one where possible
This is low hanging fruit enabling a lot more customization.

Change-Id: I1a90fa731ea512852c12a55fad75551efb44e875
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-03-23 08:11:47 +00:00
hjk
a1926727cd Debugger: Compile fix
Change-Id: I6a2019898ad2259c78ec19c6914ddc689f6ef40c
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-03-11 10:16:28 +00:00
David Schulz
443e75ba69 Debugger: Warn on Inappropriate debugger.
Change-Id: Ib8777277032c5bd062ffaabd6281b6402576d0fe
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-03-11 09:13:08 +00:00
hjk
2cf0060596 Debugger: Use StandardRunnable in DebuggerStartParameters
This is a mechanical replacement for the former executable, processArgs,
inferiorEnvironment and workingDirectory members.

Change-Id: I4160e01427ed801df9b729f1f31d0a2ca48159b5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-28 14:15:54 +00:00
Orgad Shaneh
edb55e1f66 Debugger: Suppress qWarning for debug messages
The following message was observed when debug session is done:

  Warning: STUB EXITED EXPECTEDLY (no active run control)

Change-Id: I21778dd70659a0fe4105c386e1e1693a8b81ac05
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-25 07:48:00 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Ulf Hermann
1d7243e724 Qml Debugger: Support "evaluate" while engine is running
Newer versions of Qt can evaluate expressions without pausing the
QML engine. We can take advantage of that. At the same time we can
remove the crutch of using QQmlEngineDebugService for this. The
latter produces inconsistent and generally worse results than the V4
debug service.

Task-number: QTCREATORBUG-14931
Change-Id: Ic78d08a0b00cf7de3911b7b672ce229c6d779363
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-08 09:29:41 +00:00
hjk
7de7eb6bca Debugger: Work on WatchModel performance
Don't instantiate repeating boilerplate item data in some
cases (such as large arrays).

This makes it necessary to access parent WatchItems in
a lot more cases than before and needs another separation of
WatchItem/WatchModel code to keep the dumper autotests
in a functional state.

For a plain std::vector<int> with 1 mio items this reduces
 extraction time from more than 2 minutes to about 3 seconds.

Change-Id: I175c5f6ee90434a6e85342d8bb71bd10a04dd271
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-01-06 09:59:11 +00:00
hjk
8e702387e5 Debugger: Start separating different process environments
Debugger and stub run locally, the debugged process not necessarily.

Change-Id: Ibf6aec3dcaec60069866ec0765ec2178ca0a26d6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2016-01-04 12:33:47 +00:00
hjk
33651877d8 Move QmlConsole to Debugger
Now it is closer to its only user and possibly reusable for no-QML uses
there.  We also drop the QML/JS syntax checker. The application being
debugged can already tell us about syntax errors. There is no need to
duplicate that functionality.

Change-Id: I2ba151f9f4c854c6119ba5462c21be40bddcebf9
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 12:06:26 +00:00
hjk
2b16b97f19 Debugger: Make DebuggerEngine::runCommand() virtual.
Allows default implementation of e.g. stack retrieval in the base
class.

Change-Id: I96460b19aa31347b2c863736b4ce2b5046eb4de6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-11-04 11:48:05 +00:00
hjk
525c33f999 Debugger: Infrastructure for reworked native mixed debugging
- Remove old experimental native mixed approach.
- Move some common stack parsing to Stackhandler.
- Mark gdbbridge.py debug output explicitly to remove it
  from actual reponse handling

New native mixed needs QtDeclarative changes and
QTC_DEBUGGER_NATIVE_MIXED=1 for now.

Change-Id: I09eed1da51cea878636d36756015b7bfaed34203
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-10-09 05:19:45 +00:00