 OK, tako, vendimča. Značiti, ki to je z vsega pomembnja Phajku, zato je to sva kompariz Rudyš barek. To čezi, da je pa v Pozri in Zvrko izlada kod Zvrka. Danes biti so motivacióni, da pa vzri je Uvrki, da se poz downstairsu je v pozri, jaz ispremi. first is if you type some print command then most of those expressions fail if you want to call some iterators and examin some containers of C++ it will fail in gdb while ldb handbooks it will find because it is used in the Slang compiler to compile the expression as it was V delar ne je ni bolj index, ki je tudi za začeljene, in ni ne zelo vseh, ki bome začeljene. In lahko vseh pomembne vseh pečnavala, so je std mat, in da se počuje, na kaj vseh tega ampak vseh pečnevala, to je tukaj z pravdu. V GDB počuje, da je tukaj tega priče in je to vseh. If the program was not iterating through the whole container, there was no begin function compiled in, and then you cannot iterate it even during debugging because just debugging has some different requirements. So sometimes you need to put there some just stop dummy statement into the program to get more functions compiled, which are unused in the real program, but you can call them from the debugger, like the begin and the operator arrow and increment and so on. And then you can recall it from gdv, but you see one has to type by hand all this. If there will be 100 elements, it's a bit tidied to be still typing those buses there. So what else to do? So then you can use ldb, and this is what I found some five years ago when I just tried that ldm competition of gdb and gcc, and this is the real goal, what I find most pretty and most useful. In ldb, you just type expression command, and you can write naC++ statement, which will get in time compiled and executed inside the debugged program. And you see this is native without the... It has the same output as the Python printer, but you can use c++ on land, it's much more simple. When I tried to use the same as gdb, I was unsuccessful. You see these are my attempts. In fact, the compile project started those five years ago because when I found out that ldb behaves much better in some cases, but up to now after the five years, I still don't see it real usable. But then there is a problem you see. Additionally, even with ldb, we can call only functions which are compiled in the debuggy. So even in this case, I need to add there some dummy statement to iterate the cache, because otherwise even ldb would fail on the missing statement. This should be... One of the possibilities is that it could use the original source code and recompile it when it already is using c++ compile. It could recompile it again with this statement. But currently both ldb and gdb, when they are doing this just in time compilation, they take the debug info as the source, the dwarf debug info. And so they cannot really compile their new functions. I was originally proposing to take the source code and the standard system include files and compile it again with standard system include files, which could include some of the missing functions. But it has some ABI problems, because then you need so-called reproducible build to have exactly the same source code so some system components can be updated in the meantime since compilation of the program. And so currently it has this problem, but so far the solution should be so-called c++20 modules. If you know, there should be no... no longer source include files, but for example the whole vector from std vector from include files will get compiled into some intermediate object file, binary object file which can be loaded by ldb. So this problem of the missing some methods and functions should be hopefully solved by c++ modules in near some year or two or when it gets implemented. So anyone sees the advantage of this expression? Did I explain it correctly? Do you find it great? I think I find it best since the size breadth. I find it just amazing when debugging that one can really type anything you want. Typically in the past you had to implement such new expression as new function of the program being debugged and you called just the function to bring the debug output, but that means that you have for each debugging step you have to recompile it, restart it, sometimes you can no longer produce the problem and so on, so this just in times much more convenient. So another feature I was saying that it's great on ldb is performance because sometimes when debugging real-world programs I also have to wait for example 6 minutes for one print command from gdb and then it will grow up to certain gigabytes in memory to expand all the debug info before it prints anything so ldb has a different approach which has almost immediate output so just to get idea there is so-called debug information entry with who does not know Dwarf and the bug info here is the concept of the bug info here for everyone here someone should try to be explaining the bug info the bug info rpms, the bug extension so yes, like each variable type and even scope function it has so-called die the bug information entry and then there is compilation unit which is typically normally one object file when you compile c-source files vs. header files and there can be thousands and tens thousands of the debug information entries because there are all variables of your program but even all the used templates from a system in good files by that one object file so this is the difference between the bug information entry which is through describing one c++ element vs. compilation unit which describes the whole object file and now the difference is that gdb was always reading in the whole compilation unit for the whole object file while ldb will only index it and then it will expand and read in only the bug info from that one element which is the bug information entry like one variable and in the past, like in 90s when gdb was it was fine because plain c has very small compilation units while c++ has gigantic compilation units because it's using templates and templates just are horribly big for the bug info and because there are various instantiations and they have many methods and they have many inline functions and just in practice they are gigantic and they have some arbitral program to use even open office you can see that just one compilation unit nowadays has about one megabytes of data bar it's pretty highly compressed already because it's very active bar but even despite that it's one megabyte and then actually gdb has some interdependencies between compilation units because when you ask for variable in a compilation unit it needs to compile the whole compilation unit and then it will find some other elements which need other compilation units because there is for example reference for some type which you are not interested in but it needs to really know everything about the whole compilation unit and then there interdependencies so it will typically when I was measuring it about 50 compilation units expand so it is like 50 megabytes of the bug info it needs to and then just look so I am very capable of using as the dvc++ or the compiler in this case I understand whether most cases use a little dvc++ so go to the cx problem in this case dvc++ but let's admit it that C-line client has a bit more simple or more poor about info which explains why it is smaller for C-line that's not a feature that's a bug not a feature that the bug info by C-line is smaller but in this case there are other dvc++ so about the normally when you are using client on Federa it is still using the dvc++ so just I wanted to explain that what's the difference of the performance that it can expand only one of the mkc so in this case so I wanted to explain that what's the difference of the performance that it can expand only one of the mkc and not the whole compilation in it but then there is this one there is also this advantage with ldb that initially when you started for some program it needs to index all the debug info and scan all the debug info to know where to find what and this is advantage of currently gdb where it is so called index and so it will only mmk the index from the debug info file and then it automatically knows where is what so startup is indexed by gdb is for seconds but the problem is that during your compile debug cycle after each compilation you need to create the index which means that you already need again to read it is pretty slow because if you compile program and then at index you are already on plus 70 seconds on lvn on smaller programs sure it's last but it still can take for example 10 seconds when I compile my code so it's still like just for the debug cycle it's only 10 seconds and ldb should have index in the future but currently it does not but the advantage is that ldb is scanning the debug info in multistreaded mode so even with more cores it's not so slow even without the index it's not so bad so in practice it's funny that even ldb when it does not use index then in practice it's faster during the compilation the debug cycle because it's just 13 seconds to read it in ldb comes originally from apple and apple does have apple index on osx been used but currently on linux for barf it's just it's not implemented yet there is already some support for the bug names but I could not get it work it was written by Pavel Abath in Google and it just it did not work for me but it is on the part compilation in it and not Google so it still needs to read index from each of the compilation units and they are even for example 1000 compilation units in larger projects so it needs to read 1000 indexes so that's still slower than the global index of gdb but this is sure that should be fixed in some time and then there is the third feature such major one as typically people always come to gdb and they ask I want to use gdb as a library not as a user I want some program and I want for example to attach some other program and see it's backtrace from my c program so how will I do it and people always tell them use python because gdb has python extension programming in python ldb also has programming in python api for python but just people want c++ sometimes it's inconvenient when you have c or c++ program to call python from it this is what ldb provides for you this is one of such examples how you can it's similar to the python just that you can use it directly from c++ it has nice stable api so for these sb functions everything which starts with sb is the public api of ldb this is just from user point of view currently in eclipse on febora be careful you have this rpm installed which has some big dependencies so sometimes it's the same but if you have this rpm installed you can already use ldb instead of gdb for eclipse and it works the same because ldb is also implementing the mi machine interface originally invented by gdb so it's compatible for eclipse and in the eclipse debuger console you can access ldb this way so you can see from eclipse you can see that it runs on ldb and from user point of view it works the same but it can be faster but I don't use eclipse myself so I don't have practical experience there are some blockers if you know dwz dwz is such compression compression being used in febora and even rel 7 there is problem that ldb does not support it now so I don't support for dwz for ldb but it's not at upstream you cannot currently read with ldb the system debug info the system libraries but sure if you just compile your program you can read everything in your program but sometimes you want to access even system libraries that's not available but you can on copper there is myrock build with dwz which is also drunk then also it does not support the bug ties but it should be very quickly fixed the bugs are produced by the debug type section which is somehow competing with dwz as the compression it's a different approach but so I would say that work is more using this debug type section where redhead is still sticking to dwz it has both some pros and cons dwz has some slightly better compression ratio but the compilation takes much more time hours and then hours on big programs all has pros and cons there is some compatibility problem and these are some nice to have features it is also missing debug info primarily if you use two commands of gdb then the commands are a bit different in ldb there is some quick hints you can google out how are gdb commands mapping for ldb but ldb is primarily using byapplex code and so people don't type commands so that isn't a problem for them but when I'm using 4 command plan commands it's a problem so I'm mostly at the end anyone has any questions there is a question where gdb is so the question is where gdb is so yes ldb is using the same protocol and but it is its own server and there are various eventually both gdb and gdb side of this protocol so personally I haven't tried to exchange gdb server for ldb server but the protocol is basically the same but I am most servicing I don't try to use it for the basic function of gdb one is not here in a bit more block yes it should be I open some two blocks for our PC and it works so I think I got some support for 3.9 years it should be supported for all but it's so I can any more questions anyone who wants to try ldb or do you find it more useful or I would love to be interested in some feedback do you struggle do you face some of the problems of gdb problem is the expressions and slowness of gdb nobody has this problem here ok so this is what I was writing in this slide that ah ok sorry but the python interface of ldb is different from gdb python interface yes it is currently the pretty printers or ldb constant data format just needs to be write completely which means primarily that like sdgc plus plus because they are also pretty printers for example for the g-list and some other like they are maybe 5 libraries which have pretty printers but I don't think those are much important the very important ones are for sdgc plus plus and they are already important in question I have a library of microscripts that I use for I don't want to redo them again but I can see the slowness gdb even with the microscripts it takes quite a long time to redevere so this is the problem and it is the python ldb is generated by the swing somehow so is there a difference in plus plus generated so that it cannot be used plus plus plus at the end but yes it is enough so we are at the end so this is the pretty printer what it takes about the pretty printer so that's all, thank you