ice799 (owner)

Forks

Revisions

gist: 219405 Download_button fork
public
Public Clone URL: git://gist.github.com/219405.git
Embed All Files: show embed
gdb_trigger.c #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* is this cool enough that it warrants a blog post?
*
* trigger breakpoint in GDB, from code.
*/
 
#include <stdio.h>
 
int main(int argc, char *argv[]) {
 
  if (argc > 3)
    asm("int $0x3\n");
  else
    printf("hi\n");
 
  return 0;
}