Debugging support

10 views
Skip to first unread message

Terasgr

unread,
Jul 7, 2018, 8:08:00 AM7/7/18
to Avian
Hello people

During the last months I am constantly thinking about the lack of debugging support of avian.
I know it is a huge effort to implement it, so I was searching around to see what could be done.

Today I think I found a viable solution.
MobiVM/RoboVM has implemented a solution like this and I think it is something that could be reused.
After digging around I found that they had this idea:

First, they have created a java-based JDWP client/server. All the logic of the protocol is there. Just need to launch it as a regular application, and this will connect (a) to the native code and (b) listen to JDWP connections. Its job is to receive the JDWP commands, process them and forward to the native code.

And secondly, a thin native library which listens to the java client/server and copies to it "low level" memory dumps. The native methods are very basic and include hooks when a new thread starts/stop, to allocate/free memory and things like that.

To my eyes, this code is portable. The only non-portable part is how a "java" data structure is stored natively. I am talking about the native-coupled things like "String", "Class", "Field", "Method", "Proxy/BridgedMethod", "Thread"  and so on.

I don't know how difficult porting would be, but I am really willing to do this. The problem is that I am not at all proficient with avian implementation (but willing to learn) and I am sure that I can't do it alone.


What are your thoughts on it?

Joel Dice

unread,
Jul 9, 2018, 10:05:05 AM7/9/18
to Avian
Hi,

That sounds reasonable. I can help you by answering quick, specific
questions about e.g. where threads start and stop, where memory is
allocated, etc.. However, I'm afraid I don't have time to do more
than that, so you'll generally be on your own.

If you're reasonably comfortable with C++ and don't mind reading the
code to figure out how things fit together, you should be able to
manage. It's just a question of how much time and effort you want to
commit to it.
> --
> You received this message because you are subscribed to the Google Groups
> "Avian" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to avian+un...@googlegroups.com.
> To post to this group, send email to av...@googlegroups.com.
> Visit this group at https://groups.google.com/group/avian.
> For more options, visit https://groups.google.com/d/optout.

Terasgr

unread,
Jul 11, 2018, 3:18:37 AM7/11/18
to Avian


Τη Δευτέρα, 9 Ιουλίου 2018 - 5:05:05 μ.μ. UTC+3, ο χρήστης Joel Dice έγραψε:
Hi,

That sounds reasonable.  I can help you by answering quick, specific
questions about e.g. where threads start and stop, where memory is
allocated, etc..  However, I'm afraid I don't have time to do more
than that, so you'll generally be on your own.

If you're reasonably comfortable with C++ and don't mind reading the
code to figure out how things fit together, you should be able to
manage.  It's just a question of how much time and effort you want to
commit to it.


OK

I'll give it a try and see where I'd go.
Is it possible to give me some directions about how to fish the low-level information like how java variables are mapped into memory and hooks about thread creation?
Thank you.
Reply all
Reply to author
Forward
0 new messages