Can not see values of locals in QtCreator debug mode - c++

I am working on a Qt5.7.0 (using C++ 4.9.1) project for which I am using QtCreator 4.1.0 as IDE. When running the application in debug mode, I am trying to find out the values of Locals and Expressions on a BreakPoint. But I can't see the values . It shows some values which are not so important for me (Screenshot added for reference).
As you can see, there are some QStrings, values of which are not being shown, instead it's showing the addresses, I think. Same things also happening even for int.
Is there any way to fix this?
FYI, it used to be perfect even 2 days ago. I don't know what got changed accidentally.

In the Menu Bar, Go to Tools, the Options. Then select Debugger in the Left Pane. Now select Locals and Expressions Tab. I think, you have Use Debugger Help Checkbox unchecked.
Screenshot
Check this checkbox. I think, the problem will be solved.

Related

netbeans debugging pretty display string/vector

is there any way, that the debugger in netbeans directly shows me the content of string variables?
Currently, If I press on the small "+" left of the variable name it shows me things like "npos, _M_dataplus, _M_string_length ...". It would help a lot to simply show me the content of the sting instead.
Same happens if I have a vector. In this case it is really a pain to debug variables becaus I always have to search for the content...
(I use NetBeans IDE 8.2)
Thanks
image

Is it possible to type in variables in the Xcode debugger to check what they are?

I've done my fair share of searching, but the problem lies in the fact that I don't know all the nomenclature surrounding the debugger, so I'm unsure of what this function is called.
In my programming class, we use Visual Studio. In it's debugger, you can type in a variable name at any point and see what it's value is.
Is there a parallel version of this in Xcode? I can't seem to find it.
Option 1:
Add a breakpoint to the point where you would like to check the value. When it stops there, click on console screen. Type the following:
po yourVariableName
Option 2:
Click on "Show debug Area". Now tap on "Show Variable Area". You can see values on run time for each variable in action.
For more detailed reading, read this question.

Xcode project won't display std::string in debugger anymore

I have an Xcode project that will not display C++ std::strings when I am debugging. It's incredibly frustrating because I am having to resort to print statements or outputting each character one at a time in the LLDB console window, which is time consuming and hard to read.
Every other person using this same project is having the same problem, and other projects are not seeing this problem, so I would think that this is a project setting of some kind. I'm in debug and there are no optimizations turned on, so I've eliminated that as the issue. I've also compared project settings between working projects and the one with this problem and they appear identical in every way that they can be.
Here's a sample of the output I get, *_M_p in this example is correct, the first character of the string is a question mark:
And here's what I get in the debug console if I inspect the string one character at a time:
I've heard that switching back to GDB from LLVM might solve the problem, but GDB gave me other issues with debugging certain data types, so I'll just have new problems in that case.
My co-worker figured out the fix for this: Turn off the Guard Malloc option in the scheme settings.
Click the scheme that is exhibiting the problem
Click on Edit Scheme
Click on Diagnostics
Uncheck the 'Enable Guard Malloc' option.
Now std::strings should be showing up. We don't know why this is the case, it may be a bug in Xcode, but I would think it would've been spotted awhile ago. Also, this was tested on multiple projects and enabling Guard Malloc always causes std::strings to not show up properly in debugger.
Try this lldb command
exp -f s -- myString
You are telling the lldb to show the expression of your string with the format c String
This might not have caused the original poster's problem, but it caused mine: I was using Xcode 6.4 while most of the code had been built with 6.2. Switching to 6.2 made the values visible in the debugger.
Try this command
po string_name

Eclipse Debugger doesn't show the value of a long string in whole

I'm using Eclipse Juno to debug a Django app. However, a long string gets cropped when inspecting the variables in PyDev's debugger:
The content area of the variable is scrollable, but the value suddenly stops there with the dots (see picture). Clicking the variable or watching it doesn't help. This is not a huge problem, but is there an easy fix for this?
See discussion and answer here. Essentially, work around the limitation by typing the variable name into the debug console and it will print out in full.
You can change maxlength. It is a Integer.

Visual Studio 2010 Improperly underlining code/comments with red error line when there is no error

I am working on a rather large project, and I am having strange problems with the IDE in terms of error checking and somewhat with IntelliSense.
Usually if I were to type something boneheaded, like "int a = "aa";", it would underline "aa" in red. However I am seeing VS do this to random parts of my code when I make insignificant changes.
For example:
/*
Some comment here, just going to stretch it out for my example..
*/
int proto1();
int proto2();
If I make changes to other parts of the project, sometimes random functions will get underlined, and even part of a comment. Like just 30 minutes ago it underlined the equivalent of half of that comment beginning in the middle of the word "comment", also it underlined all of int proto1(); and part of int proto2();
I would post screenshots but I am bound by contract not to disclose any work, and I can't easily replicate it in smaller projects.
I don't understand why it does this. When I compile the project, any fake errors and underlining it did goes away and it compiles fine. The point though, is there are no errors. It's making up random errors and underlining random lines/words/half words. I would also like to note that there seems to be a large delay in loading new intellisense information, almost by 2-3 minutes or longer.
I'll try and reproduce it in an unrelated project and post here if I can. However, any help would be appreciated.
Thanks!
*Edit: Forgot to note that hitting the space key several times will on occasion correct the errors however this isn't reliable and does not always work.
Intellisense sometimes can really get stuck with complicated code. I guess until VS2012 release comes out, there's nothing we can do.
There's however one trick that I'm using if this happens - switch your build configuration Debug -> Release and then back again. You don't have to wait, you can just click two times on this drop-down box. It should refresh IS cache and make red error underlines dissappear.
Intellisense is often off, but make sure you have latest updates installed.
I just installed sp1 yesterday and lot of Intellisense issues went way.
I see this is a stale question but some may find this helpful.
I just had this same issue. I tried many of the solutions outlined here and elsewhere. I finally tried running Visual Studio as another user (Shift Right Click Run As Different User) and the issue did not present. I then logged into my computer as another user and deleted the profile of the user I was having the issue with.
If your profile is important to you or there is information within it that is important I highly recommend backing up relevant information first. If you don't understand what information you profile contains make sure you do prior to deleting it.
1) Log in as different user (with admin privileges) than you want to delete
2) Open Properties for Computer
3) Advanced system settings (on the left side)
4) Settings for User Profiles (in the middle)
5) Select the profile you want to delete and click the delete button
6) Reboot
Credit to:
https://superuser.com/questions/63017/how-do-i-delete-a-user-profile-on-a-windows-7-machine-that-is-part-of-a-domain
I had the same issue, and in my case it was mostly related to library functions and types defined in libraries. This one fixed it for me:
Open command line parameters. You can use following to reach there:
Project > ProjectName Properties > Configuration Properties > Linker > Command Line
In the Additional Options box at the bottom add
/I "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include"
You will of course need the correct path where Visual Studio is installed.
Bingo! I hope it works for you too. :)