Commit Graph

517 Commits

Author SHA1 Message Date
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
Ulf Hermann
e4594eec13 Debugger: Log connection failures to QML/JS console
The debugger log is not very accessible and people may want to see this
message.

Change-Id: Id5e5a6d84f3576df3756d1fabc9f5801dcebac6e
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-09 10:32:59 +00:00
Ulf Hermann
a8aa527500 Debugger: Don't manually break the connection error message
The message window can do that by itself and in other places we may
want to print the whole message in one line.

Change-Id: I5f0891c7b81717182d17b83f5a62ab06ad168801
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-12-07 14:55:50 +00:00
Oswald Buddenhagen
100ea30a1a Merge remote-tracking branch 'origin/3.6'
Conflicts:
	src/plugins/projectexplorer/toolchainmanager.cpp
	src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp

Change-Id: Id736c6922670c921c689219cb817b1541eaaf304
2015-12-02 18:42:05 +01:00
Ulf Hermann
b9adbffe6f Debugger: Proactively try to connect to QML port in mixed engine
Just like with the QML-only engine we might not get the output for a
variety of reasons. As we've specified the port on the command line,
it's likely that the application will start listening at some point,
though.

Change-Id: Ifda69ba15c659cf95e708d35bed34cfb9b3c40ec
Task-number: QTCREATORBUG-15409
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-11-30 08:58:02 +00:00
Ulf Hermann
81eea72d44 QmlDebug: Simplify error and state signaling
There is no point in sending two signals for every state change and
error. Also, the signals only reflect events in the socket, not in the
logical connection.

Change-Id: I617a925c69164aa1a02a7781b9da7dca55daa304
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:46 +00:00
Ulf Hermann
47317eff60 QmlDebug: Rename some members of QmlDebugConnection
This is to adopt the naming to the code in src/qmldebug in
qtdeclarative. Once we can require a version of Qt that has qmldebug
for building QtCreator we can then remove our own version of this code.

Change-Id: I573f0703871b5812789c5c7a6287567d5c2875e6
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:42 +00:00
Ulf Hermann
a3e4a28bee QmlDebug: Unify QPacket and QmlDebugStream and remove unused code
There is no point in having both as they serve the same purpose. Also,
most of the packet protocol API was never used or tested, and wrapping
each byte to be sent into a QPacket is wasteful and unnecessary.

Change-Id: Ia421eae33b644fe86a53bcd04092a84ea3000f0d
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2015-11-19 11:32:39 +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
Jean Gressmann
378cd56d75 Permit the use of the QML debugger on non JS/QML files
Change-Id: I1574f553c937bd4759b20ca5f0d22582087800cb
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-23 11:54:20 +00:00
hjk
e298500379 Debugger: Remove remains of QmlEngine live update feature
Change-Id: Iaa77f9d9af103046841637862b8aacdc6b0342c7
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-09-18 13:04:52 +00:00
hjk
eb4d98e178 Debugger: Remove virtual layer of sendMessage() calls in QmlEngine
Change-Id: I7a5f335e8401d01bb3085b9512a878b67109feae
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-09-17 11:26:15 +00:00
Ulf Hermann
d5707e0e32 Debugger: Use Qt's JSON encoder for debugger protocol
The V4 debug service expects correct JSON as input and gdb, lldb, and
pdb expect Python object literals. There is a subset of JSON that is
also valid as Python object literals and we use that for the protocol
spoken with gdb, lldb, and pdb. The strings passed to CDB are tunneled
through JSON strings and converted to byte arrays before sending them.

Change-Id: I87319b5450e5c3c3b29c565b75cddaa612767611
Task-number: QTCREATORBUG-14931
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-09-15 08:28:14 +00:00
hjk
7d3bb6fdee Debugger: Remove some unneeded calls to resetLocation()
Since resetLocation() is called when the repective actions are
triggered immediately before the engine's executeFoo() are called
there is no need to call them in executeFoo() again.

Also, remove the unused autoContinueInferior(); function.

Change-Id: I8d2ec419c0da6efa388ce1ed317f31d24654897f
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
2015-09-15 06:00:25 +00:00
hjk
156320ff6c Debugger: Merge QmlInspectorAdapter into QmlInspectorAgent
There's a 1:1 relation, and the abstraction is not needed anymore.

Also remove some unused code.

Change-Id: I09a2522deb5d522f46ec7518d19978a038032fbb
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-08-28 07:37:19 +00:00
Ulf Hermann
b5717a5315 QmlJS: Lazy-load console items to allow for recursion
Using Utils:TreeView automatically gives us the capability for loading
item as they are expanded. This way we can show recursive structure in
the console as well as load data from the debug server on demand.

Also, properly print error messages received from unsuccessful
command evaluations.

Task-number: QTCREATORBUG-14931
Change-Id: I66d440eedd9723b04670169b27db1ee18f3f2891
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-25 14:42:22 +00:00
Eike Ziller
8eaaef96aa Merge remote-tracking branch 'origin/3.5'
Change-Id: I65968dd02ea6bdd15f304ae567dd0c02238e6949
2015-08-20 13:23:13 +02:00
Ulf Hermann
3fbf54df83 Debugger: Properly handle JavaScript null
null is an object in JavaScript. This is slightly insane, but hiding
it in the debugger view doesn't help.

Change-Id: I69fe317f28a515785720104f92306f69a2e56266
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-20 10:23:53 +00:00
hjk
63d182f052 Debugger: Fix retrieval of Locals Views subitems in QML debugger
Previously, only the first level of properties was expanded,
properties of object type could not be expanded further.

This can be reproduced by opening the SameGame example,
putting and triggering a breakpoint at startNewGame(),
expanding the 'this' entry in the Locals view and checking
the 'component' subentry.

Change-Id: I6cf714af697ab4eebd7eb0ae0ea37e516b3ea635
Reviewed-by: Robert Loehning <robert.loehning@theqtcompany.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
2015-08-14 10:30:08 +00:00
Sergey Belyashov
007daabff5 Fix i18n problems
In the QmlEngine, a few tr() have been replaced by
QCoreApplication::translate().
In other files, Q_OBJECT has been added to the class definitions.

Change-Id: Ia0505c19934dc691cd3d67f4946293290c2fec68
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-23 19:19:06 +00:00
hjk
ff63fd113a Debugger: Quote strings in QmlEngine
Task-number: QTCREATORBUG-5670
Change-Id: I1cfad65042369d9e34c19dc4a7f00a37dbe6fed4
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-21 06:41:28 +00:00
hjk
38d2baa2dd Debugger: Ask JS debug server to evaluate(something) only when stopped
The server on the Qt side Q_ASSERTs otherwise, killing the application.

Change-Id: I273f12c4bc89bd3488fa6409fdbebc6a6ac2b606
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-17 12:41:57 +00:00
hjk
799461ee7a Debugger: Fix evaluation of "this" item in JS debugger
Change-Id: I88a502f044fca4c842c21563988d0a95e128c664
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 13:00:56 +00:00
hjk
f77f6e2144 Debugger: Make QmlEngine heed "Sort Struct Members Alphabetically"
Change-Id: Ib24e62c60eea4b0af355c3e93e48a78dc0b51efc
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 12:19:12 +00:00
hjk
63c5fc034b Debugger: Split updateWatchData() paths
There are two cases that do not coincide in asynchronous
engines such as the QmlEngine: Inserting a new watch item,
and expanding the children of an existing item.

Change-Id: Ic98a5f1e89aca37146039a241de737c407606e83
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 08:05:36 +00:00
hjk
66964ac91c Debugger: Rework QmlEngine watcher expansion
Use callbacks in QmlEnginePrivate::evaluate(). This separates the
four code paths through the machinery into three separate handlers
and one direct access to the console.

This also fixes a bug where items were put into 'debuggerCommands'
but attempted to be removed from 'updateLocalsAndWatchers'.

Introduce a QmlEngine::updateLocals similar to what the other
engines do. Let the frame() and assignValue() paths use it.
Keep track of pending changes and call notifyUpdateFinished
if and only if the pending lookup queues is empty.

Finally, remove some dead code.

Change-Id: I173a52911d0de994b849fc6ab4f52ef7f64a8ba5
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 07:21:34 +00:00
hjk
1adbcc03f8 Debugger: Start using callbacks in QmlEngine commands
Version, Backtrace, Frame, Scope and Lookup for now.

Change-Id: I615c8f8c00484e9bb1742485f24bdfc537f83021
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-16 06:10:46 +00:00
hjk
967aad78de Debugger: Store parsed data in QmlEngine's refVals cache
No need to re-do it each time the reference is used.

Change-Id: Ie90101df8f2b0f5e31c6a18af7cac165d060c5fe
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-14 12:29:34 +00:00
hjk
4816ad2125 Debugger: Cache handle->value pair in QmlEngine
Needed in preparation to determine the time of a needed
watchHandler()->notifyUpdateFinished() deterministically
which in turn is needed to get the update cycle of
evaluated expressions right.

This will also save roundtrips later.

Change-Id: Id90101df8f2b0f5e31c6a18af7cac165d060c5fe
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-14 09:41:18 +00:00
hjk
2e256e5223 Debugger: Remove remaining direct uses of QmlEngine::sendMessage
Ready to introduce callbacks.

Change-Id: If26566ed71ce1283f9f42b62e75a1c793a21ef32
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-13 13:42:51 +00:00
hjk
92f4ea3f79 Debugger: Use DebuggerCommand in QML engine
... instead of manually set up JSON. It's more concise, and paves the
way to use per-command callbacks as in the other engines.

Change-Id: Ib5cf9c9b882ec0ec87acd7c1ceb938d3ee60346b
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-13 09:06:16 +00:00
hjk
6682df0709 Debugger: Rename and shuffle some QmlEngine functions
One more step to make it more similar to the other engines.

Change-Id: I0f028bf55b980c8acee9d80875ed5e9b4b565980
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-10 09:10:09 +00:00
hjk
bcd29daa48 Debugger: Consolidate QmlEngine
Create a QmlEnginePrivate. Move the QmlDebugClient there.
Merge QmlAdapter into QmlEngine Abstraction is not used anymore.

Move some helper bits to a qmlengineutils.{h,cpp}

Change-Id: I63117355d786cc12641101b7fd38c7cd208d11eb
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-09 12:59:03 +00:00
hjk
0e7e521a0a Debugger: Merge {baseqml,qml}debuggerclient.
Abstraction is not used after the demise of QScriptDebuggerClient
and unlikely to be used again.

Change-Id: Icdd6615eb0d1468fd9a3d717d6a7d5e44f7f7d79
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-07-09 10:27:37 +00:00
Christian Stenger
0898cde602 Debugger: Remove a soft-assert from qmlengine
Change-Id: I8c9dc2e8691f3ae3c7bed7ffface8f229ce89203
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-07-07 08:10:52 +00:00
hjk
5309e217e4 Debugger: Consolidate GDB and LLDB "updateLocals" code paths
This splits the bool setToolTipExpression() operation into
a bool canHandleToolTip(), and the actual processing of
the request, which is mostly identical to the handling of
a watcher.

Handling a watcher is now mostly the same as a full Locals
update, except for the 'partial' flag. Pushing the handling
of that down to the bridges gives identical code paths
in the gdb and lldbengine. Move that to the
DebuggerEngine base class.

Change-Id: I3861b43e8630c7e7bd57fcd549b2a2387e3d4869
Reviewed-by: hjk <hjk@theqtcompany.com>
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
2015-06-10 07:40:27 +00:00
hjk
244cdb7804 Debugger: Split off runtime-only items from DebuggerStartParameters
Right now, DebuggerStartParameter is part of the debugger plugin
external interface. Better not make it fatter than necessary.

Change-Id: I3b9205089f971dd314ccba1335b5ca2d4d9fe7c6
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2015-05-28 08:54:48 +00:00
hjk
b3f88df41d Debugger: Remove most remaining occurrences of WatchData
... in WatchHandler and DebuggerEngine interface.
Adjust using code.

Change-Id: I6371f3e96ba46a783e23a5767cdde24a10d3fce7
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-20 08:36:57 +00:00
hjk
46fcfa9018 Debugger: Remove widget argument from tooltip request
The only information ever used is whether it's c++ or not.

Change-Id: I4ca00663856dd66cbdf58c468f175a8c9e41d6a5
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-06 13:57:53 +00:00
hjk
34c807a11a Debugger: Remove WatchUpdateFlags
Only needed in the non-Python days. CDB didn't use it to start with.

Change-Id: Ia609218cc1a694f797e278c4d99ead68e6212938
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-06 13:55:55 +00:00
Christian Kandeler
07e9c44171 Debugger: Fix build.
Change-Id: Ic92e5854535a668f49f5e49a51d190132d27e9e6
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-26 16:45:31 +00:00
Friedemann Kleint
991cf84991 Clean exported headers of the Debugger plugin.
Change-Id: I70ca6773e0f6aa6d80a441f8920d7f5d2418e1bf
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-26 14:49:20 +00:00
Christian Stenger
4602fdb52f QmlEngine: Avoid accessing null pointer
Change-Id: I41ff4508ae609f481a5a20e4b398e106f2d3093d
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-26 14:44:55 +00:00
Eike Ziller
56aadc407d Merge remote-tracking branch 'origin/3.3'
Conflicts:
	src/plugins/debugger/watchhandler.cpp
	src/plugins/projectexplorer/kitmodel.cpp
	src/plugins/qbsprojectmanager/qbsprojectmanager.cpp
	src/shared/qbs

Change-Id: I6a68090993a264e93ac7850858cc24ba6bdb5602
2015-02-12 17:36:29 +01:00
Eike Ziller
9926fc2ab1 Merge commit '3c85058694ee2e41658d17f524fb48f0b187d2fe'
Conflicts:
	src/libs/utils/tooltip/tipcontents.cpp
	src/libs/utils/tooltip/tipcontents.h
	src/plugins/android/androiddeployqtstep.cpp
	src/plugins/baremetal/baremetalconstants.h
	src/plugins/baremetal/baremetaldevice.cpp
	src/plugins/baremetal/baremetaldevice.h
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwidget.h
	src/plugins/baremetal/baremetaldeviceconfigurationwizard.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.cpp
	src/plugins/baremetal/baremetaldeviceconfigurationwizardpages.h
	src/plugins/baremetal/baremetalplugin.cpp
	src/plugins/baremetal/baremetalplugin.h
	src/plugins/baremetal/baremetalruncontrolfactory.cpp
	src/plugins/baremetal/baremetalruncontrolfactory.h
	src/plugins/cppeditor/cppcodemodelinspectordialog.cpp
	src/plugins/cppeditor/cppdoxygen_test.cpp
	src/plugins/cppeditor/cppdoxygen_test.h
	src/plugins/debugger/breakpointmarker.cpp
	src/plugins/debugger/debuggeritemmodel.cpp
	src/plugins/debugger/debuggeritemmodel.h
	src/plugins/debugger/loadcoredialog.cpp
	src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
	src/plugins/projectexplorer/addnewmodel.cpp
	src/plugins/projectexplorer/addnewmodel.h
	src/plugins/projectexplorer/jsonwizard/jsonfieldpage.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.cpp
	src/plugins/qmlprofiler/abstracttimelinemodel.h
	src/plugins/qmlprofiler/notesmodel.cpp
	src/plugins/qmlprofiler/qml/CategoryLabel.qml
	src/plugins/qmlprofiler/qml/MainView.qml
	src/plugins/qmlprofiler/qml/Overview.js
	src/plugins/qmlprofiler/qml/Overview.qml
	src/plugins/qmlprofiler/qml/TimeDisplay.qml
	src/plugins/qmlprofiler/qml/TimeMarks.qml
	src/plugins/qmlprofiler/qmlprofilertimelinemodelproxy.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.cpp
	src/plugins/qmlprofiler/sortedtimelinemodel.h
	src/plugins/qmlprofiler/timelinemodelaggregator.cpp
	src/plugins/qmlprofiler/timelinemodelaggregator.h
	src/plugins/qmlprofiler/timelinerenderer.cpp
	src/plugins/qmlprofiler/timelinerenderer.h
	src/plugins/qmlprojectmanager/QmlProjectManager.json.in
	src/plugins/texteditor/findinfiles.cpp
	src/plugins/vcsbase/vcsconfigurationpage.cpp
	src/shared/qbs
	src/shared/scriptwrapper/interface_wrap_helpers.h
	src/shared/scriptwrapper/wrap_helpers.h
	tests/auto/qmlprofiler/abstracttimelinemodel/tst_abstracttimelinemodel.cpp
	tests/system/suite_debugger/tst_debug_empty_main/test.py
	tests/system/suite_debugger/tst_qml_js_console/test.py
	tests/system/suite_debugger/tst_qml_locals/test.py

Change-Id: I67540b648f8b162496f4aa606b04d50c7c9125c6
2015-02-12 17:29:21 +01:00
Orgad Shaneh
4e8e75d88e Debugger: Remove unneeded qualifications
Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I1aa1a2b6ccbafeb1a8f3053fffa39b3f96992591
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-02-04 08:52:39 +00:00
Kai Koehne
40ba5f947b Disable broken debugger tooltips for QML
Looks like the proper handling of tooltips while debugging a QML app
is broken since commit 7f09d0b756 . Just disable the functionality
for now.

Task-number: QTCREATORBUG-13854
Change-Id: I346058f6f9753475ec209ec8befdd5425bbd83d0
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-30 18:57:04 +00:00
Eike Ziller
3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00