Is that the same as the free LC-Lint? I can't at the moment find a link
for that, but it's a very tool though I did not find a way to redirect
(pipe) the output to file. I ran it from a batch file - note in only runs in
windows as its a 32 bit application.
Has anyone know a better environment for LC-Lint?
Andrew Lohmann AIIE
Design Engineer
Bellingham + Stanley Ltd.
Longfield Road, Tunbridge Wells, Kent, TN2 3EY, England.
Tel: +44 (0) 1892 500400
Fax: +44 (0) 1892 543115
Website: www.bs-ltd.com
----- Original Message -----
From: Erich Styger
To:
Sent: Sunday, March 30, 2003 3:45 PM
Subject: RE: [68HC12] Metrowerks Disassembly Obfuscation - Help!
yeah, PC-lint is a real good thing.
Found glitches in the source code with it which are hard to find otherwise.
The plugin for PC-Lint is delivered with CodeWarrior too: just set the
linker to 'pclint linker' in the project preference panel and you
can use it as a front end to PC-Lint.
Erich
> -----Original Message-----
> From: Kellogg Dave [mailto:]
> Sent: Samstag, 29. Marz 2003 16:26
> To: '
> Subject: RE: [68HC12] Metrowerks Disassembly Obfuscation - Help!
> In addition to enabling all warnings, I use PC-Lint
> (www.gimpel.com). It is
> very configurable and much more picky than a compiler. One of
> its strengths
> is that it can look across multiple modules. Recommended. It
> has saved me
> several times.
> 607-656-2597
> -----Original Message-----
> From: Karl Lunt [mailto:]
> Sent: Thursday, March 27, 2003 2:39 PM
> To: '
> Subject: RE: [68HC12] Metrowerks Disassembly Obfuscation - Help!
> Also, turn the warning level all the way up. This means enable every
> warning that the compiler can produce. If your code still
> compiles without
> warnings, you are more assured of having created very clean code.
>
> (Naturally, there are some execptions to the above. For example, some
> compilers might gen a warning over formatting issues on otherwise
> perfectly
> good code; your mileage will vary.)
>
> Karl
> > -----Original Message-----
> > From: Mike Burgess [mailto:]
> > Sent: Thursday, March 27, 2003 11:19 AM
> > To:
> > Subject: Re: [68HC12] Metrowerks Disassembly Obfuscation - Help!
> >
> >
> > Paul,
> > Usually compile warnings are not useless, you should try at
> > all cost to
> > write code that
> > does not produce warnings. As was the case with your
> > integer. Sooner or
> > later
> > what you thought was useless warnings will come back to haut you.
> >
> >
> > Michael.
> >
> >
> > ----- Original Message -----
> > From: "Paul Johnson" <>
> > To: <>
> > Sent: Thursday, March 27, 2003 9:52 AM
> > Subject: RE: [68HC12] Metrowerks Disassembly Obfuscation - Help!
> >
> >
> > > Hi Erich,
> > >
> > > I could follow the common code optimization, and that makes
> > sense -- it
> > was
> > > the BSR -1 that really confused me. I generated this code by
> > right-clicking
> > > in in the editor window (in CodeWarrior) and selecting
> > "Disassemble". I
> > did
> > > not see any errors related to this, so I assume it was
displaying
> > > incorrectly but linking correctly.
> > >
> > > The actual problem that had me on my hands and knees
> > pouring through the
> > > assembly code was a much more subtle bug. Every function
> > in the chain
> > that
> > > had the failure worked correctly individually, but failed
> > when used in
> > > context. I looked for interrupts that might be stepping on
> > data, overflow
> > > of input buffers and all sorts of things. The answer was
> > much simpler,
> > but
> > > harder to detect.
> > >
> > > I have a routine -- unsigned long str8tolong(const char *
> > str); -- which
> > > expects str to be pointing at an 8 character hexadecimal
> > value and returns
> > > an unsigned long. I use it for parsing highly formatted
> > input data. I
> > have
> > > several similar routines in one file - strfun.c - that was
> > written, tested
> > > and added to a library a long time ago. It turns out that
> > str8tolong was
> > > the only one that did NOT have a prototype in the header
> > file. I have
> > > apparently never yet used this particular function from that
module.
> > >
> > > As a result, the compiler resorted to implicit parameter
> > declaration, and
> > > the return value was assumed (properly) to be of type
> > integer. Since it
> > was
> > > then assigned to a long, it was sign-extended to a long,
> > and my troubles
> > > began. This bug was darn hard to find.
> > >
> > > I never noticed the implicit parameter declaration warning
> > in the dozens
> > of
> > > meaningless warnings I get on every compile. Is there any
> > way to promote
> > a
> > > particular warning to an actual error? Or is there any way to get
a
> > > particular type of warning to really stand out at compile
> > time? This is a
> > > nasty one, and should get more attention.
> > >
> > > Thanks,
> > >
> > > Paul Johnson
> > >
> > > > -----Original Message-----
> > > > From: Erich Styger [mailto:]
> > > > Sent: Wednesday, March 26, 2003 7:19 AM
> > > > To:
> > > > Subject: RE: [68HC12] Metrowerks Disassembly Obfuscation -
Help!
> > > >
> > > >
> > > > Hello Paul,
> > > > what you see is called 'common code': the compiler
folds togehter
> > > > pieces of code
> > > > at to the end of the function.
> > > > You may use the option -Onf to switch this optimization
off.
> > > >
> > > > But some questions:
> > > > how did you generate the listing file? With the decoder
(decoding
> > > > the object
> > > > file)
> > > > or decoding the .abs file?
> > > > I ask because the output looks like generated from the
> > .abs file (say
> > > > function starts
> > > > at 0000243, but the presence of relocation/fixup
information)
> > > > 0000027C 07FF BSR skipWhitespace ;abs = 027D
> > > > says that it is an object file?
> > > >
> > > > What you see with the 0x07FF code pattern is the BSR
> > instruction with
> > the
> > > > offset -1 plus
> > > > a relocation/fixup which has to be resolved by the linker.
So if
> > > > the listing below is from the .abs file, this is
> > potentially a
> > bug.
> > > > In case the linker cannot resolve the BSR call, the
> > linker will issue an
> > > > error. Did you
> > > > see this?
> > > >
> > > > Hope this help,
> > > > Erich
> > > >
> > > > > -----Original Message-----
> > > > > From: Paul Johnson [mailto:]
> > > > > Sent: Mittwoch, 26. Marz 2003 01:44
> > > > > To:
> > > > > Subject: [68HC12] Metrowerks Disassembly Obfuscation -
Help!
> > > > >
> > > > >
> > > > > Hi Metrowerks gurus,
> > > > >
> > > > > I've disassembled a module in my program where I
think
> > there may be a
> > > > > problem. I have include the relevant section below,
which has a
> > > > > construction that I cannot understand. Can someone
explain it
> > > > to me? The
> > > > > problems are described inline, starting with ***.
> > > > >
> > > > > 143: char * parseLong(char * str,long * data)
> > > > > parseLong:
> > > > > 00000243 3B PSHD
> > > > > 145: str = skipWhitespace(str);
> > > > > 00000244 EC84 LDD 4,SP
> > > > > 00000246 0734 BSR *+54 ;abs = 027C
> > > > >
> > > > > *** I have to assume that there is a call of
> > skipWhitespace at 027C,
> > but
> > > > > wait until you see what's actually there
(below)
> > > > >
> > > > > 146: if ((*str == ',') || !(*str)) {
> > > > > 00000248 2704 BEQ *+6 ;abs = 024E
> > > > > 0000024A E600 LDAB 0,X
> > > > > 0000024C 2610 BNE *+18 ;abs = 025E
> > > > > 147: *data = 0;
> > > > > 0000024E EE80 LDX 0,SP
> > > > > 00000250 C7 CLRB
> > > > > 00000251 87 CLRA
> > > > > 00000252 6C02 STD 2,X
> > > > > 00000254 6C00 STD 0,X
> > > > > 148: if (*str) str++;
> > > > > 00000256 EE84 LDX 4,SP
> > > > > 00000258 E600 LDAB 0,X
> > > > > 0000025A 271C BEQ *+30 ;abs = 0278
> > > > > 0000025C 2017 BRA *+25 ;abs = 0275
> > > > > 151: *data = str8tolong(str);
> > > > > 0000025E B754 TFR X,D
> > > > > 00000260 160000 JSR str8tolong
> > > > > 00000263 160000 JSR ILSEXT
> > > > > 00000266 ED80 LDY 0,SP
> > > > > 00000268 6C42 STD 2,Y
> > > > > 0000026A 6E40 STX 0,Y
> > > > > 152: str+=8;
> > > > > 0000026C EC84 LDD 4,SP
> > > > > 0000026E C30008 ADDD #8
> > > > > 153: str = skipWhitespace(str);
> > > > > 00000271 0709 BSR *+11 ;abs = 027C
> > > > > 154: if (*str == ',') str++;
> > > > > 00000273 2603 BNE *+5 ;abs = 0278
> > > > > 00000275 08 INX
> > > > > 00000276 6E84 STX 4,SP
> > > > > 155: return(str);
> > > > > 00000278 EC84 LDD 4,SP
> > > > > 157: }
> > > > > 0000027A 30 PULX
> > > > > 0000027B 3D RTS
> > > > >
> > > > > *** Here's the apparent call to skipWhitespace
(which is at
> > > > 0135), but the
> > > > > disassembler says it's going to branch to 027d,
which would
> > > > start with the
> > > > > opcode FF and be out of phase with everything else.
> > > > >
> > > > > 0000027C 07FF BSR skipWhitespace ;abs = 027D
> > > > > 0000027E 6C86 STD 6,SP
> > > > > 00000280 B745 TFR D,X
> > > > > 00000282 E600 LDAB 0,X
> > > > > 00000284 C12C CMPB #44
> > > > > 00000286 3D RTS
> > > > >
> > > > > Can someone explain this to a tired, old programmer?
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Paul Johnson
> > > > >
> > > > >
> > > > >
> > > > > --------------------
> > > > >
> > > > >
> > > > >
> > > > > ">http://docs.yahoo.com/info/terms/
> > > > >
> > > > >
> > > >
> > > >
> > > >
> > > > --------------------
> > > >
> > > >
> > > >
> > > > ">http://docs.yahoo.com/info/terms/
> > > >
> > > >
> > >
> > >
> > >
> > > --------------------
> > >
> > >
> > >
> > > ">http://docs.yahoo.com/info/terms/
>
>
> --------------------
>
> ">http://docs.yahoo.com/info/terms/
> ------------------------
--------------------
--- Email Disclaimer --- Internet communications are not secure and therefore
Bellingham + Stanley Ltd does not accept legal responsibility for the contents
of this message. Any views or opinions presented are solely those of the author
and do not necessarily represent those of Bellingham + Stanley Ltd unless
otherwise specifically stated. If this message is received by anyone other than
the addressee, please notify the sender and then delete the message and any
attachments from your computer. --- End ---
--- Email Disclaimer ---
Internet communications are not secure and therefore Bellingham + Stanley Ltd
does
not accept legal responsibility for the contents of this message. Any views
or opinions presented are solely those of the author and do not necessarily
represent those of Bellingham + Stanley Ltd unless otherwise specifically
stated.
If this message is received by anyone other than the addressee, please
notify the sender and then delete the message and any attachments from your
computer.
--- End ---
|