Set breakpoint in C or C++ code programmatically for gdb on Linux -


how can set breakpoint in c or c++ code programatically work gdb on linux?

i.e.:

int main(int argc, char** argv) {     /* set breakpoint here! */     int = 3;     a++;  /*  in gdb> print a;  expect result 3 */     return 0; } 

one way signal interrupt:

#include <csignal>  // generate interrupt std::raise(sigint); 

in c:

#include <signal.h> raise(sigint); 

update: msdn states windows doesn't support sigint, if portability concern, you're better off using sigabrt.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -