delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/11/03/11:44:27

Sender: ml AT delorie DOT com
Message-ID: <345DFD86.3D63B3F9@cdata.tvnet.hu>
Date: Mon, 03 Nov 1997 17:36:22 +0100
From: Molnar Laszlo <molnarl AT cdata DOT tvnet DOT hu>
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: fsdb bug

Hi Workers!

It seems, that CTRL-G doesn't work perfectly with fsdb. I realized this
debugging perl, and wanted to jump to a symbol called _Perl_comppad.
However fsdb jumped to _Perl_comppad_name. It happens because the
binary search in debug/common/syms.c doesn't check the full name of
the symbol, but returns the first partial match. Below is a patch that
solves this problem for me (I hope it won't break something else).

Laszlo

*** src/debug/common/syms.c~    Sat Apr 22 19:29:52 1995
--- src/debug/common/syms.c     Mon Nov  3 03:54:12 1997
***************
*** 512,516 ****
--- 512,520 ----
        c = strncmp(name, syms_byname[mid].name+ofs, idx);
      if (c == 0)
+     {
+       while (mid && strncmp(name, syms_byname[mid-1].name+ofs, idx) ==
0)
+         mid--;
        return mid;
+     }
      if (c < 0)
        above = mid;

- Raw text -


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