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

Fix SBValue crash and add some features #24

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

tetenpapier
Copy link
Contributor

I fix the bug found in #23 and add some methods to create breakpoints, check child of SBValue and change the value of SBValue. I'll continue to add some functions in the future.

@waywardmonkeys
Copy link
Contributor

I will look at this a little bit more, but in the meantime, I did push a quick change that adds SBValue::children() which uses an iterator and works in the same style as the rest of the library, which should be useful for you.

@tetenpapier
Copy link
Contributor Author

Oh yes, thank you !

Comment on lines +22 to +25
/*
pub fn get_description(&self, description: SBStream) -> SBStream {
}
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the implementation here. Do we create a new SBFrame and return it as an option if sys::SBMemoryRegionInfoGetDescription returns true ? in the source code of lldb, it always returns true. Or Do we take an SBFrame in parameter and pass it in the sys function ?

@tetenpapier
Copy link
Contributor Author

I'm trying to implement Process.ReadMemory() (lldb doc and lldb-sys doc) but I think I'm doing something wrong. I only got empty Vec with this implementation :

    pub fn read_memory(&self, addr: u64, size: usize) -> Result<(usize, Vec<u8>), SBError> {
        let error = SBError::default();
        let mut vec: Vec<u8> = Vec::with_capacity(size);
        let ret = unsafe {
            sys::SBProcessReadMemory(
                self.raw,
                addr,
                vec.as_mut_ptr() as *mut c_void,
                size,
                error.raw,
            )
        };

        // I check if error is success, etc.

Do you have an idea about the implementation ?

@waywardmonkeys
Copy link
Contributor

I'm really sorry.

I left on an international trip in June for almost a month, got sick, and then got distracted and forgot about this.

I'll cherry pick more from here over the next couple of days.

@Casilio
Copy link

Casilio commented Feb 1, 2023

Hey @waywardmonkeys @tetenpapier
Can we get this merged?
I'm mainly interested in breakpoints creation code. Is there are some issues with memory region stuff, I can cherry-pick breakpoints part into a separate PR. Should I though?

p.s. i find it kinda funny that we can disable, enable and delete breakpoints, but there is no way to create them...

@tetenpapier
Copy link
Contributor Author

@Casilio I think it's better to cherrypick some commits because this PR has now conflicts and I don't have time now to resolve them :/ maybe in 2/3 weeks, if I remember.
@waywardmonkeys sorry for my silence, I've a lot of work and (as you) forgot it.

@waywardmonkeys
Copy link
Contributor

If I don't push anything in the next 24 hours, please ping me here again. I've got a couple of things going on, but I think I can make some progress here today.

@roccoblues
Copy link
Contributor

Hi, I'm also experiencing a SBValue crash. Is there a reason the fix isn't merged? Would it help if I create a new PR with just the check_null_ptr() fix in value.rs?

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

Successfully merging this pull request may close these issues.

4 participants