Skip to content

Latest commit

 

History

History
22 lines (19 loc) · 831 Bytes

File metadata and controls

22 lines (19 loc) · 831 Bytes

#

Conditional Breakpoints

Conditionals on strings

(gdb) set $string_var = “StringToMatch” (gdb) cond 1 strcmp (string_variable_in_code, $string_var) == 0

Inserting a breakpoint in code

  • Can be done using inline ASM code. asm volatile (“int3;”);
  • These can’t be disabled, so it’s a good idea to keep them conditional. For eg: if (NULL == string) { * I want to break here * asm volatile (“int3;”); }
  • Example code : https://github.com/kmcallister/embedded-breakpoints