πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #228594

Having something fail if-and-only-if the debugger is Not running !

#228594
From: Jeffβ–²Relf
Date: Sat, 10 Jan 2009 10:20
32 lines
2461 bytes
β€œ I miss the IDE's I used to be able to afford, though, and
  their debuggers in particular. ”, you told me.

I use Visual Studio's debugger to scan through my code,
giving it more thought, in the context of its data.

Unfortunately, the debugger pads allocations on the heap,
thus preventing certain β€œ bad read address ” errors.

Nothing worse than:
  having something fail if-and-only-if the debugger is  Not  running !

When that happens, as it did to me today,
I thought: β€œ OK, what did I change recently ? ”.
Sure enough, a recent change introduced a  Bad  bug.

β€œ Encoded words ” start with the β€œ =? ” prefix.
Encoded Words convert 8-bit chars ( UTF-8 ) into 7-bit ASCII.
( Most Chinese and Russian posts use raw 8-bit chars in their headers,
  not encoded words ― as well they should )

To scan for the β€œ =? ” prefix, I erroneously wrote:
β€œ While( Ch != '=' && Ch2 != '?' ) ”;
but I meant: β€œ While( Ch != '=' || Ch2 != '?' ) ”.

The β€œ While( Should_Loop ) ” thingy is a β€œ macro ”, a text replacement,
which expects P ( see below ) to point to the first character in
the null-terminated string ( Ch and Ch2 are integers ):

#define  While( Should_Loop )  Ch = 1 , P -- ;  \
  while ( Ch && ( Ch = * ++ P, Ch2 = ! Ch ? 0 : P[ 1 ], Should_Loop ) )
Technical Details
Message-ID: <Jeff_Relf@Seattle.2009_Jan.10|2.20am|b>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news-1.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <ccb63$495fcd4c$5ed00124$4874@cache3.tilbu1.nb.home.nl> <Jeff_Relf@Seattle.2009_Jan.3|7.53pm|Y> <20090103233926.46cd1151@prezmyra.remarqs.net> <Jeff_Relf@Seattle.2009_Jan.4|2.01pm|l> <MPG.23cae50029946735989692@127.0.0.1> <qy7gwvrsg9q5$.1ft1dyzp4iui4$.dlg@40tude.net>

Show Full Headers
Complete Article Headers
Message-ID: <Jeff_Relf@Seattle.2009_Jan.10|2.20am|b>
Subject: Having something fail if-and-only-if the debugger is Not running !
Date: Sat, 10 Jan 2009 10:20:32 +0000
From: Jeffβ–²Relf <Jeff_Relf@Seattle.Test>
References: <ccb63$495fcd4c$5ed00124$4874@cache3.tilbu1.nb.home.nl> <Jeff_Relf@Seattle.2009_Jan.3|7.53pm|Y> <20090103233926.46cd1151@prezmyra.remarqs.net> <Jeff_Relf@Seattle.2009_Jan.4|2.01pm|l> <MPG.23cae50029946735989692@127.0.0.1> <qy7gwvrsg9q5$.1ft1dyzp4iui4$.dlg@40tude.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-alt.free.newsservers.20150605.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news-1.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
Newsgroups: alt.free.newsservers,news.software.readers
Lines: 32
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: individual.net JoLnP8CJN6t8t5ik1CbPnA2PJXrMsvVrd1nh7Z0H/NlQZ5z+CA
Cancel-Lock: sha1:WQuH8KuHqxj0VExjFi3FoTZhL9E=
User-Agent: JeffRelf.F-M.FM/X.ZIP