Am 01.07.24 um 16:45 schrieb Niall Douglas via Boost:
The relevant implementation file can be found at:
https://github.com/boostorg/outcome/blob/master/include/boost/outcome/outcom...
__asm__(".pushsection \".debug_gdb_scripts\", \"MS\",@progbits,1\n" ".byte 4 /* Python Text */\n" ".ascii \"gdb.inlined-script\\n\"\n" ".ascii \"import gdb.printing\\n\"\n" ".ascii \"import os\\n\"\n");
That is really neat indeed! Only thing bothering me is the abundant quoting and quotes. Maybe it looks a bit better with raw string literals. I.e. instead of: this equivalent
__asm__(R"py(.pushsection ".debug_gdb_scripts", "MS",@progbits,1 .byte 4 /* Python Text */ .ascii "gdb.inlined-script\n" .ascii "import gdb.printing\n" .ascii "import os\n" )py"); It looses the indentation though (otherwise it would be contained in the binary. I also don't see a way to avoid the '.ascii "' and '\n"' boilerplate and just paste the python script but I think it more closely resembles it.
Alex