Skip to content

Commit d569b02

Browse files
committed
Debug: match logging option
1 parent 120a790 commit d569b02

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
// Get string length without trailing terminator
1818
#define sizeof_str_noterm(instr) (sizeof(instr) - 1)
1919

20+
// DEBUG_LOG_MATCHES
21+
2022
#endif // _COMMON_H

src/gbtoolchainid.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ bool find_pattern(const uint8_t * p_pattern, uint32_t pattern_len) {
7676

7777
if (memcmp(p_match, p_pattern, pattern_len) == 0) {
7878
cur_addr = (uint32_t)(p_match - g_p_searchbuf);
79-
79+
#ifdef DEBUG_LOG_MATCHES
80+
printf("At: 0x%8x\n", cur_addr);
81+
for (int c=0; c < pattern_len; c++)
82+
printf("0x%2x, ", p_pattern[c]);
83+
printf("\n\n");
84+
#endif
8085
return true;
8186
}
8287
} else

0 commit comments

Comments
 (0)