Gems

In a previous Gem, a simple use case of breakpoint commands was provided to check some program properties at run time. This Gem extends this use case to show some of the expressive power of the Python API. Continue Reading in Ada Answers »

In the previous Gem we saw how GDB provides scripting capabilities
through its macro-coding language, which allows customization of the debugger
using the .gdbinit file. In this Gem, we explore more
advanced features of GDB scripting. Continue Reading in Ada Answers »

GDB, the GNU Project Debugger, is a powerful tool. General use
includes basic CLI commands -- break, run, print, etc. -- but there is so
much more you can do with it.
One of those capabilities is scripting. Just as you have a .rc for
your shell configuration, you can also add a .gdbinit for the
debugger. This Gem describes some of the available features of GDB scripting
and general customization with .gdbinit.

This Gem discusses some portability issues related to file systems. In particular, it addresses
matters of file names and dealing with case-sensitive vs. case-insensitive file systems, character sets,
and symbolic links, and also gives an introduction to the utility package GNATCOLL.VFS.

One of the main issues raised by interfacing Ada and C++ is propagation of exceptions from one environment to the other. In this Gem, we’ll demonstrate how the new exception mechanism implemented in GNAT allows catching Ada exceptions in C++, and vice versa. Note that the following code will work starting with GNAT Pro 7. Continue Reading in Ada Answers »

This series of Gems explores the GNAT Ada programming environment for the Lego Mindstorms robotics kit. The series examines the high- and low-level interfaces to the hardware, the language subset supported by the underlying run-time library, and how to use the environment effectively. We’ll examine other topics as well. This Gem introduces the basic steps of the Mindstorms hardware initialization and shutdown. Continue Reading in Ada Answers »

The GNAT Components Collection provides a package with facilities for logging information to various text files. Extra information can be output for each log, providing convenient ways to understand the behavior of an application when a debugger is not available. Continue Reading in Ada Answers »

The visitor pattern is a design pattern that provides a way to execute specific methods on an object (the visitor) depending on the type of another object. Since the exact subprogram called depends on both types of the objects, this pattern is often called double dispatching. Continue Reading in Ada Answers »

This series of Gems explores the GNAT Ada programming environment for the Lego Mindstorms robotics kit. The series will examine the high- and low-level interfaces to the hardware, the language subset supported by the underlying run-time library, and how to use the environment effectively. We’ll examine other topics as well. This first Gem introduces the general issue of the Ada language subset available to programmers and shows how the Ada interfaces address one specific aspect of that subset. Continue Reading in Ada Answers »

This is the fifth in a series of Gems introducing the facilities defined by the optional annex for Distributed Systems of the Ada Reference Manual (Annex E).
In the previous installment, we showed how to integrate DSA code as a
stand-alone Ada library in a C/C++ application.

In this installment, we show how the DSA name server can be embedded in the
main partition, rather than started as a stand-alone process.

This Gem was contributed by Ada Magica (C.K.W. Grein), as a followup
to an earlier Gem. Christoph explores ways in which the API for reference-counted
types can be made safer by taking advantage of some Ada 2005 features.

This series of two Gems explains how to use the GNAT Components
Collection to interface your Ada code with Python. The first Gem described what
benefits this could bring to your application, and the difficulties there would
be in interfacing directly to the Python library. The second Gem shows how
to get started with GNATCOLL to make the interfacing much easier.

This series of two Gems explains how to use the GNAT Components
Collection to interface your Ada code with Python. The first Gem describes the
benefits this could bring to your application as well as the difficulties there would
be in interfacing directly to the Python library. The second Gem will show how
to get started with GNATCOLL to greatly simplify the interfacing process.

In the programming of real-time systems, code that deals with concurrency and real-time often draws from explicit or implicit recurring patterns. It therefore is best factored out. In this series of Ada Gems,
we illustrate a set of code pattern archetypes that are intended to ease the development of real-time systems.