cpukit/sapi/src: added DEFINE_GDB_PY macro to exinit.c to embed gdb-inline section

This commit is contained in:
the-m3chanic
2024-07-08 21:58:23 +05:30
committed by Amar Takhar
parent 5fa414f37a
commit fad8219a4e

View File

@@ -61,6 +61,26 @@
RTEMS_SECTION(".rtemsroset.copyright") const char _Copyright_Notice[] = RTEMS_SECTION(".rtemsroset.copyright") const char _Copyright_Notice[] =
"Copyright (C) 1989, 2021 RTEMS Project and contributors"; "Copyright (C) 1989, 2021 RTEMS Project and contributors";
/*
* Additional Macro to add custom section (.debug_gdb_scripts) to
* every ELF being built on RTEMS, in order to add auto-loading
* support for Python scripts (specifically, GCC's pretty-printing
* scripts), by in-lining the Python script in the section.
*/
#define DEFINE_GDB_PY() \
asm( \
".pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n" \
".byte 4\n" \
".ascii \"gdb.inlined-script\\n\"\n" \
".ascii \"import sys\\n\"\n" \
".ascii \"import os.path\\n\"\n" \
".ascii \"sys.path.append(os.path.join(gdb.PYTHONDIR, 'rtems'))\\n\"\n" \
".ascii \"import rtems.stdcxx as stdcxx\\n\"\n" \
".byte 0\n" \
".popsection\n" \
)
static Objects_Information * static Objects_Information *
_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; _Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ];
@@ -101,6 +121,9 @@ static void rtems_initialize_data_structures(void)
_Scheduler_Handler_initialization(); _Scheduler_Handler_initialization();
_SMP_Handler_initialize(); _SMP_Handler_initialize();
/* Macro call to embed section in script for pretty-printing */
DEFINE_GDB_PY();
} }
RTEMS_LINKER_ROSET( _Sysinit, rtems_sysinit_item ); RTEMS_LINKER_ROSET( _Sysinit, rtems_sysinit_item );