源代码中的 Kdbg pid() 调用

Kdbg pid() call in source

我一直在看kdbg源代码。我注意到有几个地方出现了以下源代码行:

::kill(pid(), SIGINT);

我的问题是我无法理解 pid() 的实现位置。从我在网上搜索,它似乎不是系统调用。 Grepping kdbg 源代码树没有产生任何实现它的线索。

尽管我已经进行了多年的 C 开发,但我在 C++ 方面的经验并不丰富。这很莫名其妙。有人有什么想法吗?

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

它是一个 QProcess 成员函数。此 class 继承自 class,后者继承自 QProcess。 =)