Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent debugger to step into specific code.

Status
Not open for further replies.

Nordlund

Programmer
Jul 17, 2001
458
SE
Hi there.

Is there a way to prevent the debugger to step into specific code.
Use WndProc or some kind of OnDrawItem procedure as an example.

Code:
procedure Test;
begin
  Memo1.Lines.Add('Debug this');
  Memo1.Lines.Add('Debug this');
  Memo1.Lines.Add('Debug this');
{DONOTDEBUG}
  Memo1.Lines.Add('DO NOT! Debug this'); // This row should not be debugged
{DODEBUG}
  Memo1.Lines.Add('Debug this');
  Memo1.Lines.Add('Debug this');
end;

KungTure-RX.jpg

//Nordlund
 
I'm not sure if this meets your needs but it is a very useful technique for adding debug info into your program. To activate this functionality you need to place the following line just inside the "implementation" section of your unit (if you have an implementation "uses" list then place it after that too). To turn off this functionality, simply remove this line.
Code:
{$DEFINE DEBUG}
Then anywhere in your code you can add the following:
Code:
{$IF Defined(DEBUG)}
  ShowMessage('Debug On');
{$ELSE}
  ShowMessage('Debug Off');
{$IFEND}
Apologies if this is not what you were looking for.

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Hi there.
I want the code to be executed, not removed with compiler directives. I don't want the debugger to step into the specific code when using "step into". Just like when you use procedures from .dcu files.

One trick is to use the above trick. Precompile some portions of code, and remove the .pas files.

Sometimes when debugging, windows messages are sent, and the debugger jumps into WndProc's procedures, and this is anoying, especially when debugging OnDrawCell events.

KungTure-RX.jpg

//Nordlund
 
I think what you're asking for is like the VB "set next instruction pointer" (or essentially that)....

I've wished for this myself as the same thing happened to me.... "don't do 'this' while I'm debugging...."

I tried every option available to see if there was a way to "skip" or "set" but to no avail.

I'd like to see it added, but then again, based on the price of the current Delphi, I'll be on D6 when I die. The price they charge for the product.... I've been "*held-up*" enough for my lifetime.



Regards and HTH,
JGS
 
sgjs,

about the "price thing" : my company bought D6 pro a the time for about €1300. I know this is a lot. now, 4 years later we bought the D2005 pro upgrade for about €350. what I mean is, it a lot of money, but the investment is not wasted, since you can upgrade for a reasonable price...

--------------------------------------
What You See Is What You Get
 
YAH_BUT!

O.K. I agree THAT price is not "overwhelming". But I bought the Kylix version for $xxxx and then they reduced the price to $xxx and when I bitched they said o.k. we'll give you this and that, but essentially I lost $500/

Nonetheless, where did it start that you can't acess files with Assignfile, Reset, etc...., Closefile...???

I read several threads on that issue and believe me...

THAT ALONE

scares the bejesus out of me....

who the 7734 are they to tell me I can't access a file because of WHO???!!! and WHOSE???!!! restrictions and WHOSE???!!! rules?

I also, don't need .net, ado, databases, tables, excel, etc., I code my own stuff, bottom up.....

so why do I want to pay for them to develop THAT????? (and sell it to me in "SUNSET".... somehow....????)

This thing has become just like Intuit/quickbooks/quicken where THEY develop the product based on what THEY think and

"I"

can't get the product "I" want "UNLESS" "I" agree with "THEM"

To me, their development cycle is pure ** ( that's 'S' and 'B' in reverse order)

I LOVE Delphi, and I HATE the path Inprise/Borland/etc have taken... you have no choice unless you agree with their "methodology"

The whole thing **isses me off... LOTS....

That's the basis for the "attitude" (if it helps...)

JGS

 
don't understand the bit where you say "you can't acess files with Assignfile, Reset, etc...., Closefile...???"

what do you mean??

I do agree that the .NET path is something a LOT of delpi developers don't agree with, but that is just a survival thing, they're almost married with M$ so they don't have much of a choice, fortunately they left the win32 path open for us, the non .NET believers.

Cheers,
Daddy

--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top