View Issue Details

IDProjectCategoryView StatusLast Update
0000569LDMud 3.3Efunspublic2008-12-29 17:17
Reporterwarp Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
Product Version3.3.717 
Summary0000569: Extend caller_stack() to optionally include filename, function name and line number information
Descriptioncaller_stack( int arg) could be extended so arg is a bit-field with status flags, to allow better debugging tools in the mudlib.

Bit 0: include interactive (as it's now)
Bit 1: include full stack

If Bit 1 is set, caller_stack() could return an array of arrays, not only with the previous objects, but with full code locations (object, function-name, filename, linenumber).

Also, it would be important that this also works properly in the various error-handling-functions of the master object (runtime_error and heart_beat_error) to allow a custom, full stack trace for the error. A nicety would be, if it would also work for compilation errors in log_error (in which case it would show the trace up to the point where to compilation of buggy object was triggered).

I don't know, whether the driver has easy access to that information, but especially cool would be, if another bit could extend the full stack with information about all the arguments which have been passed to the functions in the stack, so that error logging tools/debugging tools could dump them, but this change would already be very helpful without the arguments, too.

TagsNo tags attached.

Relationships

related to 0000586 new LDMud Allow querying single stack frames using debug_info(DINFO_TRACE) 

Activities

zesstra

2008-09-10 09:12

administrator   ~0000770

Concerning your wish to have stack traces during the error-handler in the master: isn't that what debug_info(DINFO_TRACE,...) is just doing?

warp

2008-09-10 10:47

reporter   ~0000772

Oh, indeed. I completely missed that this feature was added in 3.2.9. I guess this issue can be closed, then.

zesstra

2008-09-10 12:52

administrator   ~0000778

The other part of the request... Mhmm, caller_stack() with that information would still be a quite bad stacktrace, because it only contains inter-object calls and you would miss a lot of the real stack. If a efun for getting a complete stacktrace is needed, it would probably be a new one or debug_info(). Collecting the stack is quite expensive though - ok for error handling, but I am not sure if one should do this routinely.

BTW: If you need a stack trace for some odd reason without aborting the execution, you could perform some
catch(raise_error("Dummy error\n");nolog);
mixed stacktrace=debug_info(DINFO_TRACE,DIT_ERROR);
and evaluate the stacktrace afterwards.

Gnomi

2008-09-11 00:31

manager   ~0000781

debug_info(DINFO_TRACE, DIT_CURRENT) should work without the need for a raise_error. But with the returned information you can't distinguish between call_others and normal lfun calls, maybe we should add some flag to indicate this.

zesstra

2008-09-11 02:09

administrator   ~0000782

Seems to me I should also read the fine documentation. ;-)
Maybe a nice idea to add this, yes. I don't have a real application for this right now, but it would give the possibility to reconstruct the caller_stack from the complete trace...
(Should we keep this feature here or in a separate bug filed for debug_info()?)

zesstra

2008-12-29 17:17

administrator   ~0000843

Since most of this feature wish is already existing and the missing flag in the stack traces of debug_info() can be dealt with in 0000586 I close this one.

Issue History

Date Modified Username Field Change
2008-09-10 08:49 warp New Issue
2008-09-10 09:12 zesstra Note Added: 0000770
2008-09-10 10:47 warp Note Added: 0000772
2008-09-10 12:52 zesstra Note Added: 0000778
2008-09-11 00:31 Gnomi Note Added: 0000781
2008-09-11 02:09 zesstra Note Added: 0000782
2008-12-29 17:12 zesstra Relationship added related to 0000586
2008-12-29 17:17 zesstra Status new => closed
2008-12-29 17:17 zesstra Note Added: 0000843
2008-12-29 17:17 zesstra Resolution open => no change required