delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1992/06/09/17:38:04

To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Fixes for profiling bug
Organization: Code Generation Technology, Fremont, CA
Date: Tue, 09 Jun 92 14:06:20 -0700
From: "Thomas J. Merritt" <tjm AT netcom DOT com>

Djgpp generates incorrect calling information when profiling. The
following patch to /gnu/lib/mcount.c fixes the bug.

TJ Merritt
tjm AT netcom DOT com

*** mcount106.c	Tue Jun  9 12:05:36 1992
--- mcount.c	Tue Jun  9 12:20:03 1992
***************
*** 91,99 ****
    }
    /* lob off another page of memory and initialize the new table */
    m = (MTAB *)sbrk(sizeof(MTAB));
    m->prev = mtab;
    mtab = m;
-   memset(m, 0, sizeof(MTAB));
    m->calls[0].from = from;
    m->calls[0].to = to;
    m->calls[0].count = 1;
--- 91,99 ----
    }
    /* lob off another page of memory and initialize the new table */
    m = (MTAB *)sbrk(sizeof(MTAB));
+   memset(m, 0, sizeof(MTAB));
    m->prev = mtab;
    mtab = m;
    m->calls[0].from = from;
    m->calls[0].to = to;
    m->calls[0].count = 1;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019