🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Roeber Mon, 10 Aug 1992 11:52
gprof bug
#256
Author: Roeber
Date: Mon, 10 Aug 1992 11:52
37 lines
1751 bytes
The top line of the Changelog file is:

Thu Jun 28 17:03:51 1990  Mike Haertel  (mike at ducky)

In reusing some of the gprof code for another program, I came across the
fact that the binary search routine that gprof uses in the val_to_sym function
contains an error such that it can stop the search on the symbol before
the correct one for the case where a pc value exactly matches a symbol
address.  To fix it I made the following change in the val_to_sym function
in the gprof.c file:

    struct mesym *m;
    int gap=nsym/4;
     
    m= &syms[nsym/2];
    for (;;) {
      if (m->value>val) {
        m-=gap;
        gap/=2;
+     } else if ((m + 1)->value == val)
+     {
+       return(m+1);
      } else if ((m+1)->value<val) {
        m+=gap;
        gap/=2;

While this is not a critical problem, it can result in the assignment of
time values to the wrong routines in some cases and should therefor be
fixed.     Fred

    _______________________________________________________
   |  Fred J Roeber,  Raytheon Submarine Signal Division   |
   |  1847 West Main Road,  Mail Stop 188                  |
   |  Portsmouth, RI  02871-1087  (401) 847-8000 (X4205)   |
   |                                                       |
   |                   fjr@ssd.ray.com                     |
   |_______________________________________________________|
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads