RTEMS  5.1
Functions | Variables
rtl-debugger.c File Reference

RTEMS Module Loading Debugger Interface. More...

#include <stdio.h>
#include <link.h>
#include <rtems/rtl/rtl.h>
#include <rtems/rtl/rtl-trace.h>
#include <rtems/rtl/rtl-obj-fwd.h>

Functions

void _rtld_debug_state (void)
 
int _rtld_linkmap_add (rtems_rtl_obj *obj)
 
void _rtld_linkmap_delete (rtems_rtl_obj *obj)
 

Variables

struct r_debug _rtld_debug
 

Detailed Description

RTEMS Module Loading Debugger Interface.

Inspection of run-time linkers in NetBSD and Android show a common type of structure that is used to interface to GDB. The NetBSD definition of this interface is being used and is defined in <link.h>. It defines a protocol that is used by GDB to inspect the state of dynamic libraries. I have not checked GDB code at when writing this comment but I suspect GDB sets a break point on the r_brk field of _rtld_debug and it has code that detects this break point being hit. When this happens it reads the state and performs the operation based on the r_state field.

Function Documentation

◆ _rtld_debug_state()

void _rtld_debug_state ( void  )

Debugger break function. Call when debugging to have it read the _rtld_debug variable.

Variable Documentation

◆ _rtld_debug

struct r_debug _rtld_debug

The global debugger interface variable.