Support for mini-debuginfo in LLDB
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Subtitle |
| |
Title of Series | ||
Number of Parts | 490 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/47401 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
Sheaf (mathematics)Computing platformShift operatorContent (media)InformationSinc functionBinary codeMoving averageProjective planeInstallation art
00:22
Binary fileSymbol tableTable (information)SubsetRight angleSimulationSymbol tableInformationComputer fileProjective planeRegular graphCrash (computing)Binary codeAddress spaceDebuggerQuicksortReading (process)Parameter (computer programming)BitSheaf (mathematics)NumberVariable (mathematics)Context awarenessLine (geometry)Theory of relativityFile formatBlock (periodic table)Table (information)Data storage deviceHypermediaInstallation artForm (programming)Traffic reportingDynamical systemSummierbarkeit
03:05
Table (information)Symbol tableDrill commandsBinary fileFocus (optics)Computer-generated imageryCore dumpProgrammable read-only memoryString (computer science)Local ringDefault (computer science)Symbol tableSheaf (mathematics)Crash (computing)Functional (mathematics)Computer programmingOnline helpImplementationSimulationBinary codeParameter (computer programming)Line (geometry)Variable (mathematics)Slide ruleComputer fileQuicksortFocus (optics)Similarity (geometry)Point (geometry)System callPhysical systemSineGastropod shellComputer configurationAnalogyBuildingControl flowState of matterComputer animationProgram flowchart
05:30
Symbol tableMKS system of unitsLocal ringString (computer science)Data typeDefault (computer science)Symbol tableLine (geometry)Sheaf (mathematics)Demo (music)Computer animation
05:43
Group actionoutputBeer steinComputer fileDirectory serviceData conversionDressing (medical)Revision controlMilitary operationInformationData integrityAttribute grammarLink (knot theory)EncryptionProcess (computing)SoftwareData typeOnline helpSymbol tableComputer programmingControl flowReading (process)Sheaf (mathematics)Point (geometry)System callVideoconferencingQuicksortDemo (music)Right angleRegular graphFunction (mathematics)Computer animation
06:32
Process (computing)Computer fileDirectory serviceDressing (medical)Military operationBeer steinData integrityLink (knot theory)EncryptionData typeSoftwareGroup actionDefault (computer science)outputData conversionRevision controlInformationAttribute grammarOnline helpDifferent (Kate Ryan album)Point (geometry)Control flowComputer animation
06:57
Computer fileDirectory serviceData conversionDressing (medical)Military operationRevision controlInformationData integrityAttribute grammarLink (knot theory)EncryptionData typeSoftwareProcess (computing)Address spaceGroup actionDefault (computer science)outputBeer steinThread (computing)Demo (music)Online helpRight angleProof theoryMereologySoftware testingSound effectComputer animation
07:23
Symbol tableSheaf (mathematics)Binary codeMereologySlide ruleReplication (computing)Electronic mailing listSimulationInformationComputer fileDisk read-and-write headQuicksortSoftware testingSymbol tableObject (grammar)CuboidWordMultiplication signBitMedical imagingFile archiverCore dumpRight anglePoint (geometry)Control flowGroup actionArithmetic progressionRegular graphNumber
10:11
Software testingSparse matrixReal numberSymbol tableoutputSystem callQuicksortSoftware testingParameter (computer programming)Function (mathematics)NumberCanonical ensembleStatement (computer science)SimulationPhysical systemLine (geometry)Computer fileFile formatBitSymbol tableSparse matrixContent (media)Video gameCodecStress (mechanics)
12:31
Goodness of fitInformationTracing (software)Computer animation
13:47
Point cloudFacebookOpen sourceComputer animationProgram flowchart
Transcript: English(auto-generated)
00:05
So thank you all for being here and to my talk on mini debug info support in LLDB, and I'm Conrad Klein I work for Red Hat and mostly on upstream LLDB since last year before that I worked on an open shift in 2016 and
00:20
until recently So the goal of his whole project was to improve LLDB as a debugger for Fedora and RHEL binaries where you mostly have When you have on the release binaries, right? You don't have debug symbols installed and That means you don't have any Symbols directly accessible and that means whenever a program crashes and your tool picks it up
00:43
You only see addresses and no symbol names and the approach was to make LLDB aware of mini debug info, which is the concept we're going to talk about and Could be that I use mini debug info and the GNU debug data section interchangeably So, please excuse that and the mini debug info is where those symbols are stored that we are interested in
01:07
So it's helpful to talk a little bit about why it was invented and how it was invented because before we go into how it actually looks so the has been invented before I joined Red Hat long before and I only talked to colleagues recently about
01:22
why was it invented this way and not some other way and So the whole idea was to be able to generate a back trace for crashes when you have the automatic buck reporting tool in Fedora and for that one wants to have symbol names and probably line numbers and file names and such and
01:43
so those make up an L file on their own right and the idea was To put them all in and eventually it all got too big and was we everything was stripped out And so you only are left with the regular Symbol table, but cut down in fashion. I'm going to show later, but essentially just function names, and that's it no variables or parameters and
02:05
Everything else the rest format itself remained even though maybe the information could be stuffed in different places Somewhere else one thing to remember is this is nothing to do with Debug information even though it's called mini debug info. It's
02:20
Just symbol tables and nothing else so there's no relation to dwarf whatsoever and Yeah, this is I hope you can read this. It's not can you read that? Somewhat okay, so essentially we can just talk about the bubbles here so to the left you see sort of an L file in my mind you have this green bubble where you have the DIN SIM the dynamic symbols right and the SIM tab and usually the
02:44
SIM tab is this is the superset of the the DIN SIM plus more and When you have a release binary right you you essentially cut this out, it's not long no longer there and You usually cut it out and put it next to the debug packages and install it there, but since we're dealing with
03:04
Binaries that have only release information and as for Fedora and rel also the mini debug info. That's this place here That's essentially a gnu debug data section an invented section that contains data Namely an L file on its own which is
03:21
Essentially as you can see the reference there essentially the SIM tab, but cut out all the duplication from the dynamic symbols and The holes that looks like it's Swiss cheese. That's more or less we've put out everything that is not a function name or For example you've put stripped out the symbol names and variables and so forth sorry
03:42
variables and parameters right and That has some implications on LOB for example When you start the program and you read the symbols you LDB usually tries to find It's there's if there is a SIM tab. That's enough right you have everything but if there's no SIM tab, I'll do would look go and say I read the DIN SIM and that's it and
04:05
Here the implement whole implementation evolved around Trying to combine those two to have something that is at least capable to give you symbols for you for your functions and Symbol names it's just I should say so
04:23
The way I did this was focus on on backtraces and not on crashes or so forth But make LOB essentially aware of their symbols so that you can set a breakpoint hit it and maybe dump the symbols and for that I just took an a Whatever I found zip binary that it's
04:41
that is Mostly installed in every system, and I sort of blindly identified a function and the only Hurdles worth it must not come from DIN SIM because that's what LOB can read must come from the gnu debug data section and then we're going to do a shootout of GDB versus LOB and
05:03
So On this slide you can see I've dumped the symbols so this zip dot GG GDD on line two that is essentially the gnu debug data sections that I've extracted from the zip binary and here you can see this Promising help function help symbol because I just looked at it and said okay
05:23
Maybe you can find that some other way, but I looked at and said yeah Maybe it's promising if you call zip dash dash help. Maybe that gets triggered and we can On this line. We just on line 12. We see that. Yeah, it's it's not in the directly accessible symbols So it must come from the gnu debug data section itself, and it's no duplication there, so let's be brave and try demo
05:47
It's not a fancy demo, but at least it's somewhat interactive so When I fire up GDB calling exactly what I did showed you before Zip dash dash help you can see that GDB tells us. Yeah, we're I'm reading symbols from gnu debug data section and
06:04
It also tells us. I don't have any debug symbols installed which means we're not cheating so what Gd what right? So if we start the program you get what you expect the regular zip help output But if we want to set a breakpoint on help right it can find the break put a break point
06:21
And if you run again it hold it stops there. Just as you would expect so that's nice. Let's see how See how LDB performs here, and I'm talking about LDB 9 which is what ships with fedora 31 so doesn't tell us anything much the calling conventions looks a little bit different and
06:43
Here are the same we run it we see the output and if we do try to set the breakpoint on help No, wait find it right. It's just not there. So that was how it worked in LDB 9 in LDB 10 which should be shipping soon. I guess or packaged soon
07:04
We just proof right we run it and we can set the breakpoint and help finds it it stops and That's essentially the proof that yeah, it works Hey, thank you Okay, that worked and the question is is this ready to ship you know of course not and the main part was in in testing
07:25
So just as a word of warning. This was my first contribution to LDB itself like I said I only started last year. We have a bunch of tests that I've been asked to implement it like Take the community back dollar section find a symbol in there using image dump sim tab and issue warning when you have a mini
07:43
debug info where you essentially try to decompress it But you don't have a little make support compiled within or when you're having compressed I mean you can reach for itself. We have corrupted archive red and the last one was the tricky bit getting the there's a GDB manual page where it says how are you how are you going to construct a
08:05
binary that has this mini debug info installed and I need to sort of replicate that in in LDB because that is the only way I can really set and breakpoint and You might wonder that what? parts were hard or what which not and
08:21
Actually setting a breakpoint worked more or less out of the box. The only problem was that there was some confusion upstream about how to create this elf object and Turn out to be very easy, but he didn't hitting the breakpoint didn't work because I essentially just Fetch the the the created an object file fetch the sim tab out of it and
08:47
stored it where we store the other sim tab and Thought yeah, it's it's using it correctly. I can hit the breakpoint. Everything's fine but actually LDB has some concept of unified section lists and I need to put it in there and then it all worked and
09:02
Also LDB does work with This concept of having a stripped down elf file that is not runnable but where it can do sim tab dumps on or yeah, and That's not ideal to do if you want to say I can hit a breakpoint, right? It needs to be runnable and
09:25
What was a pain for me was that the tool in LLVM that was used for that is YAML to object which takes those YAML files if we have enough time I can show you that and it always takes the YAML file and produce an elf file and
09:40
That made my test go nuts in my head it exploded because it always produced the sim tab, but I didn't realize that at first Because then LLB only sees yeah, I see a sim tab. I'm gonna read that and was empty. No symbols found. So Like usual you have the regular polishing for upstream making everybody happy And documentation is really an issue in LLDB I'd say
10:07
Yeah, so we have more time. So let's head over to some more slides What I really liked was I came to love actually the LLVM integrated tester which consumes files like this one
10:21
But it doesn't have to be a C file Here as you can see probably guess we just print the number of arguments in line eight And that's about it and we have number of tools involved here so you pass this to the the LVM lit tester and it double it is interested in those requires and run
10:41
comments that you can see there and It just says yeah I need a Linux system LZM a support must be compiled in I need the exact computer executable and Then it's just going to execute one by one the the run statements You're not supposed to do that in line two that you directly call GCC, but here I'm just doing it for the sake of
11:01
explanation so percent T and percent S are Percent S is this file percent T is the temporary file just for this test and you then you compile it to the percent T Call percent T Give them a bunch of arguments output that to file check and you also pass the current file as an input to file check Again, so that then is interested in the check comments just to check that. Yeah
11:25
It's it's going to check that the number of outputs is five. So it required a little bit of work just some CMake canonization like Whenever you said it means CMake is you can just say turn it on True one or whatever. So that was come on those were
11:42
Started start sort as one or as I don't know it falls. I don't remember but that was That was sort of it and that's the example I have for And sparse not runnable elf file where you essentially just describe your elf file in yaml format and then say, okay
12:02
I'm like before we have those requires run and check comments and pass it over to the lid to the LLVM lit and then Essentially it all it does is tries to find the multiply by four Symbol name there that you can see at the end of line five in the content and As you can see notice line three
12:22
I had to manually remove the sim tab, but that got fixed luckily and yeah that caused some problems Yeah, that's all I have. So if you have any questions, thank you first for listening. Thank you Yes, please
12:47
I Yes, sure, but I needed to have it in inside of LDB first and have the I Mean if you take LDB and then you can just use it and I just wanted to
13:04
To have it understand this mini book info You Mean like back traces or something Good question need to maybe forward that
13:36
To forget the question, thanks