Commands fail - cannot load ntsdexts - windbg

I'm new to using WinDbg and am running into a problem. I've set the server for symbols and downloaded them, but I keep getting stuck when I try to run !htrace (or any other command actually). The error message I get is
Cannot load 'ntsdexts'
I get this on any command that starts with an exclamation point (i.e. !drivers, !heap, !htrace, etc.) which is making tracking down a handle leak a problem.
I'm using the srv*...* link direct to Microsoft for symbols.
The last line before I get the breakpoint is:
Module Load: C:\WINDOWS\SYSWOW64\VFRCORE.DLL (no symbols loaded)

From the comments:
Somehow I managed to get two different version of windbg installed and the one in the path is the wrong one. Put the dll file into the right place, ran from that specific directory and now it works.

Related

Eclipse: Need to update some register prior to downloading bin file

I'm using Eclipse Oxygen (4.7.3a) for an embedded C work project. There are multiple processors and I'd like to configure some registers prior to downloading the binary image. Eclipse/Debug Configuration/Startup has a Run/Restart Command area which allows commands (like register writes) to be run. I cannot find what this script register write format is.
I have tried:
monitor memU32 0x22002222=0x0005A5AF
It then error with: invalid command name "memU32". Is there a description of what the expected format is? I found this script in a different project, but it doesn't seem to work.
My goal is to be able to set a register to a value, prior to downloading the binary image to RAM.
The 'set' command can be used to set register values. The Debugger Command window appears to link to the GDB, therefore the GDB commands are used here.
set *((int *) 0x22002222)=0x0005A5AF

eclipse pydev debug source lookup

So I have anaconda installed and make a separate environment for all my projects. Normally I just use PYDEV to create a new interpreter pointing to the anaconda enviornment and load the project in eclipse and all is good. After doing the last one though 95% of the time I go to debug I keep getting the error
An internal error occurred during: "Debug Source Lookup".
java.lang.IllegalArgumentException
The other 5% it kind of works as I can follow one script or a function before it starts breaking.
I've tried reloading the project, interpreter and conda enviornment to no luck. All my past projects which use to work are also now giving the same error.
The funny thing is when I'm in the debug perspective though it does seem to be working (I can see the Variables and use the interactive console to test stuff), but anytime I try to step into, over ect I get the error (even though it does seem to be working). So for the image above I can go through the code fine until it tries to jump to the other file which throws the error, but if I step into it I can manually open that file and walk through the function (just each step throws the error) and still interact with the code which is in the position through the console.
Any ideas how to fix?
Well, it may be something specific to this use-case (for instance, if the code for some object is evaluated and the source code is not really available for the debugger this is actually expected).
Can you provide the full stacktrace from the error log? (see: http://www.pydev.org/faq.html#HowdoIReportaBUG for details on how to get it)

Running an OpenCV program with Eclipse

I'm trying to run a simple example of OpenCV on Eclipse [which was perfectly buit and installed before (using CMake and MinGw), even libraries and all includes are in place !].
When building, I'm getting no errors or warning, all seems good, but when I try to run, I get a message as if the project had no Binaries, even if all binaries are there. I even specified the path to the ".exe" (run->run conf-> new launch-> browse ...etc.).
You can notice on the images attached that the project is built and the binaries are generated.
Notice: when I run an example of a (Hellow world) on the console ... it displays the messag without errors.
I read a lot on Internet before posting here, but I found nothing that matches to this case.
Thank you so much,
Error Capture
Build Capture
Regards

Using MATLAB's diary function in an executable (MATLAB Application Compliler Toolbox)

I've created a code that will be run as an executable. However, the running of an executable has an error that doesn't exist in the MATLAB scripts. Trying to document this, I ran across the "diary" command which seems like an appropriate way of logging the error. Command: diary('LogFile.txt')
However, when running the compiled version, I immediately get a pop up error: LogFile.txt: Cannot open file: permission denied.
I'm getting a bit flummuxed as it appears to be having trouble writing to its own folder. Should I be trying to store to C:\Users, or is there some other glitch I'm running into?
Thanks a lot to 'Daniel' for his suggestion of getenv('appdata'). I would add that my path was ..\AppData\Roaming\ so I would suggest a way of viewing the location of the log file in your gui just to be sure you can find (or that others using your app can find it). Thanks!

cannot load runtime-gdb.py

I'm trying to debug a program written using Go inside eclipse. I can set and hit breakpoints pretty consistently, but I cannot view the contents of my variables. When I start debugging the program, I always get the following error on my console.
warning: File "/usr/local/go/src/pkg/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
add-auto-load-safe-path /usr/local/go/src/pkg/runtime/runtime-gdb.py
line to your configuration file "/home/johnlawrie/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
line to your configuration file "/home/johnlawrie/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual. E.g., run from the shell:
info "(gdb)Auto-loading safe path"
Thinking that the problem might be due to the error message, I put the entry into my .gdbinit file as instructed. However, I get the same message every time I run as if I did nothing at all. This is the contents of my /home/johnlawrie/.gdbinit file
add-auto-load-safe-path /usr/local/go/src/pkg/runtime/runtime-gdb.py
Any ideas what I need to do to make this change take effect? I have tried logged off and back in.
Thanks,
John Lawrie
It did learn what was happening. When gdb is started from Eclipse/CDT, it is started with option -nx, which means it doesn't load .gdbinit in the home directory.
I was able to get this to work by creating a .gdbinit file as a peer to the src, bin, and pkg directories in my workspace and adding the following line to it
set auto-load safe-path /usr/local/go/
It should be add-auto-load-safe-path /usr/local/go/src/pkg/, not the path to the script.
Also keep in mind that gdb doesn't really work with Go, specially v1.3.
From http://golang.org/doc/gdb:
GDB does not understand Go programs well. The stack management,
threading, and runtime contain aspects that differ enough from the
execution model GDB expects that they can confuse the debugger, even
when the program is compiled with gccgo. As a consequence, although
GDB can be useful in some situations, it is not a reliable debugger
for Go programs, particularly heavily concurrent ones. Moreover, it is
not a priority for the Go project to address these issues, which are
difficult. In short, the instructions below should be taken only as a
guide to how to use GDB when it works, not as a guarantee of success.