Do not use /tmp directory in the test
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Aug 27 2018
Aug 22 2018
Aug 20 2018
Mark added the test. Please let us know if this is OK.
In D49685#1201351, @magardne wrote:@labath Eugene asked me to help add a unit test for this. I have the updated diff, but I can't seem to attach it to this code review -- it must be because I'm not the original author? I'll attach the diff to this comment and maybe you can try to update the review. Otherwise we can wait until Eugene gets back on Monday.
The diff makes the following changes:
- Add an executable: test/testcases/functionalities/postmortem/elf-core/mock_sysroot/home/labath/test/a.out
- This is a copy of linux-i386.out (which is why it's in mock_sysroot/home/labath...). Let me know if this is ok, or if I should try to create a new binary/core
- Implement the test you suggested: set platform and sysroot, open the core, check threads/stacks are valid
I verified that the test fails without the changes to Platform.cpp and passes after the changes.
sysroot_cr.diff84 KBDownload
Jul 30 2018
In D49685#1179837, @labath wrote:In D49685#1178730, @EugeneBi wrote:I looked at the tests - is it all in Python? Not sure I have time to learn a new language... Is there anything in C++?
We have unit tests in c++, but it's going to be quite hard to tickle this code path from there.
FWIW, I don't think you really need to *know* python to write a test like this. You should be able to fudge it by cargo-culting some code from existing tests and some basic python examples. I expect the test should be something like:
# copy core file an .exe into an appropriate directory tree self.runCmd("platform select remote-linux --sysroot '%s'" % sysroot) target = self.dbg.CreateTarget(None) process = target.LoadCode(core) self.assertEquals(1, target.GetNumModules()) self.assertEquals(exe, target.GetModuleAtIndex(0).GetFileSpec())
Jul 27 2018
In D49685#1178553, @labath wrote:In D49685#1178528, @EugeneBi wrote:Hmm... I never thought I can do that :)
Anyway, with the change as it is now, LLDB would try to load executable in the sysroot, fail that, then open it without the sysroot.Does that mean it is possible to exercise this code path (by placing the executable in the sysroot for lldb to find it)?
In D49685#1178543, @lemo wrote:I never *ran LLDB tests*, not sure where they are and what they are.
I hope you're planning to look into this before submitting the change :)
Hmm... I never thought I can do that :)
Anyway, with the change as it is now, LLDB would try to load executable in the sysroot, fail that, then open it without the sysroot.
In D49685#1178125, @labath wrote:In D49685#1177046, @EugeneBi wrote:It is specific to shared libraries. Opening the executable and core dump follows different code path.
Which path is that? Is the path different even when you don't specify an executable when opening the core file (target create --core /my/file.core). I believe that in this case we should end up here https://github.com/llvm-mirror/lldb/blob/7c07b8a9314eef118f95b57b49fa099be0808eac/source/Plugins/Process/elf-core/ProcessElfCore.cpp#L255, which should eventually call Platform::GetSharedModule. Is that not the case?
Jul 26 2018
In D49685#1176399, @labath wrote:In D49685#1175413, @EugeneBi wrote:In D49685#1174770, @labath wrote:Could you also add a test for this?
I never ran LLDB tests, not sure where they are and what they are.
Also, how would you test that? I know now my open core dump works, but I cannot share it.Good question. Is this functionality specific to shared libraries, or could it be used to locate the main exe too?
If yes, then it should be sufficient to take one of the existing core&exe files we have, copy the exe into a path matching what the core file expects, set the sysroot, and make sure the exe gets found when we open up the core file. You can look at the existing tests in test/testcases/functionalities/postmortem/elf-core for examples.
If not, then it might get trickier because we'll need new core files, and it's hard to generate small ones with shared libraries.
Jul 25 2018
In D49685#1174770, @labath wrote:Could you also add a test for this?
Jul 24 2018
Fix a bug with resolved_spec path.
Code review followup:
- Restricted change to Platform.cpp
- Restricted change only to remote platforms.
You would just move:
auto resolved_module_spec(module_spec); if (sysroot != nullptr) resolved_module_spec.GetFileSpec().PrependPathComponent(sysroot);into the code in Platform.cpp and do it all there.
Rebased to recent master.
Included the whole file in diff.
In D49685#1173640, @clayborg wrote:We should never be loading the wrong shared libraries. The module spec we fill out must contain the UUID of the file are looking for. If it doesn't we have no chance of every really loading the right stuff.
Jul 23 2018
Jan 30 2017
So, what's now? Can somebody commit it, please?
I do not see any option to do it myself.
Jan 27 2017
Used named constants for SHN_UNDEF and SHN_XINDEX sentinels.
Unfortunately ELF.h lacks definition of PN_XNUM, so left it as a comment.
Jan 26 2017
This compiles, builds, and run.
Jan 25 2017
Hmm... This fix does not work with the recent sources :(
I'll debug some more tomorrow.
Sorry, messed up.
Will upload correct change soon
Rebased to recent master
- Yes, this is based on release_39 branch. OK, I'll rebase it on current master.
- Sorry, I am not familiar with LLDB testing and unfortunately I do not have time to do it. I am testing it on the core dumps I have. If this is not acceptable, I'll keep using my private copy and wait until somebody with more resources to spend on LLDB picks it up.
- I thought about keeping vs. discarding values from the original header. I slightly inclined to keep them because:
Jan 24 2017
Oct 19 2016
Oct 18 2016
I took a look.
I'll take a look