Index: packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile =================================================================== --- packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile +++ packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile @@ -3,6 +3,5 @@ DYLIB_NAME := foo DYLIB_CXX_SOURCES := foo.cpp CXX_SOURCES := main.cpp -CFLAGS_EXTRAS := -fPIC include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile =================================================================== --- packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile +++ packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile @@ -3,6 +3,5 @@ DYLIB_NAME := foo DYLIB_CXX_SOURCES := foo.cpp CXX_SOURCES := main.cpp -CFLAGS_EXTRAS += -fPIC include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/load_unload/a.mk =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/a.mk +++ packages/Python/lldbsuite/test/functionalities/load_unload/a.mk @@ -2,15 +2,12 @@ LIB_PREFIX := loadunload_ -CFLAGS_EXTRAS := -fPIC LD_EXTRAS := -L. -l$(LIB_PREFIX)b DYLIB_NAME := $(LIB_PREFIX)a DYLIB_CXX_SOURCES := a.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules $(DYLIB_FILENAME): lib_b Index: packages/Python/lldbsuite/test/functionalities/load_unload/b.mk =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/b.mk +++ packages/Python/lldbsuite/test/functionalities/load_unload/b.mk @@ -6,6 +6,4 @@ DYLIB_CXX_SOURCES := b.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/load_unload/c.mk =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/c.mk +++ packages/Python/lldbsuite/test/functionalities/load_unload/c.mk @@ -6,6 +6,4 @@ DYLIB_CXX_SOURCES := c.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/load_unload/d.mk =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/d.mk +++ packages/Python/lldbsuite/test/functionalities/load_unload/d.mk @@ -8,6 +8,4 @@ DYLIB_CXX_SOURCES := d.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile =================================================================== --- packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile +++ packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile @@ -6,6 +6,4 @@ DYLIB_CXX_SOURCES := d.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile =================================================================== --- packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile +++ packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile @@ -3,6 +3,4 @@ DYLIB_NAME := unlikely_name DYLIB_CXX_SOURCES := foo.cpp CXX_SOURCES := main.cpp -CFLAGS_EXTRAS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py =================================================================== --- packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py +++ packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py @@ -46,7 +46,7 @@ newdir = self.getBuildArtifact("newdir") try: os.mkdir(newdir) - except OSError, e: + except OSError as e: if e.errno != os.errno.EEXIST: raise testdir = self.getBuildDir() Index: packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk =================================================================== --- packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk +++ packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk @@ -6,7 +6,5 @@ include $(LEVEL)/Makefile.rules -CFLAGS_EXTRAS += -fPIC - OneConstant.o: OneConstant.c $(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@ Index: packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk =================================================================== --- packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk +++ packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk @@ -6,7 +6,5 @@ include $(LEVEL)/Makefile.rules -CFLAGS_EXTRAS += -fPIC - TwoConstant.o: TwoConstant.c $(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@ Index: packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile +++ packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile @@ -3,6 +3,5 @@ DYLIB_NAME := foo DYLIB_C_SOURCES := foo.c C_SOURCES := main.c -CFLAGS_EXTRAS += -fPIC include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile +++ packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile @@ -3,7 +3,6 @@ DYLIB_NAME := foo DYLIB_C_SOURCES := foo.c C_SOURCES := main.c -CFLAGS_EXTRAS += -fPIC SPLIT_DEBUG_SYMBOLS = YES Index: packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile =================================================================== --- packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile +++ packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile @@ -1,7 +1,6 @@ LEVEL = ../../../make C_SOURCES := main.c -CFLAGS_EXTRAS += -fPIC DYLIB_NAME := a DYLIB_C_SOURCES := a.c Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk =================================================================== --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk +++ packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk @@ -4,6 +4,4 @@ DYLIB_CXX_SOURCES := a.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk =================================================================== --- packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk +++ packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk @@ -4,6 +4,4 @@ DYLIB_CXX_SOURCES := b.cpp DYLIB_ONLY := YES -CXXFLAGS += -fPIC - include $(LEVEL)/Makefile.rules Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -1478,10 +1478,10 @@ d = { 'DYLIB_CXX_SOURCES': sources, 'DYLIB_NAME': lib_name, - 'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag, - os.path.join( - os.environ["LLDB_SRC"], - "include")), + 'CFLAGS_EXTRAS': "%s -I%s " % (stdflag, + os.path.join( + os.environ["LLDB_SRC"], + "include")), 'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]} if self.TraceOn(): print( Index: packages/Python/lldbsuite/test/make/Makefile.rules =================================================================== --- packages/Python/lldbsuite/test/make/Makefile.rules +++ packages/Python/lldbsuite/test/make/Makefile.rules @@ -544,6 +544,11 @@ #---------------------------------------------------------------------- $(DYLIB_OBJECTS) : CFLAGS += -DCOMPILING_LLDB_TEST_DLL +ifneq "$(OS)" "Windows_NT" +$(DYLIB_OBJECTS) : CFLAGS += -fPIC +$(DYLIB_OBJECTS) : CXXFLAGS += -fPIC +endif + $(DYLIB_FILENAME) : $(DYLIB_OBJECTS) ifeq "$(OS)" "Darwin" $(LD) $(DYLIB_OBJECTS) $(LDFLAGS) -install_name "$(DYLIB_EXECUTABLE_PATH)/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)" Index: packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py =================================================================== --- packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py +++ packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py @@ -17,19 +17,19 @@ def test_read_memory_c_string(self): """Test corner case behavior of SBProcess::ReadCStringFromMemory""" self.build() - self.dbg.SetAsync(False) + self.dbg.SetAsync(False) self.main_source = "main.c" self.main_source_path = os.path.join(self.getSourceDir(), self.main_source) - self.main_source_spec = lldb.SBFileSpec(self.main_source_path) - self.exe = self.getBuildArtifact("read-mem-cstring") + self.main_source_spec = lldb.SBFileSpec(self.main_source_path) + self.exe = self.getBuildArtifact("read-mem-cstring") (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, 'breakpoint here', self.main_source_spec, None, self.exe) - frame = thread.GetFrameAtIndex(0) - + frame = thread.GetFrameAtIndex(0) + err = lldb.SBError() empty_str_addr = frame.FindVariable("empty_string").GetValueAsUnsigned(err)