Re: [lldb-dev] Adding DWARF5 accelerator table support to llvm

2018-06-13 Thread Pavel Labath via lldb-dev
Hello again, It's been nearly six months since my first email, so it's a good time to recap what has been done here so far. I am happy to report that stages 1-3 (i.e. producer/consumer in llvm and integration with lldb) of my original plan are now complete with one caveat. The caveat is that the

Re: [lldb-dev] Adding DWARF5 accelerator table support to llvm

2018-06-13 Thread David Blaikie via lldb-dev
Nice! Thanks for the update: re: ObjC: Perhaps debug_names and .apple_objc could be emitted at the same time to address that issue at least in the short term? As for size impact, have you tested this with fission and compressed debug info enabled? (both in terms of whether debug_names is as compr

Re: [lldb-dev] Adding DWARF5 accelerator table support to llvm

2018-06-13 Thread via lldb-dev
> -Original Message- > From: Pavel Labath [mailto:lab...@google.com] > Sent: Wednesday, June 13, 2018 9:57 AM > To: jan.kratoch...@redhat.com; llvm-...@lists.llvm.org; > jdevliegh...@apple.com; lldb-dev@lists.llvm.org; dblai...@gmail.com; > Robinson, Paul; apra...@apple.com; echri...@goog

Re: [lldb-dev] Adding DWARF5 accelerator table support to llvm

2018-06-13 Thread Jonas Devlieghere via lldb-dev
Hi Pavel, > On Jun 13, 2018, at 6:56 AM, Pavel Labath wrote: > > Hello again, > > It's been nearly six months since my first email, so it's a good time > to recap what has been done here so far. I am happy to report that > stages 1-3 (i.e. producer/consumer in llvm and integration with lldb) >

Re: [lldb-dev] Adding DWARF5 accelerator table support to llvm

2018-06-13 Thread Greg Clayton via lldb-dev
> On Jun 13, 2018, at 11:18 AM, Jonas Devlieghere via lldb-dev > wrote: > > Hi Pavel, > >> On Jun 13, 2018, at 6:56 AM, Pavel Labath > > wrote: >> >> Hello again, >> >> It's been nearly six months since my first email, so it's a good time >> to recap what has been

[lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Greg Clayton via lldb-dev
I am interested in being able to load a core file on linux machines and save out a windows minidump file with enough info for backtraces and maybe some variables. I know we can ingest minidump files in LLDB, but can we produce them? I was planning on writing a python module that adds a new save_

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Zachary Turner via lldb-dev
We can’t produce them, but you should check out the source code of google breakpad / crashpad which can. That said it’s a pretty simple format, there may be enough in our consumer code that should allow you to produce them On Wed, Jun 13, 2018 at 11:47 AM Greg Clayton wrote: > I am interested in

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Adrian McCarthy via lldb-dev
Zach's right. On Windows, lldb can produce a minidump, but it just calls out to a Microsoft library to do so. We don't have any platform-agnostic code for producing a minidump. I've also pinged another Googler who I know might be interested in converting between minidumps and core files (the opp

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Leonard Mosescu via lldb-dev
The minidump format is more or less documented in MSDN . That being said, it's not exactly trivial to produce a good minidump. Crashpad has a native & cross-platfo

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Leonard Mosescu via lldb-dev
> > That being said, it's not exactly trivial to produce a good minidump. > Crashpad has a > native & cross-platform minidump writer, that's what I'd start with. > Addendum: I realized after sending the email that if the goal is to convert core

[lldb-dev] DWARF v5 - compiler work update

2018-06-13 Thread via lldb-dev
At EuroLLVM's Debug Info BoF, I made a rash statement about being done with DWARF v5 "next week." It has been an impressively long week... and it's not over yet. But given Pavel Labath's awesome news about accelerator tables, it seemed like a good moment to review the rest of the DWARF v5 work. T

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Zachary Turner via lldb-dev
Also, if the goal is to have this upstream somewhere, it would be nice to have a tool this be a standalone tool. This seems like something that you shouldn't be required to start up a debugger to do, and probably doesn't have many (or any for that matters) on the rest of LLDB. On Wed, Jun 13, 201

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Greg Clayton via lldb-dev
The goal is to take a live process (regular process just stopped, or a core file) and run "save_minidump ..." as a command and export a minidump file that can be sent elsewhere. Unix core files are too large to always send and they are less useful if they are not examined in the machine that the

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Zachary Turner via lldb-dev
What about the case where you already have a Unix core file and you aren't in a debugger but just want to convert it? It seems like we could have a standalone utility that did that (one could imagine doing the reverse too). I'm wondering if it wouldn't be possible to do this as a library or somet

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Zachary Turner via lldb-dev
Also one could imagine using it for many other things too. For example, given a windows dump file, strip it down (i.e. remove heap, etc), or similar types of options for operating on Unix core files to remove certain types of info etc On Wed, Jun 13, 2018 at 2:51 PM Zachary Turner wrote: > What

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Jason Molenda via lldb-dev
fwiw I had to prototype a new LC_NOTE load command a year ago in Mach-O core files, to specify where the kernel binary was located. I wrote a utility to add the data to an existing corefile - both load command and payload - and it was only about five hundred lines of C++. I didn't link against

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Zachary Turner via lldb-dev
Yea, I think something like this would actually make a useful llvm utility. Call it llvm-core or something, and it links against the library LLVMCoreFile. We could move all the code for consuming and producing Windows minidumps and Unix / Mach-O corefiles from LLDB down into LLVMCoreFile, write a

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Leonard Mosescu via lldb-dev
> > What about the case where you already have a Unix core file and you aren't > in a debugger but just want to convert it? Just curious, would a small Python script using the LLDB SB API satisfy this requirement? We could move all the code for consuming and producing Windows minidumps > and Un

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Jim Ingham via lldb-dev
Greg already wrote a "save_crashlog" Python command that writes the state of the program as a macOS flavor Crashlog file. It's in examples/Python/crashlog.py. My guess is he had something similar to that in mind, but writing a mini dump file instead. Jim > On Jun 13, 2018, at 3:20 PM, Leona

Re: [lldb-dev] Do we have any infrastructure for creating mini dump files from a loaded process or from a core file?

2018-06-13 Thread Leonard Mosescu via lldb-dev
For core -> minidump conversion, a Python tool might end up as trivial as: process = target.LoadCore(source_core_file) process.SaveMinidump(output_minidump_file) Another angle on reusing existing minidump writing code: we could reuse just the minidump file creation from Crashpad (the part which