0

I wanted to debug an execution of a procedure. Behind this procedure there are several triggers and transactions. There is one dataset which is updated within this procedure which behaves different than all the other datasets. So I wanted to debug detailed.

I already tried to debug with the normal procedure debugger, but that just debugs on surface, so it debugs only this procedure and does not jump into all tables / procedures / triggers which are included in this execution.

I also tried to use the trace and audit feature, but this is too confusing and it shows me too many information I don't need.

Basically I need to know if there is a possibility to debug detailed like in other IDEs e.g Eclipse.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ebug38
  • 171
  • 1
  • 14
  • 2
    There is no PSQL debug in Firebird server, at all. Even what you call "normal procedure debugger" is actually IBExpert's imitation. There was no procedure executed, instead IBExpert was issuing one command after another pretending it runs the procedure (it did not) – Arioch 'The Apr 11 '19 at 14:01
  • @Arioch'The I thought it was actually inside the stored procedure stepping through. Thank you for this bit of information. – Ed Mendez Apr 11 '19 at 21:05
  • @EdMendez I remember I saw discussions in some corner cases that simulation was somewhat different from "native" Firebird execution, which to be expected. Simulation is never 100% perfect and additionally can have bugs of its own/ – Arioch 'The Apr 12 '19 at 08:35
  • @Arioch'The So is it just possible to simulate through that one specific procedure without jumping in other procedures / triggers etc. while execution? Wow, that's annoying. Thanks for the answers! – ebug38 Apr 12 '19 at 10:30

2 Answers2

3

This is probably not the answer you are looking for but is has worked for me in the past.

What I've done in place of debugging to capture run time statistics and flow is the following.

In Firebird 2.5 you have autonomous transactions. I have a stored procedure that takes in a context description, and message. Inside the SP I insert the context and message and a timestamp into a Firebird table deemed for logging. I wrap that insert statement inside a "IN AUTONOMOUS TRANSACTION". This transaction will commit that transaction immediately and will allow me to see the rows in that table as the procedure is executing.

You can capture elapsed times or other statistics. The downside to doing it this way is that you will need to update the stored procedures and triggers that you want information from, so in a production system this might not be allowed.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Ed Mendez
  • 1,510
  • 10
  • 14
2

Firebird has no debug feature for stored procedures (apart from what is provided by trace). As indicated in the comments by Arioch 'The, the debug feature of IBExpert simulates stored procedure execution, it doesn't actually step through it on the server.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197