Can GDB be used to debug programs in languages other than C or C++, like Java?
GDB can debug a variety of file formats, but it doesn't support scripted languages (Perl, PHP, Python, etc) nor languages that run over a VM (Java, C#, etc). Nowadays it can even debug Java. It was made to debug native binaries like ELF, Mach-O, etc.
You can read the complete list of supported file formats on the official GDB documentation. Here!
Related
What are the programming languages supported by Meego ? Where Can I get any sample library built in meego for some basic analysis in ubuntu environment...
I am going to test libraries built in meego...I am trying to analyse the type of libraries I may be getting..
The preferred library for Meego will be Qt. Qt applications can be written in many languages, but the preferred language is C++. Python bindings will probably be available.
Security Tools
C++ - see http://qt.nokia.com/products/platform/meego/
Some of basic requirements are:
Basic build scripts requirements like pulling from scm, copying, compiling :)
Compatibility on Windows, Unix (Solaris, HPUX, AIX) and Linux.
I have heard of several good options like scons, ant etc but would like to know what is your favorite choice?
Currently I have 36 kornshell scripts which i need to port as kornshell is not supported properly even in SubSystem for UNIX in windows.
My vote goes for cmake. It is important for me that it is a meta buildsystem.
CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
Linux users work with eclipse, windows user with visual studio.
I also considered scons with the full power of python behind it but as stated in the scons wiki:
To sum up, my very subjective opinion is that scons is a better idea, but CMake has a stronger implementation
Can I do Android programming in C++, C? If the answer is "yes" then please tell how? And what's the procedure to set up?
I don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released by Google.
Please do not tell about NVDIA SDK it's not fully developed :)
PLEASE NOTE: THE ANSWER BELOW IS HORRIBLY OUTDATED, AND MIGHT NOT BE ENTIRELY CORRECT ANYMORE.
You can program in C/C++ using the Android NDK. You'll have to wrap your c++ codebase in a static library and load that through a Java wrapper & JNI.
The standard NDK does not support RTTI and a lot of the functionality of standard c++ is also not available such as std::string, etc. To solve this you can recompile the NDK. Dmitry Moskalchuk supplies a modified version of the NDK that supports this at http://www.crystax.net/android/ndk-r3.php. This modified version works on all Android phones that run on an ARM processor.
Depending on the kind of application you should decide to use Java or C/C++. I'd use C/C++ for anything that requires above average computational power and games -- Java for the rest.
Just pick one language and write the majority of your application in that language; JNI calls can decrease your performance by a lot. Java isn't that hard though -- if you know how to program in C/C++. The advantage of Java is that the application can run on any device running Android, where as NDK applications depend on the architecture it was compiled for.
You should use Android NDK to develop performance-critical portions of your apps in native code. See Android NDK.
Anyway i don't think it is the right way to develop an entire application.
Yes, you can program Android apps in C++ (for the most part), using the Native Development Kit (NDK), although Java is the primary/preferred language for programming Android, and your C++ code will likely have to interface with Java components, and you'll likely need to read and understand the documentation for Java components, as well. Therefore, I'd advise you to use Java unless you have some existing C++ code base that you need to port and that isn't practical to rewrite in Java.
Java is very similar to C++, I don't think you will have any problems picking it up... going from C++ to Java is incredibly easy; going from Java to C++ is a little more difficult, though not terrible. Java for C++ Programmers does a pretty good job at explaining the differences. Writing your Android code in Java will be more idiomatic and will also make the development process easier for you (as the tooling for the Java Android SDK is significantly better than the corresponding NDK tooling)
In terms of setup, Google provides the Android Studio IDE for both Java and C++ Android development (with Gradle as the build system), but you are free to use whatever IDE or build system you want so long as, under the hood, you are using the Android SDK / NDK to produce the final outputs.
You should look at MoSync too, MoSync gives you standard C/C++, easy-to-use well-documented APIs, and a full-featured Eclipse-based IDE. Its now a open sourced IDE still pretty cool but not maintained anymore.
You can take a look also at C++ Builder XE6, and XE7 supports android in c++ code, and with Firemonkey library.
http://www.embarcadero.com/products/cbuilder
Pretty easy way to start, and native code. But the binaries have a big size.
You can use the Android NDK, but answers should note that the Android NDK app is not free to use and there's no clear open source route to programming Android on Android in an increasingly Android-driven market that began as open source, with Android developer support or the extensiveness of the NDK app, meaning you're looking at abandoning Android as any kind of first steps programming platform without payments.
Note: I consider subscription requests as payments under duress and this is a freemium context which continues to go undefeated by the open source community.
There is more than one library for working in C++ in Android programming:
C++ - qt (A Nokia product, also available as LGPL)
C++ - Wxwidget (Available as GPL)
What is the best and useful debug tool in Linux environment for Perl and C++ scripts?
In related to that, does anyone know the differences between Eclipse to DDD tools?
Thank you,
YoDar.
use warnings; and -Wall, respectively.
Sorry, I don't do Perl.
But I do Eclipse & DDD.
Eclipse is an IDE (which also supports Perl). IF you use C/C++, for instance, it supports the GDB. If you can compile Perl, it will probably support that too, which means that you can step through your code, line by line, examining the call stack, looking at variables, changing their values, etc.
DDD is a front-end for GDB, so it can do all of that debugging stuff, but it is not an IDE that will let you edit & compile your code.
Generally, Eclipse is more than good enough, but when I get into complicated lists or structures with lots of pointers, I love DDD for this single picture - which speaks ten thousand words ...
From http://www.gnu.org/software/ddd/all.png
You may debug perl in console, but it's not the most user-friendly way
perl -d script.pl
In DDD documentation it says they're frontend for perl debugger too, so I guess you may configure it to use perl debugger.
Perl: Eclipse Epic with PadWalker module installed for debugging
C++: Eclipse CDT
I'm looking for the perfect Linux C++ debugger. I don't expect success, but the search should be informative.
I am a quite capable gdb user but STL and Boost easily crush my debugging skills. It not that I can't get into the internals of a data structure, it's that it takes so long I usually find another way( "when in doubt, print it out" ).
The macro language for gdb is weird and not very adaptive. Just look at the code for the stanford gdb utils to print out stl structures.
In short I'm unhappy with what I've got.
I recently stumbled upon Zero Bugs. It looks like a silver bullet. What do the current Zero Bugs users think of it?
Has anyone found other good solutions to the Linux C++ Debugger problem?
A development branch of gdb (part of gdb's Project Archer) adds Python support to gdb (to replace gdb's macros). There's a series of blog postings starting here that extensively covers getting started with Python-enabled gdb and offers several tutorials on using Python for defining new gdb commands and pretty printing of C++ data structures.
UndoDB is amazing if you don't mind paying for it. The reversible capability is much much faster than GDB's. http://www.undo-software.com/
There are simple scripts which let you dump STL structures from GDB.
Take a look here
You can try NetBeans IDE 6.5 with gdb 6.8, it is quite powerful!
http://www.netbeans.org/downloads/index.html
ddd (data display debugger)is quite good.....it is basically a visual gdb....
I use the following environment:
http://ec-lang.org/
It is a complete development environment for the eC language.
However, you can have a project with just c or c++ files without any eC specific files and build and debug them using the IDE.
This is the closest you will ever come to a "Borland C" like experience under linux.
It can be installed on Ubuntu/Debian with the following command:
sudo apt-get install ecere-sdk
Recentg gdb (e.g. version 8.1) and g++ (e.g. GCC 7, in february 2018) are able to debug standard C++ containers thru Python scripts.
I haven't done C++ development in Linux for a while now but when I did I had good luck when KDevelop's debugger. Nothing revolutionary but it let you quickly explore object properties like you are looking for.
Try ddd.
You can use Eclipse to step through C and C++ code if you are looking for an IDE type of debugger instead of a command-line debugger. It isn't perfect, but I've found it to work well for people already familiar with IDE debugging tools.
I am also partial to Valgrind for detecting memory errors.