C++ Builder IDE >> stack frames in codeguard

by grahamo » Tue, 22 Nov 2005 18:26:21 GMT


Hi,

toiling with codeguard.... sigh :(

When looking at the codeguard window and expanding on a resource leak (I have to expand it to see what dll/file/class CG thinks the leak is in), however I only see 6 stack frames. I'd like to increase this but looking at the codeguard and debugger options I can't see how to increase this value. Anybody know what option is needed?

Also, in light of the quality of the tool (at least in my environment) I really am sorta obliged to look elsewhere for a memory leak analysis s/w. Anybody successfully used any other tools with Borland 6? Boundschecker/Smart heap etc. etc? I can't believe this thing is actually shipped.... there's a few of us using codeguard at the moment and I would quite honestly put my productivity with codeguard at approximately 10% of what it would be with a good tool like purify (not supported unfortunately !)


sigh. have a nice day

G



C++ Builder IDE >> stack frames in codeguard

by grahamo » Tue, 22 Nov 2005 19:27:50 GMT



thanks for that response Andrew,

this point;


is the crux of the point. I am TRYING to analyse the code (legacy code, not mine and there's lots of it) however codeguard is just plain bad. For example, I shut down my application with CG enabled about 20 minutes before lunch. I have been away for over an hour, thats 80 minutes, and the darn thing is still issuing reports! I would *love* to attack the leaks etc but codeguard is so pitifully slow and weak on its reporting capability that it's torture.

Imagine waiting 80 minutes and all you have is thousands of lines of "resource leak" in the output window. I have to manually expand every single line to see what leak came from where. No summary is given of where the leak is located (unless I expand....not feasible with so many reports).

Also lets say I don't care about startup leaks.. they're static and can be ignored. But when I push button X I want to see what the leaks are. Not possible with Codeguard. It insists on trundling along and will not issue any report until I shut down the app. Sigh.

I can't believe its not even possible to increase the number of stack frames output. sigh again.

I'm going to try other tools in parallel with CG.

thanks for trying to help though.

G





I think the point






C++ Builder IDE >> stack frames in codeguard

by Andrue Cope [TeamB] » Tue, 22 Nov 2005 19:47:52 GMT





Join the club :(

This is a feature request already on QC. It's something that catches us
out quite a lot.


AQTime works but is a bit finicky to set up to profile memory usage.
That could just have been me though :)

FWIW I have hardly ever had any problems with CG. Very, very
occasionally it reports spurious buffer overruns but 99.9% of the time
it is spot on. Our golden rule (and my advice to you) is that if CG is
doing anything you don't expect/want (reporting issues, crashing) you
should suspect your code first and foremost.
--
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html


stack frames in codeguard

by grahamo » Tue, 22 Nov 2005 20:02:20 GMT


Thanks for that Duane...I am downloading it right now.

Interestingly a codeguard enabled exe is STILL trying to shut down (code guard is generating thousands of lines of reports which, while probably accurate (I'll assume they are) are unusable due to their format and detail (lack of sufficient stack frames) . I will laugh if I get this other app up and running before codeguard finishes its drivel output... which its been trying to do for the last two hours...hilarious!

If this works I'll get the dudes here to look into purchasing the product. Fingers crossed its ok out of the box. thanks for the info.

G








stack frames in codeguard

by Duane Hebert » Tue, 22 Nov 2005 20:48:37 GMT





You can try memory validator.
http://www.softwareverify.com/index.html

It allows monitoring allocations during runtime.
Works well with VC7.3. It supposedly supports
Borland but you'll need to check with them. I've
had it sort of working with BCB but didn't have
the time to pursue it. They have excellent support
though and the price isn't bad.

FWIW I've always found CG useful but at times
buggy. Don't know if it's improved in Dexter.

When we were developing full out in BCB
we would generally use CG and Memory Sleuth.
Memory Sleuth was excellent but it is no longer
available. AQTime looks good but I had trouble
getting it to work and it's a bit expensive.




stack frames in codeguard

by grahamo » Tue, 22 Nov 2005 21:47:28 GMT


Duane,

I owe you a drink man!! I have installed and extracted *useful* diagnostic information from "validator".... in a matter of minutes I have a complete diagnostic output that allows me to configure the number of stack frames, outputs the lib/dll, object, size in bytes and it lets me jump straight into the code. There's sure to be a tonne of other features that I will discover but the main point is that if I had started with this tool yesterday I would have saved myself an awful lot of unnecessary pain. In short, every single codeguard failing no longer exists with this tool. I can now get productive.

Cheers mate

Graham









stack frames in codeguard

by Duane Hebert » Tue, 22 Nov 2005 22:04:45 GMT




guard is generating thousands of lines of reports which, while probably
accurate (I'll assume they are) are unusable due to their format and detail
(lack of sufficient stack frames) . I will laugh if I get this other app up
and running before codeguard finishes its drivel output... which its been
trying to do for the last two hours...hilarious!
Fingers crossed its ok out of the box. thanks for the info.

Hopefully it works out for you. As I said, I only had it partially
working with BCB as BCB isn't my main tool these days.
The support is great though if you get stuck. You can also
request them to add things and they will if they make sense.

As for stack frames, you can control the depth in the configuration.
The thing that I like with MV is that you can look at stuff in real time.



stack frames in codeguard

by Duane Hebert » Tue, 22 Nov 2005 23:48:43 GMT

> I owe you a drink man!! I have installed and extracted *useful* diagnostic
information >from "validator".... in a matter of minutes I have a complete
diagnostic output that allows >me to configure the number of stack frames,
outputs the lib/dll, object, size in bytes and it >lets me jump straight
into the code. There's sure to be a tonne of other features that I will
yesterday I would have >saved myself an awful lot of unnecessary pain. In
short, every single codeguard failing no >longer exists with this tool. I
can now get productive.

You can try to mail me a Guinness but I'm not sure if it
will get through customs. They make a good product
for a good price and support it well. I just wasn't sure
how well it worked with Borland.

Check out the configuration settings in MV. You can test
a lot of different things.
Also, you may want to look at the different pages like
Hotspots. This one gives you a rudimentary profiler.
They're working on a full blown profiler.




Similar Threads

1. stack trace and stack frame - CSharp/C#

2. stack frame stack trace

Hi 
My app is supposed to print the line number and file name 
whenever an exception occurs. I have tried the following 
piece of code. I am always getting a file name of null and 
file number = 0

StackTrace st = new StackTrace(true);
StackFrame sf = st.GetFrame(0);
int LineNumber = sf.GetFileLineNumber();
String FileName = sf.GetFileName();

I am running a debug version of my C# program. Also please 
let me know how i can get these information when i run a 
release build of my program. Thank you all very much.

3. Stack frame incorrect on stack unwinding during exception

4. Pascal Stack Frame prologue

Hi folks,
I was chasing to see what happens when I disassembled an old DOS BPW app.
Inside the function "MaxAvail", I see this
45              inc bp
55             push bp
8B EC       mov bp,sp
1E            push ds

I obtained a program called intrfc, I tried to dump the core structure for 
Turbo3.tpu which contains "maxavail"
But the result was pretty surprising.

55 89 E5 83 EC

which was totally different from what I expected (different from the 
disassembler results)
Was I dumping the wrong file? or it was supposed to be like this? any ideas?
Thanks
Jack



5. JCL Debug: no stack frame - Borland C++ Builder VCL Components

6. QC 48623:Size and speed optimizations corrupt stack frame

I have just reported a critical error from C++Builder 2007 to
QualityCentral, see report number on subject.

This is the text of the report:

>I have imported all of my work projects from BDS2006 to CB++2007, and just *one* has failed to run corrcetly after importing.
>
>I have stripped down the offending part to a really small test case.
>
>Test case will run OK when compiled with No Optimizations or with any Selected optimizations settings, but will throw exceptions when run with Size or Speed optimizations selected. The exception will be variable depoending on the rest of the code, because it is caused by a function return without correctly restoring ESP register.
>
>Complete test case in test.cpp/cbproj attachment. Offending function decompiled on bith cases (ok and error case), in test.txt attachment.
>
>BTW, which special optimizations options are applied in Size or Speed cases that are not listed for Selected optimizations? I woulkd really love to know.

Attachments located on the report!

Best regards,

zara

7. Adding watches for other stack frames. - C++ Builder IDE

8. JCL Debug: no stack frame

Hi,

I've tried to ask this on the Project JEDI yahoo group, but it seems 
nobody is there. I hope someone here can help me:

I've added a JCL Exception dialog to my BDS 2006 C++ project. When an 
exception occurs, this dialog shows the details of the exception. So far 
so good. But the stack trace is missing. I see the exception address, 
loaded modules etc, but no stack trace.

In ExceptDlg.pas I see this:
       StackList := JclLastExceptStackList;
but JclLastExceptStackList returns nil. Don't know where to look further..

I have generated a map file, and Project|Insert JCL Debug data is 
enabled. Any ideas on how to include the stack trace?

Thanks!
Joost