Cthulhu.jl icon indicating copy to clipboard operation
Cthulhu.jl copied to clipboard

Line numbers for functions

Open c42f opened this issue 5 years ago • 8 comments

I just tried Cthulhu for exploring how the sum implementation works, and I must say it's pretty great, thank you :-)

One thing I noticed is that it seems hard to connect the current function to the source where it's defined, as there's no line numbers or file names. Would it be easy to put those in? (Related idea - provide an option to list the source of the current function, or otherwise open it in an editor like @edit? Though this might be straying from the use case you had in mind with Cthulhu?)

c42f avatar Jan 15 '19 02:01 c42f

I think that is a fine idea, as long as we don't clutter up the UI, so we would need to attach meaning to other keys. I wanted to add the option to get code_llvm as well.

The line info is probably defined in the MethodInfo, I don't have immediately time to look into this, but I would welcome a PR.

On Tue, Jan 15, 2019, 03:19 Chris Foster <[email protected] wrote:

I just tried Cthulhu for exploring how the sum implementation works, and I must say it's pretty great, thank you :-)

One thing I noticed is that it seems hard to connect the current function to the source where it's defined, as there's no line numbers or file names. Would it be easy to put those in? (Related idea - provide an option to list the source of the current function, or otherwise open it in an editor like @edit? Though this might be straying from the use case you had in mind with Cthulhu?)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vchuravy/Cthulhu.jl/issues/9, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI3akbgcB5RHk3fnyi51_p7zs2Fqjzqks5vDTq3gaJpZM4aAHDN .

vchuravy avatar Jan 15 '19 15:01 vchuravy

Do you want the linenumber in the options that Cthulhu presents you, or just in the general debuginfo printing?

vchuravy avatar Feb 05 '19 03:02 vchuravy

I think it would make sense to print it at the top of the method body rather than in the list of options.

c42f avatar Feb 05 '19 03:02 c42f

Do you need something more than:

Base.IRShow.debuginfo[:default] = Base.IRShow.debuginfo[:source]
@code_typed debuginfo=:source f()
```?


On Mon, Feb 4, 2019 at 10:35 PM Chris Foster <[email protected]>
wrote:

> I think it would make sense to print it at the top of the method body
> rather than in the list of options.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/vchuravy/Cthulhu.jl/issues/9#issuecomment-460501592>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAI3auZL4iCS5EzZWqi4pZDPfWWR__Mmks5vKPwPgaJpZM4aAHDN>
> .
>

vchuravy avatar Feb 05 '19 04:02 vchuravy

No indeed! I just didn't know about Base.IRShow.debuginfo. Perhaps the only thing to do here is to add some convenience options so that options to code_typed can be passed to @descend?

c42f avatar Feb 05 '19 04:02 c42f

They already are! There is just a bug in Base (recently merged a PR that fixed it) that hides the line-information.

On Mon, Feb 4, 2019, 23:44 Chris Foster <[email protected] wrote:

No indeed! I just didn't know about Base.IRShow.debuginfo. Perhaps the only thing to do here is to add some convenience options so that options to code_typed can be passed to @descend?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vchuravy/Cthulhu.jl/issues/9#issuecomment-460511323, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI3auKB6JzGgeHe20y4MGPAw9HVvDl1ks5vKQxIgaJpZM4aAHDN .

vchuravy avatar Feb 05 '19 04:02 vchuravy

Nice :+1:

c42f avatar Feb 05 '19 07:02 c42f

We should still print the linfo for the method we are currently in. I often miss that information

vchuravy avatar Feb 08 '19 02:02 vchuravy