[m-dev.] Corrupted variable names in debugger

Ralph Becket rafe at cs.mu.OZ.AU
Fri Feb 21 15:08:32 AEDT 2003


Peter Moulder, Friday, 21 February 2003:
> On Wed, Feb 19, 2003 at 02:47:23PM +1100, Ralph Becket wrote:
> 
> > I'm tracing through make_hlds with --trace deep and several variable
> > names are being printed as corrupted strings (i.e. a lot of gibberish
> > including control characters that are doing something whacky to the
> > terminal.)  I recall this having arisen and been dealt with before.  Is
> > there an obvious fix?
> 
> I don't know of one.  I've had a quick look at some of the code closer
> towards the mdb side, and can't see any obvious problems.  For want of
> anything more helpful, I'll ask a few diagnosis questions.  (Don't take
> this as a commitment to act on your reply :-) .)

Zoltan came by the other day and found the problem: code compiled with
debugging grades includes a symbol table implemented as an array of char
with strings separated by NULs and indexed by short ints.  The short
ints should be unsigned, but they weren't, hence any symbol with an
offset more than 32767 would be looked up using a negative index into
the symbol table.  The fix was checked in on Wednesday, I believe.

Ta,
	Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list