ok lets see
(gdb) frame 0
#0 0x40b82f9c in __pthread_sigsuspend () from /lib/libpthread.so.0
(gdb) l
180 main.cpp: No such file or directory.
in main.cpp
(gdb) frame 1
#1 0x40b82d7c in __pthread_wait_for_restart_signal () from /lib/libpthread.so.0
(gdb) frame 2
#2 0x40b8443c in __pthread_alt_lock () from /lib/libpthread.so.0
(gdb) frame 3
#3 0x40b81748 in pthread_mutex_lock () from /lib/libpthread.so.0
(gdb) frame 4
#4 0x409db840 in pthread_mutex_lock () from /lib/libc.so.6
(gdb) frame 5
#5 0x40501624 in QRecursiveMutexPrivate::lock () from /tmp/libs/libqt-mt.so.3
(gdb) frame 6
#6 0x40501a00 in QMutex::lock () from /tmp/libs/libqt-mt.so.3
(gdb) frame 7
#7 0x40260158 in QApplication:
ostEvent () from /tmp/libs/libqt-mt.so.3
(gdb) frame 8
#8 0x0000f90c in SIGHUPHandler (sig=-4) at main.cpp:59
59 in main.cpp
(gdb) frame 9
#9 0x40b85bdc in __pthread_sighandler () from /lib/libpthread.so.0
(gdb)
so i am showing some frames over here... not sure exactly what they mean though.. because i didn't really play around with mutex locks....
to me it starts making sense in frame 7 basically...
but a bit of introduction first: this application is a GUI running independent of an algorithm written in c++.. the algorithm does some processing and then sends a signal to the GUI (SIGUSR1) to notify of the updated values... the data is exchanged between the 2 processes through the use of a shared memory segment.
when the signal is intercepted by the GUI , an event is posted internally like this:
void SIGHUPHandler( int sig )
{
QApplication::postEvent( qApp,
new QCustomEvent
( SIGHUPEVENT
) );
}
void SIGHUPHandler( int sig )
{
QApplication::postEvent( qApp, new QCustomEvent( SIGHUPEVENT ) );
}
To copy to clipboard, switch view to plain text mode
so it waits in queue till the processor serves the event..
to carry out this functionality and with the limited events concept i was familiar with at the time, i inherited main object class, to emit a signal, the 'qt' way when the event would be served.
class MainApplication
: public QApplication //inhirited the QApplication to add event post capability signalling{
Q_OBJECT
public:
MainApplication
( int &argc,
char **argv
) : QApplication(argc,argv
) {}
signals:
void signalUp(); //the signal definition of the application
protected:
void customEvent( QCustomEvent *ev ){
if ( ev->type() == SIGHUPEVENT )
emit signalUp();
}
class MainApplication : public QApplication //inhirited the QApplication to add event post capability signalling
{
Q_OBJECT
public:
MainApplication( int &argc, char **argv ) : QApplication(argc,argv) {}
signals:
void signalUp(); //the signal definition of the application
protected:
void customEvent( QCustomEvent *ev ){
if ( ev->type() == SIGHUPEVENT )
emit signalUp();
}
To copy to clipboard, switch view to plain text mode
events are posted by the controller approximately twice per second...
so what i'm basically 'reading' from the above gdb output, is that the SIGHUPHandler function posts an event.. and then some internal qt stuff are happening that brings us in frame 0, ie '__pthread_sigsuspend' ....
if i press 'c' for continue in gdb now...
gdb) c
Continuing.
[New Thread 16384]
Program received signal SIGSTOP, Stopped (signal).
[Switching to Thread 16384]
0x40b82f9c in __pthread_sigsuspend () from /lib/libpthread.so.0
(gdb)
thank you for your help
i hope this can help abit..
nass
Bookmarks