Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

[HELP] How does one debug with gdb? #544

Closed
ghost opened this issue May 21, 2021 · 2 comments
Closed

[HELP] How does one debug with gdb? #544

ghost opened this issue May 21, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented May 21, 2021

When debugging with gdb, it's not clear how to call functions of gtk objects.

Take this for example

label.set_text(&time);

Adding the line println!("Time from label: {}", label.text().as_str()); below it works. However a breakpoint there with gdb fails to yield a string in the console

(gdb) print label.text().as_str()
Could not find function named 'gtk::auto::label::Label::text'
(gdb) print gtk::auto::label::LabelExt::text(label)
No symbol 'gtk::auto::label::LabelExt::text' in current context

Looking at label itself doesn't help either as I don't know how to call the functions I want from inner or pointer

(gdb) print label
$1 = gtk::auto::label::Label (glib::object::ObjectRef {inner: core::ptr::non_null::NonNull<gobject_sys::GObject> {pointer: 0x55555584f7f0}})

How do I use gdb with gtk-rs?

@sdroege
Copy link
Member

sdroege commented May 22, 2021

That's a general Rust question, nothing really to do with gtk-rs or gtk. Can you ask that on https://users.rust-lang.org and link your question from here?

@sdroege sdroege closed this as completed May 22, 2021
@ghost
Copy link
Author

ghost commented May 22, 2021

You're right. I looked into it and it's a rustc issue rust-lang/rust#1563 + rust-lang/rust#33014 . gdb has a corresponding bug.

Now I'm curious how debugging is done in rust...

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

No branches or pull requests

1 participant