1

I have been looking at kdbg source code. I noticed there are a few places where the following source line appears:

::kill(pid(), SIGINT);

My problem is that I cannot understand where pid() is implemented. From my searches on the web, it doesn't seem to be a system call. Grepping the kdbg source tree did not yield any clues where it is implemented.

I am not that experienced in C++ although I have done many years of C development. This is quite baffling. Anyone has any ideas?

David C
  • 25
  • 3

1 Answers1

1
cd tmp
git clone git://repo.or.cz/kdbg.git
grep -lrE "pid\(\)" *
>kdbg/gdbdriver.cpp
>kdbg/xsldbgdriver.cpp
>kdbg/dbgdriver.cpp
>kdbg/dbgmainwnd.cpp
grep -C 20 "pid\(\)" kdbg/gdbdriver.cpp
>.... Extra stuff
>void GdbDriver::interruptInferior()
>{
>    ::kill(pid(), SIGINT);
>.... Extra stuff
echo "Ah, it's a class... I bet pid()is a function"^C
echo "After following the inheritance chain, I found..."^C

http://doc.qt.io/qt-5/qprocess-obsolete.html#pid

It's a QProcess member function. This class inherits from a class that inherits from QProcess. =)

druckermanly
  • 2,694
  • 15
  • 27