if (target_sp)
{
Mutex::Locker api_locker (target_sp->GetAPIMutex());
- lldb_private::Address addr_priv(addr.GetFileAddress(), NULL);
- lldb_private::Error err_priv;
- bytes_read = target_sp->ReadMemory(addr_priv, false, buf, size, err_priv);
- if(err_priv.Fail())
- {
- sb_error.SetError(err_priv.GetError(), err_priv.GetType());
- }
+ bytes_read = target_sp->ReadMemory(addr.ref(), false, buf, size, sb_error.ref());
+ }
+ else
+ {
+ sb_error.SetErrorString("invalid target");
}
return bytes_read;
breakpoint = target.BreakpointCreateByLocation("main.c", self.line_main)
self.assertTrue(breakpoint, VALID_BREAKPOINT)
+ # Put debugger into synchronous mode so when we target.LaunchSimple returns
+ # it will guaranteed to be at the breakpoint
+ self.dbg.SetAsync(False)
+
# Launch the process, and do not stop at the entry point.
process = target.LaunchSimple (None, None, self.get_process_working_directory())
# find the file address in the .data section of the main
# module
data_section = self.find_data_section(target)
- data_section_addr = data_section.file_addr
- a = target.ResolveFileAddress(data_section_addr)
-
- content = target.ReadMemory(a, 1, lldb.SBError())
+ sb_addr = lldb.SBAddress(data_section, 0)
+ error = lldb.SBError()
+ content = target.ReadMemory(sb_addr, 1, error)
+ self.assertTrue(error.Success(), "Make sure memory read succeeded")
self.assertEquals(len(content), 1)
def create_simple_target(self, fn):