NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Debugging code when it is included by $ret = include($t)


Joined: 26 May 2004
Posts: 5
Reply with quote
Hello,

Using PHPmyedit, a mysql table-editor, I came to the folowing issue:

In this pacakge one can define triggers for a database, which are included by the following line:
$ret = include($t);
Here is $t the php-filename of the trigger-routine.

I set a breakpoint on a line in this thrigger-file $t, but the debugger does not stop there.
When I want to debug this trigger-routine, I have to set the breakpoint on this $ret = include($t) statement, and then jump into the routine.

Using more than one trigger, which are all started with the same include-line debugging is hard here.
Can this be done in another way ??

thanks and regards
Marcel
View user's profileFind all posts by marcelSend private message
Guru master

Joined: 05 Jul 2004
Posts: 659
Location: Belgium
Reply with quote
I think that, because the $t is a variable, it is impossible for the debugger to evaluate that breakpoint. It cannot determine in advance that the file you set the breakpoint in will be included thus the breakpoint is not set.
I think your best option is to add a DebugBreak(); line in the included file, that will force a break when it is encountered and has never failed me Smile
Hope that helps!
View user's profileFind all posts by BlizzSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
Quote:
I set a breakpoint on a line in this thrigger-file $t, but the debugger does not stop there.

I'm not sure that I got you right. Suppose for a particular case $t has 'tableA.inc' value and you have 'tableA.inc' file in your system. You can set a breakpoint in this file and it will trigger the debugger. If it does not what happen in your case, you may want to check:
a) that the file where you set breakpoint is the file that gets actually included when you check it by stepping in the debugger
b) that the line where you set the breakpoint gets blue dot when you step with debugger in the file
c) that you have no php opcode caches like eaccelerator and its successors. They cache files when you run them for the first time and if you do so without debugger, they will be cached without debugging opcodes so they can be debugged.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Debugging code when it is included by $ret = include($t)
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic