-static bool FindKernelSymbol(const KernelSymbol& sym1, const KernelSymbol& sym2) {
- return sym1.addr == sym2.addr && sym1.type == sym2.type && strcmp(sym1.name, sym2.name) == 0 &&
- ((sym1.module == nullptr && sym2.module == nullptr) ||
- (strcmp(sym1.module, sym2.module) == 0));
+static bool ModulesMatch(const char* p, const char* q) {
+ if (p == nullptr && q == nullptr) {
+ return true;
+ }
+ if (p != nullptr && q != nullptr) {
+ return strcmp(p, q) == 0;
+ }
+ return false;
+}
+
+static bool KernelSymbolsMatch(const KernelSymbol& sym1, const KernelSymbol& sym2) {
+ return sym1.addr == sym2.addr &&
+ sym1.type == sym2.type &&
+ strcmp(sym1.name, sym2.name) == 0 &&
+ ModulesMatch(sym1.module, sym2.module);