Cygwin: Zero out gmon header before use
Tools that process gmon.out files can be confused by gmon header fields with garbage in them due to lack of initialization. Repair that.
This commit is contained in:
parent
a39ae40b86
commit
5c9c31c52b
|
@ -224,6 +224,7 @@ _mcleanup(void)
|
||||||
write(log, dbuf, len);
|
write(log, dbuf, len);
|
||||||
#endif
|
#endif
|
||||||
hdr = (struct gmonhdr *)&gmonhdr;
|
hdr = (struct gmonhdr *)&gmonhdr;
|
||||||
|
bzero(hdr, sizeof *hdr);
|
||||||
hdr->lpc = p->lowpc;
|
hdr->lpc = p->lowpc;
|
||||||
hdr->hpc = p->highpc;
|
hdr->hpc = p->highpc;
|
||||||
hdr->ncnt = p->kcountsize + sizeof(gmonhdr);
|
hdr->ncnt = p->kcountsize + sizeof(gmonhdr);
|
||||||
|
|
Loading…
Reference in New Issue