Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4776)

Issue 7732: hook phase debugging must traverse to find line number

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 5 months ago by Jacob
Modified:
9 years, 4 months ago
Reviewers:
djabberd
CC:
djabberd_lists.danga.com
Base URL:
http://code.sixapart.com/svn/djabberd/trunk/DJabberd
Visibility:
Public.

Description

Extra logging was added in: http://code.sixapart.com/trac/djabberd/changeset/799 This new logging makes calls to B::svref_2object, which is apparently some part of the perl compile that allows you to traverse the call stack and figure out who called you. Example debug output: For phase [PresenceCheck] invoking hook 1 of 2 defined at: lib/DJabberd/PresenceChecker.pm:26 There seems to be a problem however in some cases. I'm not exactly sure why. But in some case: $cv->ROOT->first->line returns the correct line number while: $cv->ROOT->first->first->line causes an error: (Can't locate object method "first" via package "B::COP") Example callback of this case: For phase [AlterPresenceAvailable] invoking hook 3 of 3 defined at: lib/DJabberd/VHost.pm:201 So, it seems that instead of blindly calling '$cv->ROOT->first->first->line', the code needs to traverse these B::LISTOP objects to the proper depth to find a B::COP object from which we can get the line number.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -1 line) Patch
lib/DJabberd/VHost.pm View 1 chunk +5 lines, -1 line 0 comments Download

Messages

Total messages: 1
Jacob
15 years, 5 months ago (2008-11-03 17:59:57 UTC) #1

          
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b