From: Andrii Nakryiko > Sent: 14 April 2021 21:02 > > While -Og is designed to work well with debugger, it's still inferior to -O0 > in terms of debuggability experience. It will cause some variables to still be > inlined, it will also prevent single-stepping some statements and otherwise > interfere with debugging experience. So switch to -O0 which turns off any > optimization and provides the best debugging experience. Surely the selftests need to use the normal compiler options so the compiler is generating the same type of code. Otherwise you are likely to miss out some instructions completely. For normal code I actually prefer using -O2 when dubugging. If/when you need to look at the generated code you can see the wood for the trees, with -O0 the code is typically full of memory read/write to/from the stack. About the only annoying thing is tail-calls. They can get confusing. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)