Перейти к содержимому

Debuggers: What Happens When You Set a Breakpoint

HeapSmith

0:00 / 0:00

Debuggers: What Happens When You Set a Breakpoint

111 просмотров · 7 дн. назад
HeapSmith
105 подписчиков
111 просмотров · 7 дн. назад
You click line six, press run, and your program freezes right there, so what did the debugger actually do? It wrote one byte into your program, 0xCC, the x86 breakpoint instruction. We follow that byte from the debug info's line table to the trap, through the kernel's SIGTRAP and back to your editor, catch a program reading its own breakpoint, and measure why a conditional breakpoint that never stops can make a loop over a million times slower. Related Videos ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ What Happens When Your Program Segfaults:    • What Happens When Your Program Segfaults   How a CPU Runs Your Code:    • How a CPU Runs Your Code   How Virtual Memory Works:    • How Virtual Memory Works   Inside the Python Interpreter:    • Inside the Python Interpreter   What Happens When You Press a Key:    • What Happens When You Press a Key   Contents ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ 00:00 - Line Six 00:30 - From a Line to an Address 01:33 - Two Programs, One Memory 02:39 - One Byte 04:02 - The Program Can See It 04:55 - The Trap 06:05 - Stopped, Not Killed 07:18 - Getting Past It 08:38 - The Cost of a Condition 09:52 - When a Byte Isn't Enough #operatingsystems #computerscience #programming