RTEMS | Draft: Add new section: .debug_gdb_scripts, across all executables on RTEMS (!98)
Chris Johns (@chris)
gitlab at rtems.org
Wed Jul 17 00:19:25 UTC 2024
Chris Johns commented on a discussion on cpukit/sapi/src/exinit.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/98#note_109405
>
> +/*
> + * 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\", at 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" \
Yes I think we should add a new file to `rtrems-tools` called `pprinters.py` and the debug section in the MR loads that file. This file can load the installed `stdcxx.py`. This extra layer gives us the ability to update `rtems-tools` to automatically load any other printers we development. For example the pretty printers to inspect internal structures.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/98#note_109405
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20240717/7c03483a/attachment-0001.htm>
More information about the bugs
mailing list