Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for other languages #6

Open
egonelbre opened this issue Jul 16, 2022 · 6 comments
Open

add support for other languages #6

egonelbre opened this issue Jul 16, 2022 · 6 comments

Comments

@egonelbre
Copy link
Member

egonelbre commented Jul 16, 2022

Technically the core logic needs:

  1. list of symbols (
    // File represents an object file, a module or anything that contains functions.
    )
  2. a way to disassemble and get line number for each instruction (https://github.com/loov/lensm/blob/main/internal/disasm/code.go#L1)

Rest of the code should work fine.

@mcourteaux
Copy link

mcourteaux commented Dec 23, 2022

Yes please! C++ source isn't loading right now.

@egonelbre
Copy link
Member Author

@mcourteaux can you provide a minimal repro, it'll be easier to test.

@mcourteaux
Copy link

Sure:

#include <cstdio>

int main(int argc, char** argv) {
  std::printf("hello\n");
  return 0;
}

Compile it:

g++ main.cpp -o repro

Start lensm (not even sure if this is the default way, I don't use use go):

go run loov.dev/lensm@main repro

Result:
image

@egonelbre
Copy link
Member Author

You also need to include dwarf information in the binary -- i.e. g++ -gdwarf main.cpp -o repro. It might work on linux already, but I haven't tested.

For installing the tool go install loov.dev/lensm@main, it'll put it in $HOME/go/bin by default. But using go run is fine as well, except it might try to fetch the latest version every time.

@mcourteaux
Copy link

Just tried your suggestion, and it still isn't working. Is there some verbose mode that could give you more information? Thanks for telling me about go install. 😄

@egonelbre
Copy link
Member Author

@mcourteaux if it doesn't work, then my guess was just wrong :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants