Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>
Details
- Reviewers
clayborg dvlahovski granata.enrico labath - Commits
- rGcda0ae46ac9b: Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
rLLDB280942: Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
rL280942: Fix for rL280668, Intel(R) Memory Protection Extensions (Intel(R) MPX) support.
Diff Detail
- Repository
- rL LLVM
Event Timeline
I have a couple of questions I'd like to be answered before this goes in. Apart from the inline comments, all my questions from the previous version of this commit still stand.
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
5 ↗ | (On Diff #70398) | This should not be necessary. Makefile.rules already correctly appends -m32 when needed. Maybe CFLAGS_EXTRAS would work instead (?) |
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py | ||
297 ↗ | (On Diff #70398) | Do we want to allow a register set with no name? It looks like the root of the problem is elsewhere. |
Hi, inline there are my other replies.
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
5 ↗ | (On Diff #70398) | Unfortunately it doesn't append -m32 to all the instances when also a linker is needed in the build process. In fact, in the test logs it shows that only the first call of the g++ command has such a flag, and therefore the inferior code build ends with an error. |
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py | ||
297 ↗ | (On Diff #70398) | These lines of code are just to detect if there are AVX or MPX register sets, so I don't think there is the need to do anything about nameless sets here. If you don't like this solution, I think an alternative is to just check if there are the register names that belong to one set or the other, it just takes a bit longer - or I could just look for the first register in the set. |
Just switch to using CFLAGS_EXTRAS and LD_EXTRAS and this is good to go.
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
6–11 ↗ | (On Diff #70398) | It would be nice to not modify the CXXFLAGS or LDFLAGS directly. You should modify CFLAGS_EXTRAS and LD_EXTRAS. I am not sure if there is a CXXFLAGS_EXTRAS, but feel free to add it if you can't use CFLAGS_EXTRAS |
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
5 ↗ | (On Diff #70398) | I don't see how that is possible. I just made the following test: $ cat Makefile LEVEL = ../../../make CXX_SOURCES := main.cpp CFLAGS_EXTRAS += -Wzero-as-null-pointer-constant include $(LEVEL)/Makefile.rules $ make g++ -std=c++11 -g -O0 -fno-builtin -m64 -Wzero-as-null-pointer-constant -I/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/../../../../../include -include /usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/test_common.h -c -o main.o main.cpp g++ main.o -g -O0 -fno-builtin -m64 -Wzero-as-null-pointer-constant -I/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/../../../../../include -include /usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/test_common.h -o "a.out" $ make ARCH=i386 g++ -std=c++11 -g -O0 -fno-builtin -m32 -Wzero-as-null-pointer-constant -I/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/../../../../../include -include /usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/test_common.h -c -o main.o main.cpp g++ main.o -g -O0 -fno-builtin -m32 -Wzero-as-null-pointer-constant -I/usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/../../../../../include -include /usr/local/google/home/labath/ll/lldb/packages/Python/lldbsuite/test/make/test_common.h -o "a.out" As you see CFLAGS_EXTRAS was added to both compiler and linker command lines for both 32-bit and 64-bit cases (so, setting LD_EXTRAS is not necessary). Also, Makefile.rules already correctly appended the correct -m32/64 switch to all compiler and linker executions (so, you should not need to set it yourself). If this does not work for you, then we need to figure out why and fix it. I don't believe we should be adding complex rules to these Makefiles, as it increases the maintenance burden down the line. |
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py | ||
297 ↗ | (On Diff #70398) | I was referring to the addition of the if registerSet.GetName() pre-check. I know in the previous version of the commit this test failed here due to register set name being None. So this also implicitly checked that each register set has a name. Now, you've circumvented that check. This seems to be unnecessary because the test passes even when I remove that, so I think we should do that. I think it's a reasonable expectation that each register set has a name. |
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
6 ↗ | (On Diff #70507) | You are right, if I use CFLAGS_EXTRAS I don't have to check for the arch or use LD_EXTRAS. I wish I knew this from the beginning... |
I think we're approaching the end now. If you could upload the new version (you'll have to reformat the changes), I'll give it a final pass.
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
6 ↗ | (On Diff #70507) | Yeah, I don't blame you. :) The test suite is not an easy thing to wrap your head around. I am sorry if some of my comments sounded a bit harsh. |
Improved MPX test Makefile and removed workaround for unnamed register sets, and rebased according to the new coding style.
packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/Makefile | ||
---|---|---|
7 ↗ | (On Diff #70695) | Np, thanks for the review and explanations ;) |