Multithreaded Debugger [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
GDB has severe issues when debugging with multiple threads (pthreads).
Are there any other good multi-threaded debuggers for C/C++ on *nix?

I've personally not had any GDB specific issues when debugging a multi-threaded application, so it may helpful for you to elaborate on exactly what "issues" you are having. It will help us answer you better.
There are several aids that I have used in the past when debugging multi-threaded applications in linux, most of which build upon GDB rather than replace it. These include:
DDD http://www.gnu.org/software/ddd/
Eclipse http://www.eclipse.org/
Native POSIX Thread Library (NTPL) Trace Tool http://nptltracetool.sourceforge.net/
Additionally, if you are new to debugging in Linux (and even if you aren't!) I highly recommend the paper titled "Debugging Linux Applications" which you can find here:
http://www.scribd.com/doc/3009706/Debugging-Linux-Applications

Allinea DDT ... graphical debugger for scalar, multi-threaded and large-scale parallel applications that are written in C, C++ and Fortran.

TotalView is what the national labs use for huge clusters. I believe it has some good support for thread parallelism, too. It's probably out of your price range, but you can try it for free.

From my search, I have not found any good multi-thread debuggers for *nix. GDB seems to be getting better, and the last time I had to debug a multi-threaded application on FreeBSD (7.0-RELEASE) it behaved fairly well, letting me find where the error was.

I once looked for a gdb alternative, but unfortunately every one I found was based on gdb. I think this is because gdb is intricately tied to gcc, and it's hard for third-party debuggers to keep up with every gcc change.

The AIX debugger for windows, let's you debug multithread applications.

Related

C++ get run time and memory usage [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I've been practicing my C++ programming on LeetCode and whenever I submit a solution it will tell me how long my program took to run and how much memory it used.
I'm using a mac and VSCode with g++ to compile my program locally. I want to find a tool or method I can use to get the same information about the run time and memory usage of my program so I can try tweaking it to see the effect on performance.
Is there a compiler option or something like a command line tool or VSCode extension I can run my program through or would I have to add code to my program to track the time and memory itself?
For simple outputs, you can use gnu time.
As suggested on that page:
/usr/bin/time -f "time result\ncmd:%C\nreal %es\nuser %Us \nsys %Ss \nmemory:%MKB \ncpu %P" <command>
For a version on Mac OSX, just take a look on this answer: https://apple.stackexchange.com/a/235404
You can use valgrind to find memory leaks or profiling. And Google benchmark for code snippet benchmarks. Or you can measure time yourself with chrono.
And an online benchmark tool, quick-bench
Update:
I found this nice info on godbolt which gives insights on the number of iterations or cycles...
Thanks to #Peter the tool
llvm-mca estimates the Instructions Per Cycle (IPC), as well as hardware resource pressure.
Which is a simulation on a theoretical model of the CPU, not a profile but still could be useful. It also does not cover cache miss.

QNX C/C++ software [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
How can I get QNX C/C++ sample code?
Since QNX is proprietary, it can be hard to get a "jump start".
But as Research In Motion (the makers of BlackBerry) acquired it and are heavily investing on it - in the hopes to get as many developers as possible to jump on the new BBX platform, you may benefit from learning QNX via RIM - and maybe even winning a free Playbook tablet.
You can download the Native Development Kit (NDK) from this website: https://bdsc.webapps.blackberry.com/native/
It is a slightly modified version of Eclipse called Momentics. Using the Playbook simulator (which runs under a - hopefully - free version of VMWare) you can write, compile and run your QNX softwares.
I suggest you taking a close look at PPS objects. They are the most outstanding "idiosyncrasy" of QNX and mastering it will pretty much enable you as a QNX developer. Also, try to register for Foundry27 on QNX website and there you will find handful of (unfortunately almost hidden from Google) resources on QNX.
I hope that helps!
EDIT: and with the NDK it comes with a handful of examples. You will find them pretty much similar to POSIX.
QNX Community Resources is always a good source of help and sample code for QNX.
Usually, library reference entries have a small sample code, e.g. MsgDeliverEvent.
If you go to QNX.com, download the QDE/Momentics trial, you'll get an Eclipse-CDT which will have examples available from the start page.
QNX Neutrino is also similar enough to Linux/Unix systems that most software examples (for example socket and terminal io code) will be equally applicable to QNX as they are for their Unix system.

What tool can decompile a DLL into C++ source code? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I have an old DLL that stopped working (log2vis.dll) and I want to look inside it to see what objects it uses.
The DLL was written in C++ (not .NET). Is there a tool that will decompile/disassemble C++ files?
This might be impossible or at least very hard. The DLL's contents don't depend (a lot) on it being written in C++; it's all machine code. That code might have been optimized so a lot of information that was present in the original source code is simply gone.
That said, here is one article that goes through a lot of material about doing this.
Hex-Rays decompiler is probably the best in this field !!!
I think a C++ DLL is a machine code file. Therefore decompiling will only result in assembler code. If you can read that and create C++ from that you're good to go.
There are no decompilers which I know about.
W32dasm is good Win32 disassembler.
There really isn't any way of doing this as most of the useful information is discarded in the compilation process. However, you may want to take a look at this
site to see if you can find some way of extracting something from the DLL.
The closest you will ever get to doing such thing is a dissasembler, or debug info (Log2Vis.pdb).

C/C++ call-graph utility for Windows platform [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have a large 95% C, 5% C++ Win32 code base that I am trying to grok.
What modern tools are available for generating call-graph diagrams for C or C++ projects?
Have you tried doxygen and codeviz ?
Doxygen is normally used as a documentation tool, but it can generate call graphs for you with the CALL_GRAPH/CALLER_GRAPH options turned on.
Wikipedia lists a bunch of other options that you can try.
Have you tried SourceInsight's call graph feature?
http://www.sourceinsight.com/docs35/ae1144092.htm
Good old cflow works fine for C. See here for an implementation.
Any decent static analysis tool should have this functionality (as well as all the other stuff that such tools do). Wikipedia has a good list of such tools.
Another group of tools that may be worth checking out are coverage tools. The call graph generated by the coverage tool will contain only the calls that actually take place during a run of the program. Initially this may be more helpful to you than a full call graph. I'm unable to make any suggestions on this for Windows, but for linux projects I highly recommend gcov and lcov.

How does one disassemble Pro*C/C++ programs? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
Is there a way to disassemble Pro*C/C++ executable files?
In general there should be disassemblers available for executables, regardless how they have been created (gcc, proC, handwritten, etc.) but decompiling an optimized binary most probably leads to unreadable or source.
Also, Pro C/C++ is not directly a compiler but outputs C/C++ code which then in turn is compiled by a platform native compiler (gcc, xlc, vc++, etc.).
Furthermore the generated code is often not directly compilable again without lots of manual corrections.
If you still want to try your luck, have a look at this list of x86 disassemblers for a start.
Try PE Explorer Disassembler, a very decent disassembler for 32-bit executable files.
You should try disassembling with disassembler tool of your choice. At the end of the day, executables compiled with PRO C/C++ preprocessor are just plain C/C++ executables.
If what you're looking for is SQL sentences within your code, you might want to take a look at:
$ strings your_executable_file
It will give you a list of all constants strings present in your executable, and chances are that you are going to get SQL sentences with that.
Good luck.