qt - QML stack trace during crash -


my project qt gui application in views in qml , models , business logic in c++. size of project has grown 100's of cpp , qml files debugging has becoming more , more difficult. in debug mode crashes produced in c++ code found stack trace linked source-code presented, crashes due qml code produces grayed out stack-trace (ie., pointing qt internals etc in cannot see qml file , line producing error).

do know anyway that?

using: c++11, qt/qml 5.2.0, qt creator 3.0 on mac (clang++, lldb combination) , windows (mingw g++ 4.8.0)

if put breakpoint on javascript function in qml file breakpoint hit during course of debugging, problem when application crashes, i've no way of knowing qml file/line have participated in crash , can't put breakpoint beforehand - should show in stack-trace not (only shows grayed out stack-trace)

i'm not sure it's possible. however, see this email simon on development mailing list:

the nature of beast have 2 language environments here , (and can't) share same stack, stack traces separate. there ways of determining "current" javascript stack trace in parallel. note isn't possible qt 5.1 or older, starting qt 5.2 possible.

friedemann kind enough lay infrastructure in qtqml , used on qt creator side, in way used kde's drkonqi:

it require little bit of analysis , interaction gdb, think it's doable. require looking @ frames gdb reports, , if see functions take qv4::executioncontext * parameter, can extract "address" gdb output , call qt_v4stacktrace function in qtqml within gdb. print out javascript stack trace. works rather , qt creator 3.1 provides through context menu in debugger, if you'd try out yourself.

this way bug reports in kde somehow involve qt javascript execution can - in parallel - include c++ backtrace , js stack trace.

this provides little bit of context why debugging qml applications way is.

i think referring load qml stack option in creator:

since call stack leading current position may originate or go through code no debug information available, not stack frames have corresponding source locations. stack frames without corresponding source locations grayed out in stack view.

if click frame known source location, text editor jumps corresponding location , updates locals , expressions view, making seem program interrupted before entering function.

to find out qml file causing qt quick 2 application crash, select load qml stack in context menu in stack view. debugger tries retrieve javascript stack stopped executable , prepends frames c++ frames, should find any. can click frame in qml stack open qml file in editor.

it may not useful, there's console.trace(). link links debugging qt quick projects.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -