netbeans debugging pretty display string/vector - c++

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

Related

Why isn't my terminal running my updated C++ code?

I am a new programmer and I am trying to use the terminal on my Mac to compile and run the C++ code I write using the Sublime text editor.
I am able to get my code to run using the terminal, however, whenever I make changes to my code on sublime and then re-compile it on my terminal, my terminal doesn't recognize my changes and keeps on running my original code.
Does anyone know what might be happening?
Thank you so much!
I can think of two possibilities that spring immediately to mind. If you're changing your code in the editor, and that's not being reflected in the compilation, then it's likely to be one of the following. Either:
you're not saving the file in the location you think you are; or
you're not saving the file at all.
The easiest way to tell if one of these is the case is to introduce an error into your code(a), like:
int my hovercraft = full of eels;
and make sure the compiler complains about it.
If you're not saving it at all, do so. If you're saving it in the wrong place, you can usually find out where just by doing a Save As and seeing where the default location is.
If you're annoyed that you have to save, and that computers should just "work"(b), Sublime Text has an auto-save feature that may come in handy, courtesy of one Lucy Bain. Instructions (paraphrased) are duplicated here in case that site ever disappears:
Open Sublime
Find Settings and edit the user window (under Sublime Text 2 > Preferences for Mac, just Preferences for Windows).
Add the line "save_on_focus_lost": true.
Save and close the file.
At that point, whenever you click away from a particular file, it should save it.
(a) Some developers seem to have little trouble doing this without even trying :-)
(b) A not unreasonable expectation for a Mac user :-)

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.

what is a good editor besides eclipse for printing clojure code?

I like clojure and use textmate/sublime text but every time I print out the source code, it is not syntax colored and the lines are all messed up. Is there an online/offline editor that does the job? I don't want to load up eclipse everytime I want to print something
I've printed code from Emacs before quite successfully. M-x print-buffer ought to do it.
You might also be able to paste your code at refheap and click the 'maximize' link and print from there, but it doesn't word-wrap.
Refer to http://stuff.mit.edu/people/lucylim/emacs_print_syntaxhighlighting.html for Emacs printing with color.

How to keep the terminal from scrolling

I am writing a simple program in C++ to be run in a terminal window. I would like the output text to be locked in position on the screen. Instead of each new line appearing at the bottom of the screen and pushing everything up, I would like to be able to change a line of text or some characters in a line of text, while keeping other lines above and below it static. I know I have seen this done in terminal, and I believe it was done with C++, but I can't find any documentation on it. I cannot even think of what this type of display might be called. My google fu has failed me; please help. If you can tell me what commands/library to use, that would be great, but even being able to tell me what commands accomplish this in a programming language other than C++ would give me more to go on than I have now.
You want ncurses, a library for displaying text on a terminal.
If you are programming for Microsoft Windows, try googling for Win32 Console Functions.

How can I get full string value of variable in VC6 watch window?

I'm wanting to get the full value of a char[] variable in the VC6 watch window, but it only shows a truncated version. I can copy the value from a debug memory window, but that contains mixed lines of hex and string values. Surely there is a better way??
For large strings, you're pretty much stuck with the memory window - the tooltip would truncate eventually.
Fortunately, the memory window is easy to get data from - I tend to show it in 8-byte chunks so its easy to manage, find your string data and cut&paste the lot into a blank window, then use alt+drag to select columns and delete the hex values. Then start at the bottom of the string and continually page up/delete (the newline) to build your string (I use a macro for that bit).
I don't think there's any better way once you get long strings.
Push come to shove you can put in the watch
given
char bigArray[1000];
watch:
&bigArray[0]
&bigArray[100]
&bigArray[200]
...
or change the index for where in the string you want to look...
Its clunky, but its worked for me in the past.
I do not have VC6 any more, so I cannot try it. I do not know if it works, but maybe you can enter
(char*)textArray;
in the watch window.
The bettter solution maybe: VS2008 automatically displays the text the way you want. And there is a Express Edition for VS2008 free of change, which can, as far as I know, be used to develop commerecial applications. You can even try to continue developing with VC6, and use VS2008 for debugging only. With VS2003 it was possible. About 5 year ago I had to maintain an app which was developed with VC6. I kept using VC6 for developing, but for debugging I used VS2003.
The only technique i have seen is to watch the string
then the string + 50, + 100 etc.
Eugene Ivakhiv wrote an addin for msvc 6 that lets you display the full string in an edit box.
There's a cute plugin for VC6 called XDebug. It adds a dialog for viewing different types of strings. It worked great for me.
Perhaps, get used to creating logfiles, and write output into the file directly, then bring up in your favorite text editor.