Re: [lldb-dev] Problems with core load on Linux and proposed solution

2016-02-26 Thread Zachary Turner via lldb-dev
Cced some people who work on Linux.

Not sure how this slipped through the cracks, but sometimes you can have
better results by just posting a patch to lldb-commits and ccing the right
person (check owners file to find out who the right person is)

On Thu, Feb 25, 2016 at 5:18 PM Eugene Birukov via lldb-dev <
lldb-dev@lists.llvm.org> wrote:

> No response. I filed a bug, hopefully somebody will pay attention.
>
> https://llvm.org/bugs/show_bug.cgi?id=26322
>
>
> --
> From: mi...@microsoft.com
> To: eugen...@hotmail.com; lldb-dev@lists.llvm.org
> Subject: RE: Problems with core load on Linux and proposed solution
> Date: Thu, 25 Feb 2016 22:37:45 +
>
>
> Eugene, do you know if they have taken these changes? Have you heard from
> anybody on lldb-dev?
>
>
>
> mikem
>
>
>
> *From:* Eugene Birukov [mailto:eugen...@hotmail.com]
> *Sent:* Thursday, January 21, 2016 10:46 AM
> *To:* LLDB 
> *Subject:* Problems with core load on Linux and proposed solution
>
>
>
> Hi,
>
>
>
> LLDB 3.8 has much better support for core load on Linux than 3.7 - thanks
> a lot! But there are still two problems.
>
>
>
> 1. The thread ID are lost and there is FIXME in the code
>
> 2. If core dump is obtained from live process (i.e. gdb attach, gcore,
> detach) then there is no thread that has any reason to stop. LLDB hangs
> forever on such a core.
>
>
>
> Here is the fix that works for me for both problems.
>
>
>
> Thanks,
>
> Eugene
>
>
>
> diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
>
> index 6bb7a3d..915ca15 100644
>
> --- a/include/lldb/Target/Process.h
>
> +++ b/include/lldb/Target/Process.h
>
> @@ -3401,6 +3401,7 @@ protected:
>
>  std::map m_resolved_indirect_addresses;
>
>  bool m_destroy_in_process;
>
>  bool m_can_interpret_function_calls; // Some targets, e.g the OSX
> kernel, don't support the ability to modify the stack.
>
> +bool m_load_core; // True if we are looking at a core dump, not at a
> running program
>
>  WarningsCollection  m_warnings_issued;  // A set of object
> pointers which have already had warnings printed
>
>
>
>  enum {
>
> diff --git a/source/Plugins/Process/elf-core/ProcessElfCore.cpp
> b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
>
> index 5b5d98a..fa057f1 100644
>
> --- a/source/Plugins/Process/elf-core/ProcessElfCore.cpp
>
> +++ b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
>
> @@ -559,11 +559,10 @@
> ProcessElfCore::ParseThreadContextsFromNoteSegment(const
> elf::ELFProgramHeader *
>
>  have_prstatus = true;
>
>  prstatus.Parse(note_data, arch);
>
>  thread_data->signo = prstatus.pr_cursig;
>
> +thread_data->tid = prstatus.pr_pid;
>
>  header_size = ELFLinuxPrStatus::GetSize(arch);
>
>  len = note_data.GetByteSize() - header_size;
>
>  thread_data->gpregset = DataExtractor(note_data,
> header_size, len);
>
> -// FIXME: Obtain actual tid on Linux
>
> -thread_data->tid = m_thread_data.size();
>
>  break;
>
>  case NT_FPREGSET:
>
>  thread_data->fpregset = note_data;
>
> diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
>
> index e4fe419..489b307 100644
>
> --- a/source/Target/Process.cpp
>
> +++ b/source/Target/Process.cpp
>
> @@ -767,6 +767,7 @@ Process::Process(lldb::TargetSP target_sp, Listener
> &listener, const UnixSignals
>
>  m_last_broadcast_state (eStateInvalid),
>
>  m_destroy_in_process (false),
>
>  m_can_interpret_function_calls(false),
>
> +m_load_core(false),
>
>  m_warnings_issued (),
>
>  m_can_jit(eCanJITDontKnow)
>
> {
>
> @@ -3088,6 +3089,7 @@ Process::LoadCore ()
>
>  // We successfully loaded a core file, now pretend we stopped so
> we can
>
>  // show all of the threads in the core file and explore the
> crashed
>
>  // state.
>
> +m_load_core = true;
>
>  SetPrivateState (eStateStopped);
>
>
>
>  // Wait indefinitely for a stopped event since we just posted one
> above...
>
> @@ -3975,6 +3977,11 @@ Process::ShouldBroadcastEvent (Event *event_ptr)
>
>
>
>  if (!was_restarted)
>
>  should_resume = m_thread_list.ShouldStop (event_ptr)
> == false;
>
> +
>
> + // ShouldStop() above has some side effects besides
> calculating return value,
>
> + // so we better not skip it. But if we are loading core
> we should not resume.
>
> + if (m_load_core)
>
> + should_resume = false;
>
>
>
>  if (was_restarted || should_resume || m_resume_requested)
>
>  {
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
__

Re: [lldb-dev] API for loading debug symbols

2016-02-26 Thread Greg Clayton via lldb-dev

> On Feb 26, 2016, at 3:06 PM, Mike Gulick  wrote:
> 
> On Thu, 25 Feb 2016 10:18:42 -0800
> Greg Clayton  wrote:
> 
>> 
>> Yes: use the "target symbols add" to do thing manually:
>> 
>> (lldb) target symbols add
>> --shlib-name /path/to/my/workspace/bin/maci64/libA.dylib 
>> /archive/builds/1234/bin/maci64/libA.dylib.dSYM/Contents/Resources/DWARF/libA.dylib
>> 
> 
> Thanks.  I tested this interactively, and it seems to work, although I
> needed to modify the command:
> 
> (lldb) target symbols add 
> /archive/builds/1234/bin/maci64/libA.dylib.dSYM/Contents/Resources/DWARF/libA.dylib
> 
> The '--shlib-name' option doesn't seem to be recognized, but '--shlib'
> is.  However it produced the following error:
> 
> (lldb) target symbols add --shlib /path/to/my/workspace/bin/maci64/libA.dylib 
> /archive/builds/1234/bin/maci64/libA.dylib.dSYM/Contents/Resources/DWARF/libA.dylib
> error: specify either one or more paths to symbol files or using the --file 
> option without arguments
> 
> It looks like the 'target symbols add' without the --shlib does work
> correctly, as I can see the compilation unit and source code when I hit
> breakpoints in the library.  I'm guessing it works by matching the UUID
> of the new library with the UUID of the existing library.
> 
>> But, if you are on MacOSX, Spotlight should be locating these files
>> for us and should allow us to find them without the need to do
>> anything.
> 
> Spotlight is not configured to index these paths.  They are
> autofs-mounted NFS volumes, so they don't appear by default.  The
> archived builds are huge and there are lots of them, so its just
> not practical to index them on each system.  That certainly would be
> convenient if it worked though.
> 

That makes perfect sense. So will this be enough to get you going them?


___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] [Release-testers] [3.8 Release] RC3 has been tagged

2016-02-26 Thread Brian Cain via lldb-dev
Uploaded clang+llvm-3.8.0-rc3-linux-x86_64-sles11.3.tar.xz
and clang+llvm-3.8.0-rc3-linux-armhf-vivid.tar.xz

f8f8b0ff8f9709cbf63097727a96fde5054efefe
 rc3/clang+llvm-3.8.0-rc3-linux-x86_64-sles11.3.tar.xz
9202d52a9bff5464d0b76750c41ffec0d7d99c17
 rc3/clang+llvm-3.8.0-rc3-linux-armhf-vivid.tar.xz

No new unexpected failures for each.

On Tue, Feb 23, 2016 at 3:51 PM, Hans Wennborg via Release-testers <
release-test...@lists.llvm.org> wrote:

> Dear testers,
>
> Release Candidate 3 has just been tagged [1]. Please build, test, and
> upload to the sftp.
>
> If there are no regressions from previous release candidates, this
> will be the last release candidate before the final release.
>
> Release notes can still go into the branch.
>
> Thanks again for all your work!
> Hans
>
>  [1]
> http://lists.llvm.org/pipermail/llvm-branch-commits/2016-February/009866.html
> ___
> Release-testers mailing list
> release-test...@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/release-testers
>



-- 
-Brian
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev