getting more information about numbered functions in traces?

8 views
Skip to first unread message

Marc Weber

unread,
Dec 13, 2008, 12:49:02 PM12/13/08
to vim...@googlegroups.com
Is it possible to get more information about numbered functions than
just function('34') ?

I mean a trace like this:
theonevimlibsetup#Setup..tovl#plugin_management#UpdatePlugins..library#Call..13..12..43

doesn't say that much.

It would help very much to get at least a list of function arguments?

Unfortunately you can't just get that function by
eval("function('43')").. In this case you could use the debugger to jump
in and see which one it is..

The information must be there. I just don't know how to access it ?

Marc Weber

Tom Link

unread,
Dec 14, 2008, 7:34:26 AM12/14/08
to vim_use
> It would help very much to get at least a list of function arguments?

The methods are usually stored as function references like {"name":
function("12") ...}

I include the following method in objects:

function! s:prototype.Methods(...) dict "{{{3
TVarArg ['pattern', '\d\+']
let o = items(self)
call filter(o, 'type(v:val[1]) == 2 && string(v:val[1]) =~
"^function(''\\d\\+'')"')
let acc = {}
for e in o
let id = matchstr(string(e[1]), pattern)
if !empty(id)
let acc[id] = e[0]
endif
endfor
return acc
endf

This will return a dictionary with the numbers as keys and the method
names as values.

You could turn this into an function externally iterating over the
dictionary of course.

let o = {'Foo': function('12')}
Methods(o)[12]
=> Foo

Or that's the idea.

I'd also appreciate it if the trace included information about the
function name though.

Marc Weber

unread,
Dec 22, 2008, 11:52:04 AM12/22/08
to vim...@googlegroups.com
Hi Tom,

> You could turn this into an function externally iterating over the
> dictionary of course.
>
> let o = {'Foo': function('12')}
> Methods(o)[12]
> => Foo
>
> Or that's the idea.
>
> I'd also appreciate it if the trace included information about the
> function name though.

That's exactly what I've done. See tovl.

:IdentifyNumberedFunctions foo..23..34 does show you that trace.

But you have to pass a list of objects to the function called by that
command.

Sincerly
Marc Weber

Reply all
Reply to author
Forward
0 new messages