Is there kind of runtime C++ assembler library around? [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
For my small hobby project I need to emit machine code from C++ program in runtime. I have base address 0xDEADBEEF and want to write something like this:
Assembler a((void*)0xDEADBEEF);
a.Emit() <<
Push(Reg::Eax) <<
Push(Reg::Ebx) <<
Jmp(0xFEFEFEFE);
Inline assembler isn't my choice because generated machine code is dependent of the program state.
Does anybody know any existing library for doing this? If no, would it be a good idea to develop one from scratch and make it open source? (I mean, will anybody ever use this library if it existed?)

Check out Asmjit. It seems to be the thing you're looking for.

You could use Nicolas Capen's softwire. Its really not supported any more as he now works on a similar product at Transgaming called SoftAsm. Still it kinda does what you want.
Edit June 2014: - It appears the sourceforge link above has been removed but it appears to be available under an LGPL license here.

This might be a overkill, because it supports many platforms, has its own intermediate language, does optimizations, etc, but the http://llvm.org/ seems to be a god try.

Related

C++ application with neat codebase to learn from [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm searching for an application written in C++ with a neat codebase, to learn from and maybe even contribute to it. A lot of applications written in C++ are either very large or doing some really advanced stuff, which is just the domain of C++.
A good candidate of size and shape would be something like pacman and libalpm from Archlinux, but it is written in plain C, not C++. WebKit is just far to big and Protobuf is looking awkward. Gnote looks to be a good starting point and I'm also using GNOME, but I wasn't sure about it because it offers a GUI. Which brings me back to pacman; I'm already using it myself and it doesn't distract with stuff like a GUI.
So I decided to look for something small and sane, which offers a CLI and which I can use myself. I opened the search of github with the terms note + c++ + stars and the result is taskwarrior. A brief look on the source of task(warrior) looks promising.
Do you know a neat project which written in C++?
Thanks

How to find compiler implementation details? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
It is well known that switch-case constructs can provide better code performance than if-else constructs due to implementation in the form of jump-tables,etc. You can know this only when you know how the compiler implements switch-case. So my question is that how do you get to know how a compiler, for example, Microsoft C++ Compiler or g++, implements a feature? Is there some standard literature available on these topics with respect to common compilers?
It is not very useful to get information on how will a compiler implement a feature because the compiler runs multiple steps, each will modify the compiled result.
As an example:
A first step build up a meta language, a second step do a first optimization, next step maybe inline some code, next step...
So you can't get any idea of the code which will be created. So only chance you have: Try it out!
For your example of a switch/case it is important if
the case patterns are linear
the code inside the pattern is used once or multiple
the code return or modify variables or only call other functions
4 ... tons of other dependencies!
Forget about prediction of optimizer results.
For gcc you have the source, look inside :-)

A C++ source code analyzer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
Could you suggest some open source tools that analyze C++ code and checks the following rules:
naming conventions,
file inclusions,
function design,
data types,
flow control,
memory allocation,
file handling,
portable code,
runs under Solaris or SUSE
http://www.google.com/search?q=misra+checker
Of course, if the rules you're trying to enforce don't exactly match someone else's idea of a coding standard, no existing tool is going to work.
It is still in early development (especially for C++) but its improving rapidly and is a really interesting open source project in a vibrant community. So see if the CLang Static Analyzer does what you need.
I have used coverity (http://coverity.com/)in my organization. It does static bug check analysis and I found it to be very useful. It is highly customization and provides a number of checks. I am not entirely sure if it works on solaris or not but I would recommend checking it out.

How to play mp3 file in c++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I'm looking for the easiest way to play an MP3 file in C++. Either a library I could use and just call the function, given the filename, or alternatively something someone has already written that will just run and quit.
What platform are you on? You can check these out:
In case of windows/linux:
FMOD
In case you are programming only on windows/mac osx:
BASS
I would also look for some native APIs in Windows (if you are developing on that platform).
HTH,
Sriram
Qt comes to the rescue (again). The documentation even comes with demo code on how to implement a media player. It can play videos as well, btw.
http://doc.qt.nokia.com/latest/demos-qmediaplayer.html
Works on all platform and with the same syntax = WIN.

Can anyone recommend a concurrent, real-time diagramming/flowchart collaboration tool? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I'm looking to work with others to quickly build a rather large class flow diagram that may or may not be strict UML. Can anyone recommend a networked, concurrent collaboration tool for such a task? Price is not an issue, but the target system must be Windows.
Surely someone must have done something like this in the past.
Any ideas?
DabbleBoard has an online diagramming tool that may do what you want. It should work on Windows, although it is a web-based and fairly low-level.
I don't know exactly how concurrent you need it, but Google Docs have just introduced a 'drawing' document type, which is basically a stencil based system like visio. It includes flowchart elements, and of course can be shared.