how to view CString object value in debug in VC6 environment - visual-c++-6

In VC 6 environment what is the settings to be done to view the value of the CString in debug mode. Even in watch window ??? appears for CString variables!

Do you have proper Debug symbols? . pdb may be outdated

try using the GetBuffer method in the watch window.
cStringVariable.GetBuffer()

Try using XDebug plugin for VC6. Look here

Related

Cannot watch Kotlin variable in android studio

I am not able to get android studio display the value of a calculation in the watches window.
I use Kotlin for development and when i try to add a value to watches, i get a message which says "An exception occurs during evaluate expression".
e.g.
val model = MyModel()
val pos = model.position
Now if I add model.position to watches, then it gives the above error and the value of the expression is not displayed.
How can I fix this?
That's bug in Android studio.
1) I've reported mentioned bug (or very similar) recently:
https://issuetracker.google.com/issues/62859634
2) If you find a bug in tools, report it to Google:
https://issuetracker.google.com/issues/new
This bug should be already fixed in new Dex compiler.
Try to enable it by adding:
android.enableD8=true
to your gradle.properties.file
For more details check official blogpost.
file> invalidate caches / restart .. fixed it for me

Debugging in Xcode 6.2

I am developing a Mac application in Xcode 6.2 with Swift.
All my global variables and enumerations are in a separate swift file Globals.swift. The program so far works as expected.
But I am unable to see this global variables in the debug window. On the lower left of the debug window I selected All. I see outlets, local variables, but no global variables!
What do I have to change to see them?
This seems to be an issue with Xcode since some versions.
One way is to see the global variables by issuing the below command in the right hand debugger window
(lldb) target variable variableName
OR
(lldb) ta v variableName

Debug a process that terminates after start

I need to debug a process (starting from an external exe) that terminates immediately after start, so I don't have time to attach. How can I debug it?
UPD I don't have source code of that external exe; I can decompile it, but it's impossible to compile it back
You need to launch your process for debug in a suspended state. Visual Studio is capable of that, just invoke the debugger like this:
devenv /debugexe yourprog.exe <arguments>
The process will start suspended so you'll be able to iterate through first instructions before the crash.
See the detailed answer here.
You just need to open Visual Studio, go to File -> Open -> Project / Solution
and select the exe.
Press F5 and you will see the exception in the Output window. If you go to the Debug -> Exceptions window and select everything you will see the first chance exception before it shutdowns the application.
Note that you don't need the source code at all to do this.
Hope it helps.
You need to start it with the debugger. This will start the program with the debugger already attached.
If you cannot do that with Visual Studio, you can use the Windows Debugging Tools, part of the Windows Driver Kit. Note that the linked kit is for Windows 8.1, you may need to find older versions if you're not on Windows 8.
You can enable debug mode runtime by placing some piece of code.
write a method as below:
[Conditional("DEBUG_SERVICE")]
private static void DebugMode()
{
Debugger.Break();
}
and call this method where you want to start debugging, for example in the OnStart event.
you have to build your code with debug mode. dont forget to remove this piece of code after debugging and want to release.

debug disassembled dylib with hopper?

Is there a way to connect gdb to hopper, then load a dylyb that is loaded by an app and then run the app while stepping through the dylib code? is there a way to do this?
Today (2020) actually you can debug dylibs by opening them in a separate window before starting debugger. When you go back in the callstack window it shows the actual code in the window of dylib. You can also place breakpoints and do whatever you want in it.
For debugging to work you should remove the codesigning of the main executable.
I asked the developer and got a reply indicating that this feature (debugging a dylib), is not available in the current version.
The best way to go for now seems to be to use the available tools to find the right place to edit the code and then reassemble it.

Immediate Window for Eclipse

Does Eclipse have an analog to Visual Studio's "Immediate Window", a window where I can evaluate statements while in the debugger?
Yes. The view name is "Display".
Window->Show View->Other
It is under the Debug folder.
Once in there you evaluate statements while in the debugger.
Eclipse has a really cool concept call Scrapbook Pages where you can evaluate statements even when you're not debugging. However, if you want to eval code using values from the current program, go to Window->Show View->Expressions. There you can put in any expression you want and track it as your program executes.
Inspect ctrl-shift-i or Display ctrl-shift-d?

Resources