Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DebugBreak in Unix/ Linux?

Do we have similar windows API of DebugBreak in Unix/ Linux. I want to debug a daemon process which should open NetBeans when DebugBreak statement is executed. Thanks in advance.

like image 515
Viswesn Avatar asked Sep 27 '11 09:09

Viswesn


2 Answers

there is __builtin_trap() GCC intrinsic.

like image 173
Gregory Pakosz Avatar answered Sep 20 '22 16:09

Gregory Pakosz


Whav! this is what I am looking for Embedded break points in C http://mainisusuallyafunction.blogspot.in/2012/01/embedding-gdb-breakpoints-in-c-source.html and to get sample program have a look in to https://github.com/kmcallister/embedded-breakpoints

like image 36
Viswesn Avatar answered Sep 20 '22 16:09

Viswesn