Enable ASLR in GDB [duplicate] - gdb

This question already has an answer here:
Force gdb to load shared library at randomized address
(1 answer)
Closed 3 years ago.
I know that GDB disables ASLR for applications it debugs.
Is there a way to enable ASLR inside GDB? I have a bug that I can only reproduce with ASLR enabled.
Thanks,

Is there a way to enable ASLR inside GDB?
Yes:
(gdb) set disable-randomization off

Related

mingw 5.2 strange message with std::string [duplicate]

This question already has answers here:
the procedure entry point __gxx_personality_v0 could not be located
(5 answers)
Closed 3 years ago.
a program with std::string anywhere will compile fine, but when run it fails with the message
The procedure entry point
_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC1Ev could not be located in the dynamic link library libstdc++-6.dll.
I cannot find more information on it though, how can I remedy this problem?
turns out I had the wrong compiler, I needed 4.8 from the other MinGW

Changing gcc/g++ version causes segfault [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
It seems that changing the version of gcc I use from gcc 4.7.3 to gcc 4.9.2 causes a segfault for my project (after a clean build and run).
In an unfortunate turn of events gdb is broken on the server I am
getting this error on and can't use it for now. Any known changes in gcc itself that could cause this? I suspect the issue is potentially caused by a double free.
You should try to use valgrind.
Valgrind is a debugging tool only requiring for your code to be compiled with the -g flag. It's the best way to spot segmentation fault over a program, or any memory leak.
Think about using valgrind options while debugging (it's at the bottom of the valgrind report) something like leak-checkfull (I'm not able to run valgrind right now so I can't tell you exactly what it is).
But whenever I compile my code, I use valgrind with it to check every possible failure. Consider even putting VG in your Makefile rules for more simplicity.

The compiler itself running with parallel computing methodology [duplicate]

This question already has answers here:
Compiling with g++ using multiple cores
(8 answers)
Closed 8 years ago.
Is there GCC compiler that could build large source code in parallel ? "The compiler itself running with parallel computing methodology "
Is there any GCC option for doing the previous requirement?
I am not sure whether gcc has something like that in built, but you have make in linux that can run parallel builds using the -jN flag
https://www.gnu.org/software/make/manual/html_node/Parallel.html

How do I statically link the Visual C runtime into my program? [duplicate]

This question already has answers here:
Omit the msvcr100.dll when developing in C/C++ for windows?
(3 answers)
Closed 9 years ago.
This is kind of a duplicate question, but I never got a good answer from the other posts. I could compile and run my visual c++ programs on my pc really easily. However when I moved it to my other computer, it required a dll called msvcr10.dll. How do I statically compile/link this dll with my program?
Right-click your project, and select properties. Under C/C++, select Code Generation. In there you'll see an option for "Runtime Library". Select Multi-threaded [Debug] instead of Mutli-threaded [Debug] DLL.

In win32 c++, is there a way to tell if a DLL is 64-bit? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How can I test a windows dll to determine if it is 32bit or 64bit?
I'm in win32 c++ code. I have the path to a DLL on disk and I want to know whether it is 64-bit or 32-bit. Is there a way to do this? I can't seem to find any reference on functions that let you peek inside DLLs.
Thanks,
Phil
If this dll is in one of the known folders: MSDN, you could decide it easily.
+1 for your first comment.