1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Remove obsolete BSSL debug print routines (#5368)

Fixes #5356
This commit is contained in:
Earle F. Philhower, III 2018-11-23 12:08:40 -08:00 committed by GitHub
parent 016f3b8103
commit 19a0a0b6fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1373,68 +1373,4 @@ bool WiFiClientSecure::loadPrivateKey(Stream& stream, size_t size) {
return ret;
}
// Debug printout helpers for BearSSL library when libbearssl.a is compiled in debug mode
// This is really only for debugging the core BearSSL library itself, and not the IDE
// SSL debugging which should focus on the WiFiClientBearSSL objects.
extern "C" {
#if CORE_MOCK
void br_esp8266_stack_proxy_init(uint8_t *space, uint16_t size) {
(void)space;
(void)size;
}
void _BearSSLCheckStack(const char *fcn, const char *file, int line) {
(void)fcn;
(void)file;
(void)line;
}
#else // !CORE_MOCK
extern size_t br_esp8266_stack_proxy_usage();
void _BearSSLCheckStack(const char *fcn, const char *file, int line) {
static int cnt = 0;
register uint32_t *sp asm("a1");
int freestack = 4 * (sp - g_pcont->stack);
int freeheap = ESP.getFreeHeap();
static int laststack, lastheap, laststack2;
if ((laststack != freestack) || (lastheap != freeheap) || (laststack2 != (int)br_esp8266_stack_proxy_usage())) {
Serial.printf("%s:%s(%d): FREESTACK=%d, STACK2USAGE=%zd, FREEHEAP=%d\n", file, fcn, line, freestack, br_esp8266_stack_proxy_usage(), freeheap);
if (freestack < 256) {
Serial.printf("!!! Out of main stack space\n");
}
if (freeheap < 1024) {
Serial.printf("!!! Out of heap space\n");
}
Serial.flush();
laststack = freestack;
lastheap = freeheap;
laststack2 = (int)br_esp8266_stack_proxy_usage();
}
// BearSSL debug can get very chatty, add yields to avoid WDT
if (cnt == 100) {
yield();
cnt++;
}
}
#endif // !CORE_MOCK
void _BearSSLSerialPrint(const char *str) {
static int cnt = 0;
Serial.printf("%s", str);
// BearSSL debug can get very chatty, add yields to avoid WDT
if (cnt == 100) {
yield();
cnt++;
}
}
};
};