RTEMS CPU Kit with SuperCore  4.11.3
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 "rtl-trace.h"
#include "rtl-obj-fwd.h"
Include dependency graph for rtl-debugger.c:

Functions

void _rtld_debug_state (void)
 Debugger break function. More...
 
int _rtld_linkmap_add (rtems_rtl_obj_t *obj)
 
void _rtld_linkmap_delete (rtems_rtl_obj_t *obj)
 

Variables

struct r_debug _rtld_debug
 The global debugger interface variable.
 

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.