From 00e6fbfee9e400dd02397b92636f2d82f8761c0c Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Fri, 22 Jul 2011 16:46:35 +0000 Subject: Make the SBAddress class easier to use when using the public API. SBTarget changes include changing: bool SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr, lldb::SBAddress& addr); to be: lldb::SBAddress SBTarget::ResolveLoadAddress (lldb::addr_t vm_addr); SBAddress can how contruct itself using a load address and a target which can be used to resolve the address: SBAddress (lldb::addr_t load_addr, lldb::SBTarget &target); This will actually just call the new SetLoadAddress accessor: void SetLoadAddress (lldb::addr_t load_addr, lldb::SBTarget &target); This function will always succeed in making a SBAddress object that can be used in API calls (even if "target" isn't valid). If "target" is valid and there are sections currently loaded, then it will resolve the address to a section offset address if it can. Else an address with a NULL section and an offset that is the "load_addr" that was passed in. We do this because a load address might be from the heap or stack. llvm-svn: 135770 --- lldb/test/python_api/default-constructor/sb_target.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lldb/test/python_api/default-constructor') diff --git a/lldb/test/python_api/default-constructor/sb_target.py b/lldb/test/python_api/default-constructor/sb_target.py index df55149bbad..f4b4dd45bc0 100644 --- a/lldb/test/python_api/default-constructor/sb_target.py +++ b/lldb/test/python_api/default-constructor/sb_target.py @@ -23,8 +23,7 @@ def fuzz_obj(obj): contextlist = lldb.SBSymbolContextList() obj.FindFunctions("the_func", 0xff, True, contextlist) obj.FindGlobalVariables("my_global_var", 1) - address = lldb.SBAddress() - obj.ResolveLoadAddress(0xffff, address) + address = obj.ResolveLoadAddress(0xffff) obj.ResolveSymbolContextForAddress(address, 0) obj.BreakpointCreateByLocation("filename", 20) obj.BreakpointCreateByLocation(filespec, 20) -- cgit v1.2.3