How do I debug a *-pc-windows-msvc Rust program on windows using LLDB? - rust

I'm having problems debugging Rust programs with LLDB on windows.
LLDB doesn't seem to be able to find the PDB file, even though it's in the same directory as my binary.
I run LLDB from the command line on my binary and no luck.
I also tried using the --symfile option of the debuggers file command and it still won't display any debugging info.
Any ideas?

Related

How do you specify a debugger program in Code::Blocks in LINUX

I was trying to debug a c++ program in Code::Blocks, but it didn't work and gave me this message: "ERROR: You need to specify a debugger program in the debugger's settings.
(For GCC compilers, it's 'gdb' (without the quotes))"
When I opened the debugger settings, I found the debugger path empty and don't know what its path.
Anyone has an idea about where can I found the debugger file.
Note: I use Manjaro Linux
The Error appeared because I hadn't installed the GDB, after I install it the debugger path automatically set as "/usr/bin/gdb".

visual c++ for linux stopped (tty input)

whenever i have a scanf statement in my code in a linux project using visuall c++ for linux ion visual studio i get the following message:
(gdb) 1021-var-delete var1
Stopped (tty input)
can anyone help me along with this?
Both gdb and your program want to read from the standard input. gdb wins. If you want to debug a program that reads/writes on the terminal, you might want to run the program on a separate terminal, and attach to that process using gdb.
Further reading:
Running Programs Under GDB

How to use external terminal like xterm instead of the internal one in Clion Debugging?

Just like the title.I'm writing an game which is using ncurses.External terminal doesn't work correctly.
I tried to look for the setting in Clion but nothing was found.
Here you can find how to execute a clion C program in an external terminal
the only difference is that you have to replace the executable path of gnome-terminal with your path to xterm.
Another option is remote debugging as it's supported by clion since 2016.1 version.
check out the official jetbrain blog or the official youtube tutorial.

How can I change how eclipse invokes gdb in linux?

In short, I need to understand how to configure eclipse to run "optirun gbd" instead of "gdb". An explanation of what exactly I'm trying to accomplish follows.
I need to run my debug app in eclipse such that it will use the nvidia optimus card instead of the integrated card. My app requires opengl support that is only available this way.
I've got a laptop with an nvidia optimus video card. I'm running linux (ubuntu). I've successfully set up bumblebee such that I can take advantage of the optimus technology. This requires that, to use the nvidia card, I run a given program "foo" with the program "optirun:" optirun foo.
I need to configure eclipse to launch my program in debug mode under optirun. If I run from command line: optirun gdb app everything works as expected.
Edit: Changing the "GDB Debugger" field inside the debug configuration to optirun gdb does not work. Lanching eclipse by optirun eclipse does, however. But this is a detriment to battery life.
Go to "Debug Configurations", open "Debugger" tab. Change "GDB debugger" from gdb to optirun gdb.
Works in Eclipse Juno, Ubuntu 12.04.
Since I'm sure eclipse uses the shell to execute the program, a workaround is to alias gdb to optirun gdb in ~/.bashrc
I look into this issue today and I found another solution. As long as you have Bumblebee installed (http://www.bumblebee-project.org/) and you know you can attach optirun to an executable (try with glxgears for example) you can attach it to cuda-gdb.
What I did is create a script:
#!/bin/bash
optirun /usr/local/cuda/bin/cuda-gdb $*
And save it to /usr/local/cuda/bin or somewhere else it doesn't matter, with the appropriate permissions for execution (755).
What it does is very simple, it runs optirun cuda-gdb args where args is whatever the command line sends it.
In terminal just run opti_cuda-gdb with or without arguments.
For example I named it opti_cuda-gdb and placed it in that directory (which conveniently is added to the path if CUDA is properly configured).
If you use an IDE to develop, like say Netbeans, point the debbuger executable to that script.
I've been successfully compiled and debbuged code using CuSparse and CuBlas with NetBeans running in a SAMSUNG SF410 with Nvidia Optimus and Ubuntu 11.04 and 11.10.
I'm open to provide further details if you think I omitted something.

running binary on different machine causes segfault

I'm not well versed in how linking happens in c++
I have a binary that i compiled on one machine and i'd like to copy it and run it on another machine.
I would expect this to work, because the libraries are the same on both machines (i think!) and the version of linux is the same (same kernel, etc.) However, when i copy it over... it appears to segfault in one of the libraries i am dynamically linking when i run it.
It runs like butter on the machine that i compiled it on. But on the machine that i scp'd it over to, when i run the binary, it instantly segfaults on a std::string::compare in a call stack with some functions in one of the libraries i am dynamically linking.
i tried installing the libraries again on both machines and doing ldconfig, but same results.
any ideas on how to debug these kind of weird segfaults caused by dynamic linking issues?
Well, it might help narrow down the problem if you run the program in a debugger. When compiling, add the -g -ggdb arguments to the g++ command, then when running the program, use the command gdb ./executable (you may need to install gdb first.) At the gdb prompt, type run and your program will run until it segfaults. Then you can try to figure out what went wrong.
There are plenty of tutorials for using gdb (the GNU debugger) online.
Sounds like a binary compatibility issue. This SO link might shed some light:
Creating a generic binary in linux for all x86 machines

Resources