> (...)
называется подстановкой процесса . Это позволяет «внешней» программе писать во «внутреннюю» программу, как если бы это был файл.
В этом случае он записывает stderr
в tee -a $ {LOGFILE}> & 2
, который добавляется в LOGFILE
, а затем также записывает все обратно в stderr
.
Оператор перенаправления может идти в любом направлении для подстановки процесса, поэтому вы можете писать в него, как в этом примере, или использовать для чтения из него, что удобно способ, например, выполнить цикл
while
, не выполняя его в самой подоболочке.
Вероятно, это проблема с оптимизацией gcc и последующей таблицей номеров строк , созданной DWARF который отображает
memory addresses that contain the executable code of a program and the source lines that correspond to these addresses
(page 8)
Самое простое решение — использовать stepi при достижении функции
Из Руководство пользователя GDB (, стр. 65)
step
Continue running your program until control reaches a different source line, then stop it and return control to gdb.
....
The step command only stops at the first instruction of a source line. This pre- vents the multiple stops that could otherwise occur in switch statements, for loops, etc. step continues to stop if a function that has debugging information is called within the line. In other words, step steps inside any functions called within the line.
Also, the step command only enters a function if there is line number information for the function. Otherwise it acts like the next command. This avoids problems when using cc -gl on MIPS machines. Previously, step entered sub- routines if there was any debugging information about the routine.