Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Question] GDB tracking for rustpython #4880

Unanswered
itsankitkp asked this question in Q&A
Apr 16, 2023 · 2 comments · 2 replies
Discussion options

This not be RustPython issue per se, but I am having trouble in getting through control flow of rustpython via gdb.
In cpython (or millions other c program), I can attach debugger and flow through lexer and then to interpreter (and then finally c functions).
For example, adding breaking point to /Include/cpython/methodobject.h:46 and stepping into func->m_self I can go into corresponding c functions.
In rustpython, stepping into jumps to rustlibs back and forth and somehow execution completes without me going to actual functions.
Note that if I attach break point to some function in *.rs, it reaches there without any issue, but this is when I know where to reach. This doesn't help if I want to find out flow and where control is going and to which function in *.rs.

Any ideas on this will be apprecitated.

Note: I also tried using rust-gdb ( gdb_load_rust_pretty_printers.py didn't really help much with prettiness, for some reason) but to no avail.

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

How about lldb? I didn't try gdb. When trying lldb, I could do stepping sometimes well and sometimes awfully. I depends on breakpoints a lot.

You must be logged in to vote
1 reply
@itsankitkp
Comment options

I will give this a shot and see if it works for me

Comment options

it is pretty tricky sometimes due to it stepping into some calls that are, as you say, in the rust standard library. I don't know of any way to maybe ignore these but wouldn't be surprised if some path-based filtering existed.

After a while it should get better due to realizing which calls will most likely take you on random trips.

I'll be moving this into discussions since it'll have more visibility there here :-)

You must be logged in to vote
1 reply
@itsankitkp
Comment options

I'll be moving this into discussions since it'll have more visibility there here :-)

Thanks for moving this here, this is better place for such questions.

After a while it should get better due to realizing which calls will most likely take you on random trips.

Glad that I am not only one, guess it is probably be an issue on gdb side. I will check other tools so they work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #4879 on April 16, 2023 17:17.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.