How to browse my own source code in QtCreator debugger - debugging

during debuging with QtCreator I cannot browser my own source code. I build qt sources with the debug option and as you can see the filenames of the qt source code itself are visible and I can browse them with no problem. But somehow the CONFIG+=debug has no effect on my build.
build output:
Running build steps for project tcpconnector...
Starting: "/usr/local/Trolltech/Qt-4.7.4-DEBUG/bin/qmake" /home/user1/server/src-server/server.pro -r -spec linux-g++-64 CONFIG+=debug
The process "/usr/local/Trolltech/Qt-4.7.4-DEBUG/bin/qmake" exited normally.
Starting: "/usr/bin/make"
...
In the screenshot from the QtCreator debugger you can see that my own code Server::deleteDuplicateConnection is grayed out.

Like written in the comment. This just seemed to be a random phenomenon.

Related

Where are Gradle detailed logs when building Flutter application in debug mode?

I am debugging my Flutter application and sometimes I get Gradle build errors. That's fine, some configuration is incorrect.
However it is difficult to find the actual problem as the debug console is not displaying any details, such as which row is breaking the build.
There's no error trace.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
* Error running Gradle:
ProcessException: Process "C:\Users\<USER>\Projects\<app>\android\gradlew.bat" exited abnormally:
Command: C:\Users\<USER>\Projects\<APP>\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Exited (sigterm)
Where, or how, can I see the Gradle logs when building a Flutter application in debug mode?
Here is a print too.
You should edit your $HOME/.gradle/gradle.properties file by adding:
org.gradle.console=verbose
and run
flutter run -v
Here a piece of output in VSCode
You can open the Android part of your project with AndroidStudio to help you understand the gradle errors.
With IntelliJ or VSCode, you just have to right click on android folder and click "Open in Android Studio"

LLDB 3.9.0 Crashing (CLion)

here is a link to a C++ (CLion) project. I've distilled/simplified the issue down as much as I could.
The problem is that when debugging, LLDB (version 3.9.0) crashes.
Steps to reproduce crash:
Open project with CLion 2017.1 (use built in LLDB for debug)
Compile the Project
Place breakpoint in main.cpp line 14
Run in debug mode.
Once you're at line 14 breakpoint, then output the variable "an_integer" via the "print an_integer" command.
Crash
The Error/Crash Report:
Assertion failed: (D->getCachedLinkage() == LV.getLinkage()), function
getLVForDecl, file
/Applications/buildAgent/work/92515a49514b3993/lldb/llvm/tools/clang/lib/AST/Decl.cpp,
line 1360.
Note that this crash occurs with LLDB v3.9.0 on Mac v10.12.4. But it does not occur with LLDB 3.7.0 on Mac 10.12.4.
Ultimately, I'm wanting to know if I'm doing something dumb in my project code? If not, is this a bug with CLion or LLDB? Is there somewhere that I should post this to help get the bug (if it is that) resolved?
That doesn't look like your bug. For some reason lldb is having trouble ingesting the type information produced by the compiler.
I don't have clion so I can't try that, but if I just build your test project, either with a PCH or without, using clang from Xcode 8.3 I don't see this crash. Best thing to do is to build this project with CLion, then make a dSYM (if CLion doesn't do this for you.) You do that by running:
> dsymutil TestingLLDBBreaking
Check that you can reproduce the crash with the dSYM, and if so then file a bug with http://bugreporter.apple.com with the executable and the .dSYM.
So I had the same problem for a while.
just before almost formatting my mac I've re-cloned the project to a different directory and ran it from there. No issues. (i'm sure its a mac-os thing).
Good luck :)

Extra verbose output from mdtool?

I'm working on a project in Xamarin.iOS, and it happens to go through a build server (running on a Mac).
The build seems to commonly fail, but even with the --verbose or -v it seems to Silently fail. For example, right now, it seems to fail after optimizing the graphics for iOS. The last line of the build says Build complete -- 0 errors, 0 warnings. But then I get a Build step 'Execute shell' marked build as failure from Jenkins. I know that this is a failure in the mdtool build, because I have had a successful build before, and I know there are several more steps before it actually succeeds.
The next step in the successful process should be Compiling to native code, but for some reason it fails before getting to that, or at least outputting it to the console.
Thanks in advance for the help!
There's a few places in the mdtool build logic that didn't properly catch exceptions when executing shell programs which I (hopefully) fixed for Xamarin Studio 4.0.2.
Without seeing the full build log it's hard to say for sure, but it might be that whatever shell command that it is trying to execute either doesn't exist or isn't marked with execute permissions.
The programs that I can think of off the top of my head that mdtool will invoke for the iOS builds are:
pngcrush (optimizes .png files)
plutil (optimizes .plist and .strings files)
codesign (although this one gets called after compiling to native code)
and of course, mtouch which is what is used to compile IL to native code. The mtouch command is part of Xamarin.iOS while the other 3 utilities are part of Mac OS X (or Xcode).
The solution for the other person with a similar problem that I helped debug a week or 2 ago was because he had modified his PATH environment that launchd launched apps with to not include /usr/bin and so mdtool couldn't find the utility programs listed above.
I'm not very familiar with Jenkins (I know we use it at Xamarin, but I'm not part of the team that does), so make sure that the PATH environment that it launches mdtool under is setup to include /usr/bin.
Hope that helps.

jom.exe error when building a Qt project on Windows

I'm trying to build my Qt project on Windows, however something called jom.exe prevents the build by crashing.
12:15:44: Running build steps for project webimage...
12:15:44: Configuration unchanged, skipping qmake step. 12:15:44: Starting:
"jom.exe" qtcreator_ctrlc_stub:
Command line failed: jom.exe 12:15:44:
The process "jom.exe" crashed.
Error while building project webimage
(target: Desktop) When executing build step 'Make'
The projects build just fine on Mac and Linux and since it's been quite a while since I used Windows for anything I'm not sure on what to do here.
What I'm I missing here? Thanks.
As I said I am unfamiliar with the windows development stack but as it turns out jom can be replaced by nmake which worked perfectly for me.

How to build wxWidgets 2.9.1 with Visual Studio 2010?

I have a freshly downloaded Visual Studio C++ 2010 Express and wxWidgets 2.9.1. The build folder under wx\build\msw has solution files for VC++ versions 6 through 9 (2008).
I tried to open the latest solution, wx_vc9.sln. It converted all the projects with a bunch of warnings. When I try to build every project gets the error:
C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5):
error MSB6001: Invalid command line
switch for "cmd.exe". The path is not
of a legal form.
Trying to open the previous version of the solution, wx_vc8.sln, generates the same conversion warnings and the same build errors.
I Googled for some hints and found a suggestion to start with the .dsw file. I opened wx.dsw and it generated an error for each of the project files:
D:\3rdParty\wx\build\msw\wx_wxregex.dsp
: error : Project upgrade failed.
Finally in desperation I tried nmake /f makefile.vc and was greeted with yet another error:
NMAKE : fatal error U1077: 'cl' :
return code '0xc0000135'
Anybody have any hints? Thanks.
There are two ways of solving this, firstly if you update to a more recent version of the wxWidgets SVN trunk this is fixed (and so it will be fixed in 2.9.2 when it is released). If you don't want to work from trunk of wait for 2.9.2 then if you do a find and replace over all .vcxproj files and replace
>$(INTDIR) $(OUTDIR);%(AdditionalInputs)
with
>%(FullPath);%(AdditionalInputs)
it should then compile fine.
For future reference, trust me people, avoid all nonsense and start up your Visual Studio 2010 Command Prompt and navigate to [wxwidgets directory]\build\msw
Then compile using the makefile with the following command :
nmake -f makefile.vc BUILD=release MONOLITHIC=0 SHARED=0 UNICODE=1
Of course change the options as needed.
You will be saving a lot of trouble this way, this is the way I did.
The Key to Compilation using Visual C++ 2010 Express and wxWidgets 2.9.3 is to keep Pressing F7 Again-and-Again-and-again.... till you you get '0 Failed' Message below. Because many Projects have dependencies which are not satisfied immediately, so it is necessary to keep compiling with 'F7' till all are satisfied.
Download wxWidgets. I downloaded the .7-Zip File (only 12 MB ! ), and installed it at C:\wxWidgets The Structure should be like so that you see the following Folders like C:\wxWidgets\lib and C:\wxWidgets\build etc etc...
Basically the process should be to go to C:\wxWidgets\build\msw , and open wx_vc9 Solution File for VC-2008, and convert it to VC-2010 when asked. Then Choose 'DLL-Release Win32' on Top, and Press F7. Wait for Compilation to take place and see the Message. Then keep Pressing F7 again and again till you get '0 Failed' Message below. Then you would want to Compile 'DLL-Debug' Release in the same manner.
The compiled DLL Files can then be found at C:\wxWidgets\lib\vc_dll. Now, To Add vc_dll Folder to your PATH, Right-Click on My-Computer -> Properties -> Advanced System Settings -> Environment-Variables -> User-Variables. Search for 'Path' -> 'Edit', and then Just Append ;C:\wxWidgets\lib\vc_dll to the End.
This makes running your compiled Application easier, as your .EXE can now easily find DLLs.
When you are packaging, then you obviously need to bundle specific Release-DLL'S along.
Then you can compile the Samples located at C:\wxWidgets\samples.
I just go to individual Project Folder, like for e.g. C:\wxWidgets\samples\drawing, and Open drawing_vc9 Project, then Convert it as Prompted, and then hit F7 to create Release Version. Now if you go inside C:\wxWidgets\samples\drawing\vc_mswudll\ Folder, you have your 'drawing.exe' ready-to-be-run !
Have fun !
Use the wx.dsw, took me a while to finally get it but it'll build fine after that. I also suggest using one of the sample projects such as 'minimal' as the base and just fix all the config paths to match what you want to build (as manually setting up I encountered issues).
If you already used the wx_vc9 (like you said you did) you are probably best off just deleting all of wx and restarting with it and using wx.dsw like I said above.

Resources