"Terminate" under Momentics IDE

I was wondering if anyone knew how I could include code in my application
that would be triggered when
I “Terminate” the appication from my Debug Momentics window. I tried
catching all signals but Momentics “Terminate” does not trigger any of
those.

My application must clean up properly or else I have to reboot the machine.

Mike

mik <mkonstantinides@connecttech.com> wrote:
m > I was wondering if anyone knew how I could include code in my application
m > that would be triggered when
m > I “Terminate” the appication from my Debug Momentics window. I tried
m > catching all signals but Momentics “Terminate” does not trigger any of
m > those.

m > My application must clean up properly or else I have to reboot the machine.

m > Mike

Does atexit() do what you need?


Bill Caroselli – Q-TPS Consulting
1-(708) 308-4956 <== Note: New Number
qtps@earthlink.net

Unfortunatly atexit() does not work either.

“Bill Caroselli” <qtps@earthlink.net> wrote in message
news:bl1s2b$5g0$1@inn.qnx.com

mik <> mkonstantinides@connecttech.com> > wrote:
m > I was wondering if anyone knew how I could include code in my
application
m > that would be triggered when
m > I “Terminate” the appication from my Debug Momentics window. I tried
m > catching all signals but Momentics “Terminate” does not trigger any of
m > those.

m > My application must clean up properly or else I have to reboot the
machine.

m > Mike

Does atexit() do what you need?


Bill Caroselli – Q-TPS Consulting
1-(708) 308-4956 <== Note: New Number
qtps@earthlink.net

mik <mkonstantinides@connecttech.com> wrote:

I was wondering if anyone knew how I could include code in my application
that would be triggered when
I “Terminate” the appication from my Debug Momentics window. I tried
catching all signals but Momentics “Terminate” does not trigger any of
those.

My application must clean up properly or else I have to reboot the machine.

Hm… it uses whatever gdb/pdebug would use to do that, but I don’t know
what they do either.

But, as a work-around, instead of “terminating” with the debugger,
in the Debug view, click on the line that says “QNX GDB Debugger”,
this should make the “Disconnect” icon in the Debug command bar
(it is the 4th icon from the left – Run, Pause, Stop, Disconnect,
looks like the letter N, but with round balls on the two ends of the
line). This will detach gdb from your program. It is now a normal
program. Then, go to the target navigator, find your program, and
right-click on it, and select “deliver signal” – pick any signal
you want, and catch that in your signal handler, clean up…

-David

QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.