gdb: how to write my own simulator module for gdb and integrate it with Eclipse (assembly only)? - eclipse

I found good videocource on programming languages and low-level programming # SEPL Goethe University Frankfurt
But their's toolchain looks strange: 2OPM source only, x86-64/MISP specific.
I want to make my own simple 32-bit VM in form of DBG simulator module, assembler, integrate it with Eclipse/GDB, and adapt this cource for this VM.
What GitHub projects can I use as samples ?
PS: This system must compile/run under MinGW32 -- Is I need GDB sources for my simulator compiling ?

Related

Eclipse, GCC, installing them twice?

I am thinking of installing Eclipse for developing STM32 programs (I have a question about this that I will post later). In the instructions it says I have to install:
the IDE for C/C++
GNU ARM Eclipse Plug-ins
GNU GCC ARM tool-chain
among other tools..
However, I am also thinking of installing e2studio for developing Renesas programs. You can see about this Here. There you can see that this is "based on Eclipse CDT" (what is the difference between this CDT and the IDE?) and that it also uses Plug-ins like GNU Tool & Support Here.
My question is, is this possible? Do I have to install them separately? (I guess so). Will the GNU tools will also be installed twice??
(I am using a windows10 machine)
Thanks in advance
CDT is dedicated to C/C++ programming. Actually I personally prefere to have separate eclipse installations for different families of uC. Why? Because it is much easier to manage updates and to keep my work in the correct order.
For STM32 I advice (I think, you are a novice user of Eclipse & ARM toolchains) to install OpenSTM32 (yo have a straightforward installer). It imports projects from CUBEFX & MX which gives you an easy way to import examples & initialisation code from Cube. I personally do not use HAL libraries but as I know I am a minority.
However, I am also thinking of installing e2studio for developing
Renesas programs. You can see about this Here. There you can see that
this is "based on Eclipse CDT" (what is the difference between this
CDT and the IDE?)
Eclipse CDT is an open-source general-purpose C and C++ IDE.
e2studio is one of several software packages that extend CDT with (most likely proprietary) plugins geared towards a more specific market (in this case, Renesas programs).
My question is, is this possible?
Yes.
Do I have to install them separately? (I guess so).
Yes.
Will the GNU tools will also be installed twice?? (I am using a windows10 machine)
You can certainly share a single installation of a toolchain between two installations of CDT, if both of them need the same toolchain (in terms of version and architecture). I don't know enough about STM32 and Renesas to tell you if they use the same toolchain.

Acquire Gtk binaries for windows under linux

I am currently trying to compile my Gtkmm program for windows using my linux system. This requires that I ship the Gtk binaries (in this case .dll's) with my program, since Gtk does not support static linking.
But I just dont know how to get them - the official Gtk download page ( https://www.gtk.org/download/windows.php ) just redirects to the MSYS2 project ( http://www.msys2.org/ ) that offers .EXE files **rage*!
I just dont know where I can download the right dll files that I need to include :/
I would appreciate any help with this.
Regards,
NiAypa
The GTK+ project does not distribute binaries for any platform.
If you are cross-compiling from Linux to Windows, you will need to cross-compile all the dependencies yourself, and distribute them together. Various distributions, like Fedora, ship with cross-compiled dependencies that you can re-use for that purpose.
The MSYS2 project is for building applications and libraries on Windows, using a native toolchain.
I'd like to point out that cross-compiling is great if you want to do CI and testing, but if you want to distribute complex applications for Windows my suggestion would be to actually build them on Windows.

STM32 libraries for eclipse

Can you use the CMSIS, HAL, TM libraries for STM32F407 discovery board with eclipse, without STM32Cube? According to this link http://www.carminenoviello.com/en/2015/06/04/stm32-applications-eclipse-gcc-stcube/ you can do it with eclipse & STM32Cube. But I wonder if you can do just same thing without the STM32Cube. Since I'm using OS X, it is impossible to install the STM32Cube, but in order to use the GPIO library I need to use CMSIS, HAL, TM libraries.
You might be able to used the older "Standard Peripheral Driver" model - which was a just a distributed set of driver files specific to the chip. These libraries are no longer supported and are replaced by STM32Cube which generates equivalent code - but with better support for hardware abstraction however they are still very useable.
Search "STM32F4xx_StdPeriph_Driver" to locate the libraries (which include the standard peripheral drivers and CMSIS).
You can download the libraries as a separate zip file
http://www.st.com/web/en/catalog/tools/PF259243
just unpack it and import whatever you need from it into your project. You can take an example project which is closest to your needs, and start developing your application from that. That's what I did in Linux.
There is the STM32CubeMX, which is the installable program you're referring to, and there are STM32CubeF4, STM32CubeL0, etc, which are the firmware package for the different controller families.
CubeMX now officially supports Mac and Linux. However here is an old post how to run it manually http://www.carminenoviello.com/2015/09/09/running-stm32cubemx-macos-finally/.
Regarding the HAL and SPL I'll add that there are really nice libraries in libopencm3 which are developed by community and are not so "buggy" as HAL or SPL.
I found an interesting instruction. You can install the STM32CubeMX on OS X. http://www.stm32duino.com/viewtopic.php?t=267
There is an Eclipse based IDE by OpenSTM32 community called SW4STM32. Available at OpenSTM32 community's site. System Workbench for STM32 installer has been released on the following platforms:
Microsoft Windows Vista and newer (32 bits or 64 bits)
Linux (32 bits or 64 bits)
Mac OSX 10.10 Yosemite and newer + Xcode 7
Java SE JRE 7 or newer
When creating a project you can choose which library you want want to use, SPL, HAL or baremetal.
STM32CubeMX is a initialization code generator. It definitely eases development, but you can write you code completely from the beginning.
STM32CubeMX uses HAL as its Library. You can download the HAL and Include the files that you need and write down the code from scratch. You just need to be aware of the APIs, which are documented in UM1725 Application Note.
But, now STM32CubeMX is also available for Linux and Mac.

Deploying linux CUDA app

I've compiled a cu program on my laptop, using NVIDIA CUDA 5 toolkit. A very basic interface, using only terminal output. Then I went on to test how it runs on my desktop PC (both have Ubuntu 12.04 LTS installed).
On the desktop PC I get this error message:
error while loading shared libraries: libcudart.so.5.0: cannot open shared object file: No such file or directory
Ok, I get it, some libs are not installed. But do I really need to install CUDA toolkit on every PC where I'd want my compiled code to run?
To deploy a CUDA runtime API application on linux you only need to do two things:
Make sure that the machine in question has a CUDA compatible card and a minimum driver version which matches the CUDA Toolkit you used to build the application (you can find information regarding both of these in the release notes of the toolkit)
Distribute the runtime library (so cudart.so) that you built the application against with the executable. If you used any other libraries from the toolkit (like CUBLAS, CUFFT, CUSPARSE, etc) you need to inlcude those too. The CUDA runtime library is versioned and you have to have the libraries which match the toolkit you are building with. You may need to use the LD_LIBRARY_PATH environment variable to ensure that the correct versions of the libraries are found by the link loader. Often a simple shell script which acts the canonical application, settings LD_LIBRARY_PATH variable and running the built executable is the best way to do this.
If you get those two things right, it should just work.

Are there any USB stick runnable, no-install, cross platform software frameworks (with GUI)?

Does anyone know of a good software development framework or similar that has the following properties?
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux (such as Ubuntu and Kubuntu).
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
Have good GUI support (this is why this question doesn't give a suitable answer, as far as I can tell).
Permissive licensing such as LGPL or BSD or such.
Among the softer requirements are having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on (There is usually some platform specific adaptations necessary), and supporting a good language such as Python or C++, though it is usually fun to learn a new one (i.e. not perl).
I think possible candidates are Qt 4.5 or above (but IFAIK Qt software will not run on Vista without any installation(?)), some wxWidgets or maybe wxPython solution, perhaps gtkmm. The examples I have found have failed on one or another of the requirements. This does not mean that no such examples exist, it just means that I have not found any. So I was wondering if anyone out there know of any existing solutions to this?
Some clarifications;
By "framework" I mean something like Qt or gtkmm or python with a widget package.
This is about being able to run the finished product on multiple platforms, from a stick, without installation, it is not about having a portable development environment.
It is not a boot stick.
It is ok to have to build the software specifically for the different targets, if necessary.
The use case I am seeing is that you have some software that you rely on (such as project planning, administration of information, analysis tools or similar) that:
does not rely on having an internet connection being available.
is run on different host machines where it is not really ok to install anything.
is moved by a user via a physical medium (such as a USB stick).
is run on different operating systems, such as Windows, Vista, Ubuntu, OSX.
works on the same data on these different hosts (the data can be stored on the host or on the stick).
is not really restricted in how big the bundled framework is (unless it is several gigabytes, which is not really realistic).
It is also ok to have parallel installations on the stick as long as the software behaves the same and can work on the same data when run on the different targets.
A different view on the use case would be that I have five newly installed machines with Vista, XP, OSX, Ubuntu and Kubuntu respectively in front of me. I would like to, without having to install anything new on the machines, be able to run the same software from a single USB stick (meeting the above GUI requirements and so on) on each of these five machines (though, if necessary from different bundles on the stick).
Is this possible?
Edit:
I have experimented a little with a Qt app that uses some widgets and a sqlite database. It was easy to get it to work on an ubuntu dist and on osx. For windows xp and vista I had to copy QtCored4.dll, QtGuid4.dll, QtSqld4.dll and mingwm10.dll to distribution directory (this was debug code) and I copied the qsqlited4.dll to a folder named "sqldrivers" in the distribution directory.
You mention wxWidgets but dismiss it as failing at least one of the requirements.
I don't know what your requirements are and in what way wxWidgets wouldn't work for you, but IMO it does fulfill them:
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux.
It does run on those platforms, but "common versions of Linux" isn't good enough, as you can never be sure that the necessary GUI libraries for wxGTK (which should not be linked to statically) will be installed. This is however a problem for other solutions as well, unless you plan to put everything onto the stick.
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
See the previous point, you would need to specify which libraries are needed on Linux. Also you could specify at build time not to use some of the system-provided libraries (for example for graphics, compression, regexes) but to use the wxWidgets-internal libraries instead.
Have good GUI support
Check.
Permissive licensing such as LGPL or BSD or such.
Check. You can statically link wxWidgets into your application too.
supporting a good language such as Python or C++
Supports both, and there are bindings to other languages as well.
having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on
It does have some abstractions like that, but you can link to other cross-platform libraries as well.
We use wxWidgets for FlameRobin, a graphical administration program for the Firebird SQL server. It has active ports to Windows, Linux and Mac OS X, and has been compiled for at least some BSD variant and Solaris as well. It definitely runs from a stick on Windows, I haven't tried with Linux or Mac OS X, but I don't see why it shouldn't there too.
Java.
It has GUI support.
It provides your network/file/etc. abstractions.
It is cross-platform. Most platforms you can think of have a JRE available.
No need to install a JRE. Most users probably already have one, and if not, you can run the appropriate JRE right off the stick.
You can provide several startup scripts for various platforms to run the app under the appropriate JRE.
Something else to consider is HTML+Javascript. :D
You can look at Mono it cross platform, has GUI (GTK+, or Winforms 2.0) and I can execute code without installing.
This might not be crossplatform, but is maybe even better, it dont even use the platform : linux on a stick :-)
The subtitle is
Take your Java workspaces wherever you go on a USB key
Here with java and eclipse, but nothing stops you there of course.
http://knol.google.com/k/inderjeet-singh/installing-a-ubuntu-hardy-heron-java/1j9pj7d01g86i/2#
Well, it depends on what you mean by 'package'. Kylix came close to being such a thing. It was QT based, and it allowed you to write once and compile for Windows + Linux. However, it was not an open source solution.
I asked a similar question in this link
http://www.24hsoftware.com/DevelopersForum/CrossPlatform-C-Library.html
and the best asnswer seems to be QT.
I have started using QT, but it is not as easy as I expected mainly due to deployment problems due to the DLL hell, Winsxs hell and manifest hell.
Tclkit is a single-file, self-contained Tcl/Tk system. The mac version I have is about 3.8 megs. You can get a version for just about any modern OS. I carry around a thumb drive that has mac, windows and linux binaries so I can run my scripts on any platform. No install is required, just copy one file wherever you want.
The most recent versions of tcklit use native, themed widgets (though, on *nix there really isn't a single "native" set of widgets...)