Your Application versus GDB

Video thumbnail (Frame 0) Video thumbnail (Frame 2702) Video thumbnail (Frame 17683) Video thumbnail (Frame 32544) Video thumbnail (Frame 40199) Video thumbnail (Frame 50201) Video thumbnail (Frame 54600) Video thumbnail (Frame 59299) Video thumbnail (Frame 60467) Video thumbnail (Frame 61458) Video thumbnail (Frame 62710) Video thumbnail (Frame 63898) Video thumbnail (Frame 64864) Video thumbnail (Frame 66199)
Video in TIB AV-Portal: Your Application versus GDB

Formal Metadata

Your Application versus GDB
Title of Series
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.
Release Date

Content Metadata

Subject Area
In recent years GDB has undergone a renaissance, adding Python scripting and other cool new features. This talk will show you how to customize GDB for your application and your debugging needs. We'll go into depth about pretty printing, stack trace filtering, and writing new commands; and will also discuss writing GUIs and other tools inside GDB. Finally, we'll cover other interesting and useful GDB projects
Scripting language Point (geometry) Matching (graph theory) Multiplication sign Forest Debugger Content (media) Video game Integer Bit Cartesian coordinate system
Context awareness Hoax Thread (computing) Code Euler angles Multiplication sign Source code Set (mathematics) Mereology Food energy Computer programming Bookmark (World Wide Web) Formal language Neuroinformatik Mathematics Different (Kate Ryan album) Core dump Gauß-Fehlerintegral Endliche Modelltheorie Office suite Extension (kinesiology) Logic gate Error message Area Scripting language Structural load Sound effect Bit Instance (computer science) Regulärer Ausdruck <Textverarbeitung> Category of being Type theory Arithmetic mean Order (biology) Configuration space Whiteboard Resultant Writing Filter <Stochastik> Point (geometry) Slide rule Functional (mathematics) Letterpress printing Virtual machine Control flow Mass Graph coloring Twitter Power (physics) Revision control Energy level Software testing Data structure Compilation album Condition number Distribution (mathematics) Multiplication Information Interface (computing) Debugger Boilerplate (text) Expression Volume (thermodynamics) Line (geometry) Cartesian coordinate system Compiler Word Personal digital assistant Family Library (computing)
Logical constant Suite (music) Hoax 1 (number) Set (mathematics) Parameter (computer programming) Mereology Food energy Tracing (software) Computer programming Web 2.0 Medical imaging Mathematics Hooking Oval Core dump Flag Office suite Social class Physical system Scripting language Constraint (mathematics) Fourier series Linear regression Electronic mailing list Maxima and minima Type theory Right angle Figurate number Writing Filter <Stochastik> Point (geometry) Web page Implementation Divisor Virtual machine Letterpress printing Control flow Mass Theory Field (computer science) Wave packet Template (C++) String (computer science) Representation (politics) Energy level Software testing Integer Codierung <Programmierung> Data structure Default (computer science) Standard deviation Focus (optics) Information Poisson-Klammer Cartesian coordinate system System call Frame problem Symbol table Compiler Personal digital assistant Object (grammar)
Functional (mathematics) Server (computing) Patch (Unix) 1 (number) Mereology Tracing (software) Food energy Code Computer programming Formal language Neuroinformatik Software bug Revision control Different (Kate Ryan album) Energy level Software framework Data structure Condition number Area Bit Limit (category theory) Flow separation Frame problem Arithmetic mean Pointer (computer programming) Personal digital assistant Interpreter (computing) Right angle Quicksort
Building State of matter Code Multiplication sign Source code Sheaf (mathematics) 1 (number) Parameter (computer programming) Inverse element Mereology Tracing (software) Computer programming Neuroinformatik Mathematics Spherical cap Positional notation Different (Kate Ryan album) Single-precision floating-point format Flag Information security Physical system Exception handling Scripting language Area Email Type theory Arithmetic mean Process (computing) Vector space Online-Algorithmus Right angle Pattern language Quicksort Ocean current Point (geometry) Functional (mathematics) Implementation Overhead (computing) Vapor barrier Computer file Patch (Unix) Virtual machine Similarity (geometry) Control flow Machine vision Product (business) Number Revision control Universal product code Term (mathematics) Logic programming Code refactoring Focus (optics) Graph (mathematics) Information Debugger Projective plane Line (geometry) Word Personal digital assistant Interpreter (computing) Video game Library (computing)
Functional (mathematics) Computer file Information Demo (music) Patch (Unix) Cellular automaton Range (statistics) Debugger Tap (transformer) Bit Variable (mathematics) Graph coloring Computer programming Compiler Category of being Kernel (computing) Semiconductor memory Right angle Data structure Communications protocol Plug-in (computing) Physical system Library (computing)
Axiom of choice Session Initiation Protocol Area Greatest element Computer animation Window Formal language Library (computing)
Point (geometry) Area Functional (mathematics) Software developer Mereology Formal language Hand fan Word Personal digital assistant Hacker (term) Cycle (graph theory) Quicksort Library (computing)
Functional (mathematics) Message passing Thread (computing) Computer animation Lecture/Conference Code Flow separation Window
Point (geometry) Dataflow Graph (mathematics) Computer animation Data structure Line (geometry) Control flow graph Window
Area Graph (mathematics) Computer animation Hypermedia Network topology Multiplication sign Object (grammar) Control flow graph
Point (geometry) Functional (mathematics) Server (computing) Code Source code 1 (number) Virtual machine Device driver Set (mathematics) Web browser Function (mathematics) Image registration Parameter (computer programming) Mereology Computer programming Wiki Web 2.0 Pi Different (Kate Ryan album) Electronic visual display Diagram Data structure Physical system User interface Graph (mathematics) Information Mapping Wrapper (data mining) Interface (computing) Projective plane Debugger Electronic mailing list Expert system Extreme programming Cartesian coordinate system Process (computing) Computer animation Integrated development environment Personal digital assistant Logic Network topology Right angle Document Type Definition Quicksort Table (information) Window Abstraction Library (computing)
chou named firstly could I just please ask if anybody's gonna leave during questions could be did very quietly and then use the TV it also just anyone else can hear any questions about st and this is some drumming is going to be talking about GDP in your applications I of him money in some true toward the red hat I'm I work on the debugger team red and and forests just said 1st of all thank you all for coming up this may be a little too many you will freaked out and I'd like to thank Greg had the same for my trip to fantastic can also just wanna make sure you didn't get the wrong idea about the title of this talk to me VS your application here expecting some kind a cage match the of D. does hate your application expresses its content through the design of his command line is life this talk is really going to be about the do you can help you debug your application some filler like to tell you and tell you before I tell you what I tell you and so the introduction spears self-referential were doing it right now and then it should also talk to me about life and we had a python script integer the in recent times and when to talk about why we did it and what you can use it for them or Python then even more Python but then we're gonna talk about a couple other things in G. they're interesting and may help you debug your application better when you talk about probes probe points what they are how to use them and we follow bit about the G it yet we found about so far so
trends in the bugging me not really trends and debugging there's trends in your program your program is getting bigger sees more threads every model it is bigger there's more volume far a compiler generates more debugging of and under using more more shared libraries if you look in the district you know my favorite testers for GB is we're office I believe last time I tried it out and uses 160 shared libraries masses of programs are becoming distributed days that's commonplace write programs in multiple languages such as C and C + + which is in a way that's dinosaur spot in multiple languages it's more I know you're using JavaScript Perl Ruby and there you go all in 1 we have Pr NJ compilation on it's very common now there anybody who's running Luo JavaScript of all kinds of things and how do you do budget compiled programs so wanna talk a little bit about the features attitude you help me with some of these problems we solve every problem that we're making headway on all self GTD reacts to your program in Budapest separating bigger programs for easier programs and somehow insisting that we ought to be able to buy them so what 1 thing I think we realized is that has a program gives bigger you're debugging it gets harder the bigger the program the less of it you actually know you know even a modest program like the very few people say understand all of it it's extremely uncommon maybe nobody that if no the bigger the program the less can really mean as a percentage you can really know so what that means is when you're debugging you wanna be able to focus the you know you wanna filter on all that extraneous stuff to focus on the part that you need to understand in order to develop an and down here if you look at gdb from historically it was designed this with a certain kind of use cases more and it just wanted to you what is but sometimes it knows too much or in those things in a way you really understand 1 sometimes it doesn't know enough wanted to that effect so to help you with this problem where you know it's not obvious maybe immediately why we did this but we had conscripting to G and we believe that this is a nice way to let you perform this filter and the reason that it's nice is that lets us do couple knowledge about your application of things that you care about from duties core you can maintain a set of Python code tank you're debugging means and you can keep that with your program and you did not have to put a whole bunch of stuff into Japan you will cover some examples that then there's this slide is about some common themes in the Python conditions that we make 2 GB of hoax what that's about as and we set things up so that of Python code is associated with your application and application is kind of a word it could be associated with the shared library so for instance we have things that are associated just with with standard C + + so when GB you know when you start debugging your application or when application load the shared library give appropriate uses a Python code it then automatically in a properly configured distribution on Fedora is the 1 I use you know because I work on it and have know it's well configured on the amount of configuration have to do is know it just works which is very nice properties of all these features can be disabled individual that's really important GB is on what I like to think of as a multi layered about you can debug where at the very highest level using your source code and the types in your program and these Python differ Python filters and commands and stuff but we construct that way you know all Python code is nice but it also can be body so sometimes you know if there's a bong and you need to be able to disable so everything's disable and energy via the layers go down and down to you can step through every single instruction at the assembly level and just look at registers ignore all of us the so disabling supports the concept of choosing the layer in which you want to things indeed year per inferior or that means it's a debugger multiple programs at once which you can do a GET on the little bits of Python code that are associated with your program are enabled and the programs that use that library or that application in disabled in other words so that when you switch contexts you don't get confusing results in a far if a pretty-printer isn't written exact perfectly just multiplying or the program or if you have different if you have rigid-body multiple programs that use different versions of a library require different versions of printers that works in this design and finally GB has a command line interface which I assume generously that most of you actually use but it also has a machine interface which is what all the Louise used to talk to you to drive and the Python extensions we may codesigned work both with the CLI and with MRI and what that means is on you right Europe you know Python code once in Dewey's can take advantage of it and command line users can take advantage of it without any kind of changes 1st questions you know you can just find someone down ask a question so what Python will just do a little who wrote some python facilities and commands you can write in new GET command on in Python so for instance to people here know about people from the dorms father and it's the nasal thing it they can read through the debugger info in your program and look for structure and tell you the layout of the structure and know all the holes in the structure of it's nice if you're worried about family savings you can we back a structure make it smaller so PAO you can write it as a GET command in Python like you know 20 or 30 lines of code so like that 50 of functions you can add new functions to I think I have an example of something this here got out of the intestines of the area Here we that worked on and so this is that while this is actually a super simple i i example a Python command in GATE adhered your if you type something in the CLI and it hits an error on the board so whatever else is going on like if you're running a if it's in the middle of a little script just aborts that script because of how do you were sends out this is a little commanders to ignore errors in duties command line doesn't have exception-handling python does just trivial there's little boilerplate if the Radisson but it's you know nothing so then you can just say ignore errors functions and getting back to that on you can add new what we call convenience functions there of function you know like indeed BGB has its command language but also has an expression language special language is something you can use like print you print some expression print out of you can do breakpoint conditions using this expression language on without the ability to add functions that can be called from these expressions now why is that useful the way it's useful as the GB has a lot of knowledge about the program on sometimes knowledge that your program does not have and historically it was very difficult to script and get this information from GTB use it in a programmatic way my favorite example of this function the the short little function like color color is on this came about because of the 110 in debugging problem where I had some function that was called you know 10 million times and I wanted to say every point on it but only 1 is recall past showing this to break function and when it was called by function g in G B knows that it understands that it has the whole stack available to the working computer but there was no way to express that expression so we reconcile python function it's trivial you can see there's like going before there's little boilerplate and then here's a users of the say break if the caller is whatever I want and the full power of Python is available to you here you can make it do regular expressions you can make it arbitrarily Harry and and it's all know extremely easy you can refer to variables in new function you know almost anything you can think of that you could do you so so those are like simple thinks commands and functions on the next talk about something really useful from pretty pretty high because if you've ever debug C + + is probably seen this the end of this is printing a local variable now
if you're experience debugging C + + but you can wade through this and figure out that this is known the and any guesses with this is it's a list of strings on now and it's also test your knowledge of the standard C + + if you think you could find out where the strings are our it's almost impossible to print a string in the spirit of a pretty printer does this Fourier on and the idea behind a pretty printer is just that when GB goes to print something 1st it says does anybody written in Python wanna take a stab at it if we were a full suite of printers for basically every data structure and standards equals plus and you're going back to like well I have that as the slide but if you actually try to find to string Webster's suppose plus I think strings will be OK once but there's a few data structures that are written in a completely non-obvious style where even if you print them you will actually see any of the underlying data you just see this overhead object and you have to know the constants to semantics of objects and so on the Python craters remember designed the hooked into would you be on to do the the associated with web standards suppose plus the maintained and its standard supports plus the we and obstetrical spots so in theory if would stated suppose plus changes internally in the testsuite catches printing regressions and this doesn't involve any at all really all symbols on the Jedi side is that we maintain some minimal ABI compatibility at the Python where we don't break your Python script you so so likely would seriously switches to the next AVI nothing's gonna it has the of the of the but the question is how you write those test in which standard suppose plus without making it depend on GB actually do just they could depend on duty on which you know it's a little chicken and egg problem 4 years ago or whatever but you know today home it's fine as long as we don't know break the API but like a pretty good to API that we kept it extremely simple may be too simple but extremely simple so on the there's not much the break and that and like I said before all these things work with who use as well as the command line interface higher-level I screenshots for them but you know the way designed is the set this is all printed in a way that can all the do is and they need a set of flag or something that you don't just look so and that's not something that if you're writing a printer for Air Act for your application you need to worry or think about that that's all just completely hidden to now why would you wanna write printers yielded status across classes may be the biggest offender tons of programs have string classes it's nice to piRNA string that looks like a string on lots of programs to like tagged object representations in writing JavaScript does that every LISP evidence that you can write Python the decoders representations and the new print an object and it looks like an object not like some the integer so tight printing and this is not is awful last year the shows how our sort of down I am by C + + on this doesn't quite often me until you realize that this goes on for 5 pages of n and on you know a lot of it is like methods which just generally not interesting this is printing a tight by printed type usually images to the data members you know so we added some nice fix some of it in Python some just straight straight to the core like turning off methods and so forth but you can see with the tight printer which is another kind of thing that we supply you can say this big gooey mass at the top or something you would never right in your own programs standard basic string liability on the land that or when you really meant as standard called string then you can see the template now tells you what the template arguments are and then we remove a bunch of crap now this 1 is about I think this is gonna near that applies system at the end of if this 1 is maybe less general useful it's more about you if you're heavy template user you want something like this and it may not be immediately clear to you might think why don't you know on what's the value of it like but can be like in a case like this standard called constraint is a typedef everyone that's what everyone actually writes programs and plenty of programs that's a piece of knowledge that's not in your program you know there's a lot of typedefs users but that's the piece of knowledge that you have your program doesn't energy leaders and so you can teach a factor that type printers you can say you know whenever you see this hairy mass really everybody writes this and generally speaking if you you know any better printers this type we should put the thing that people really want see some and again this is on you know hook activated associated with your application maintained by you out of your mind the question is why not try to debugging info well that's yeah that's what I meant when I said there's plenty of typedefs nobody uses on you could do that right you could look through all the typedefs in the Devonian folk we don't know which ones are reported on there's no fight that you could add a natural you and have the compiler pass it on through well this is easier that's not what was yeah there might be more than 1 you know and also the then you're talking about potentially scary a lot of the body of you know we make terror so the more Python and now Romania X so here they are greatly reduced stack-trace I underwent remind me of something these things the other point when the make really I forgot to write it on my son last name these things are also integrated into other parts of the like pretty-printing and type printing the integrated into back traces so when you do a backtrace pretty printers recall take printers recalled so by default when you get a backtrace everything is on what you expect to see what you actually generally wanna see and then again if you want go to the next level down and see the lobby it's me all these features are disable so you just turn them off to get you know 1 of those massive suppose as they used to so here's a backtrace I edited down this is known a signal emission and you have so I I know show frame a but free made is a piece of my program that emits a signal and you have object then frame 7 2 1 RG lives implementation of signal emission and in frame 0 is the call back so if you're debugging your program and you see the stack trace you know you might you might seeing if we pretend that I remember to put training of you would see 9 frames that really about 2 of them a interesting at all the rest is just gobbledy-gook in particular you know 6 frames and you have almost activation that's also anyone see that if you're writing you but if you're just waiting for them to be you know you don't care this is just clutter and this goes back to that thing you wanna focus on the Fourier problem that you're interested in debugging you know you want to be able to filter out the stuff that is not very interesting so we we fill at a future last year called frame filters Frame filters so the activated by hoax the associated with your application if you're mountains and the disable they work with the command line interface and with the machine and office and what they would do is modify when more compute computing a backtrace and going to print the backtrace they let you mess around with what is going to be displayed so here's what looks like now there's frame 0 that's my call back the frames 7 and we change the name of France 7 it says the MIT signal the name of a signal on the object it's being emitted on and then in brackets there I think of the a class name of that particular object and then you can see the rest of the frames are indented in other says these frames util conceptually make up this phrase there about their implementation detail of this thing that
you might be more interested in now again you know you can turn this off Morgan on a feature so that only and do it in the 1st revision will
get added feature so that those kind of indented friends you can just make them go away entirely so here's traceable quite friend 0 4 and 7 frame a it From now what is this useful this is useful in lots of ways here's an example you know here's an example G with if you go look in and you have bugs illus codes in there and down but you know this is a case where you know you using some framework to frame which relatively complicated as some companies and using complicated things but you as a user of the framework you know there's a lot of it you don't really care about you wanna see the parts that are more interesting to know how it's implemented just like data structures are opaque you you want some aspects of the back traces values or so forth to be opaque on it's useful interpreted languages and if you do like a backtrace in Python area when GB has Python it now so we've back traces and we see a bunch of stuff from the Python interpreter you know nominally interesting but generally not relevant to me you know so you can write this kind of frame filter for an interpreted language in it can say instead of you knowing that signal whatever it could say Python method body but Python Ruby next was whatever and I'm sure you could think of other users form any questions about that right to I'm sorry can you add frames you cannot add trillions of there's 2 and that's a good question so there's and we're gonna talk a little bit about that energy stuff coming up this kind of two ideas behind frames 1 is to just make 1 up like when you're printing and have a sort of mean nothing alone and not be nothing but you're just come out of nowhere can't be done the day there was just 1 kind of internal limitations prevent us from doing that and we chose to should without restriction because the patch is already quite large and gone through 5 as review or whatever you know on that kind of restriction so they be lifted later you know it's it's always OK to like relax servers on it so that can't be done the other idea behind and you know making up a frame is integrated into the actual unwind it this is not an unwinding feature and it looks like 1 but what this is actually about is displayed no it's not that it's not built into the lowest levels of online like say we found this frame how we go to the next 1 will what registers to reward you know that kind of thing now that can be done the different way and that's something I want I think it's a and that Python that both you know it's not unreasonable to do that the senator question could yeah you but I did away from microphone I when you if you want and you know thank you for thank if the just about those you know functions you have to people but to the breakpoints reactant is sent to the kids when on the school Banky back in separate conditional breakpoint and that's where how did that work with that function pointers and you know when you have the structure is the when choosing the ones who did that and Wilkinson yeah that that works because of our you know when you're unwinding of the sort of there's no such thing as a function pointer so you just have a concrete functions on the stack of home so that certain issues that makes sense your G. this is 1 of those things that you know is that the program doesn't know GB knows how like computer stack-trace so in these functions using do you use knowledge the remove thank you our new or something tough to scan OK so as I on the local stuff when you have more now we talked about probes and poses are
something very cool on they came out of all the 1st time I heard of them was from do trace of system have implemented a on source compatible version of probes different from all of you know I think the implemented differently from the traces and don't don't be scared by system character of the problems themselves are not specific to system tap in fact graph G would seem intuitive all wrote the current probe implementation and they are on their masterpiece of health and GCC knowledge so they really just rely on some OWL features and the GCC features to work are implemented in a single header file well yeah there's an asterisk there's actually 2 about 1 that has a single before so you know I and the extremely low overhead extremely low a pro introduces 1 relocation Interior Interior library on any number of columns 1 relocation for all of them so you don't get to start time overhead is ridiculous I mean you can measure that the probe itself is a single no off in your program it doesn't get much cheaper than that and probes can have arguments and if you choose your arguments carefully you there's no penalty at all for that if you make sure that the arguments are alive at the point at which you insert the probe kabbalah doesn't have to do anything special and really a probe is just a single molecule overhead for computing and that's what that means is that you can use these probes in half functions so far similar ice features of problems and Morgan and I'm just going through like the wife and now talk about why this is interesting but coastal requiring the debugger info in a special section that goes right along with the program is not strip by strip and on what's interesting about problems is that there that you can name a spot in your program that doesn't change as you change your program you know if you respect sort of the meaning of the program on it can be in the middle of function so what that means is like suppose you're writing these Python scripts you you're adding new commands to g you to do things with your program anyone and commands that Inspector program what runs machine example that precede this vector program of ones but sometimes you know you wanna say I need to inspect the middle of this function that I wanna refactor this function for whatever reason there's always a reason won't you can stick a program point in there and the poem going let's let's you reliably find that spot in the middle function without messing up the program logic are having a hard code you know of a line number into your Python code which is inherently fragile the and then not requiring debugging info what's cool about Canada's on you can use this with production code you can extract these arguments on from the running program without requiring the divine Infoseek intuitive production and 1 way that we do this internally and you as we added probes to like the with GCC and wonder the what they're done wonders for part of the GCC where when you throw an exception it online Szostak looking for the place the catches the exception not previously a few years ago and GB if you were going through a program next next next next next next there were some function and that function throws an exception you just lose control because it didn't understand about exceptions and it didn't have any look into the so we added a probe interlude GCC In this talk was like right and that only a minor and then what we did is we changed you need to look up this problem and like if you look at the syntactic the stack of that's to provide a name that's the name of approach so it's the GCC the online problem in these arguments in this argument tells how out for OpenStack exceptions going and it's unit cells who did in the PC at which the job is gonna happen words jumping to the so what this does is it wants to use a golf when your next through code obstacle quickly on this problem and that way whenever an exception happens I get informed and I can decide what to do I can let it keep going for a considerably point at the handler and we gain control and so now the next thing in the presence of exceptions works exactly like you'd expect in the way we did it is this way and the reason we like this way is to the because you don't need debugger all you don't have to install with GCC devoted follow hope their distro build GCC with the body involved or anything like that of it lets you focus because if you install the GCC barrier info suddenly you're stepping into reduce see that all the scrappy or care about you know what I read the winder an hour and it just lets focus little better quality and butter continue to do its work so we've added a few more these probes there's a few more due to the users the some and you would see in the summer sensible plus in your uses them internally on to implement features you know kind of based about features but you can also just use them from the command line and can say you know break Dutch probe in the name of the problem which you run in full probes read off has some flag so you can don't have on back and then if you do and then thing is they do work system cap so you can also use them when in your system typescripts if you're debugging user user States processes assistant at the right and it's quite cool feature and honestly I was if someone had told me the constraints of on this project before I here and then past to implement I would fight quick jabs at this so I don't believe it was possible the rounded area at any questions about this yeah would but the inverse of that
number program that he so he that the program can introspect and see its own pros on a well I mean it could because it could open the file and you know like there's a a library without executable or wherever you can open it policy all find the sections titled added up you could do that there's no light can we do it and I think of you know like you the funky life you may be asking about like patches years to get pattern area or something like that profiling or care of yeah and it's strictly justice you GV is the chief it doesn't matter that a text segment is read-only GB still stick break points and writer all over stuff you know so for your own primarily the tricky and annual open that up necessary because of security so anyway it could be done sort of but not vision is not directly supported her there's no you know library for that I could not just on social profiling the birth now should also that we understand so you can also 1st to 1st knows about the interpreter OK for a yeah and if you you know by the way you work a distro of when you build GCC and you would see in the center suppose plus you should just make sure that the appropriate system typewriters installed it'll make the work better and make users happier and like I said the over as well a I or you shouldn't use of words full where pondering program I would be feasible to have 2 types of birds in 1 time which is under the control program for its own use and never typed full GP many I'm thinking in terms of the of 10 hour tracing logging on rocks right with notation the yeah I don't know all the that's I mean I don't see why not but that's outside my so thank you that I found a very small Our so next of the region and the JTI like it said just to becoming very common of
previously I think I mean I never tried it I've seen that doesn't work very well on if you worked at all so and there's 2 JGI snow 2 ways to teach Gv about your you know the compiler that's running inside of your program on 1 of the 1st 1 and maybe the most basic 1 is only you have your compiler inside of your program right and file in memory in the cell file can contain anything so we can have dwarf the debugger info to explain everything program how to unwind everything how to find a local variables filenames function is anything that you Boston represent and then the and you just you have a magic function this was implemented before we had system typos if we did today we just have a system tap probe for it but you just have a magic function in your program and once itself is in place in a you update some data structure and color function and you just has a breakpoint on this function G because we know this is the protocol and so GB we're program starts there GV goes and finds that elephants sucks all the data are creates its own data structures and continues on and then everything just works quite nice and I think it's used in the wilds of pheromone critically there's some of and paying for this but the problem with that is you know writing out of full often memory is little bit wacky you may know would be doing well you may want something a little slimmer the so there's also a GB plug-in approach in the plugin is just a shared library that GB knows how to load on 2 little manual right now like I said earlier it's not all title and so on it doesn't have all these nice properties that the Python of approaches tend to have but this plugin there's this pretty simple API can represent less information to GB but on the other hand it's code you wrote that runs inside the city and so on on it you know a little bit more about the program about and that way you have to go through all the effort of writing out an elephant dwarf if you're G. already has data structures in memory describing the program it it is reduced directly use those and that's something the future on their some patches pending to expand that to make it all no kernel we against quite simple there's only a few things you can tell Gv about these patches expand the range of what you can talk about negative useful of of the Python it's just that we so on our next I wanna show a demo and this is just to give you an idea of loan the the of stuff
GB can do you know kernel
why we are the travel registrar has said it's called and and so is the why Python you know like out of all the languages while the answer is I don't know G. take Python before I worked on GB of areas that I believe there was some kind of agreement that that was what the choice was up I implemented a good chunk of it but some you know what I like about a specifically is just that yet we have a window of it's not interesting at the bottom and this is just the
mountains and there a new what's nice about Python is on just that there's a library for everything you know
everything exists if you work in gestural and low there's a thousand Python packages and if you look on temporal wherever there's you know 20 Basilio or something like that of I think that's the exact on so while the point being that whatever you may think of Python as language is very pragmatic you can do anything with that you know that somebody is already got library
want so you can on you can make your debugging simpler without undue effort you know in in cases like this I really a fan of the sort of on quick and dirty hacks as opposed to well engineered cleaning acts because you know its face dividing isn't the only thing that you have to do is an important part of the development cycle but it's not the only part so what we have here is this is going to be an example of white people alive example of why Python is kind of fun so there we have g you were debugging GCC on were so let's see area word GCC's compiling this function on I'm sure you
all have minds still traps and see that this function doesn't actually do anything n because you know anyway so here we are we going forward burning GCC and we're in the middle of of you were actually in main I think yeah so then well reviewing the this is just some Python
code where we have on you
can see it is just a blank window but you know we imported Python gtk all we run it on a separate thread and pass messages back and forth to the command move on and then we continue and this is the control
flow graph of the function on and this is implemented in think less than 200 lines of Python home and what it does is it sets a bunch of breakpoints in GCC wherever it manipulates the control flow graph and at those points it pulls out the nodes and edges the control flow graph stops and into Python graph structure and then draws into this window and you know we may adopt it y you walk y you step so long
and the the it yeah so this
swimmers too small but object to the of the area close cleanup tree if
media and what that I think it's
about optimize the control flow graph I have that so you can see it's very reactive it as what is and this is like super basic you know you could do more to we still 51 and if this was interesting you know if it was something debugging a lot greater spending a lot of time a control flow graph what you know I don't know that much about GCC I certainly don't know anything about like Q decay or I graph like this Python graph and the and still this took me a couple hours to write something like that it's super induced of you know there's no reason that you shouldn't
here that all up optimize some audio GCC also knows that function does not Our that's all I got out any questions the yeah the
nothing you consider it so you can do this source window for the new system will that's like 10 minutes with a gtk text here it's due to the source here in it and you know there is a
tool which is cool the DDT DTD the GPS the animal could do use it because it's a graphical to so I will do it is to steal less interesting with what you propose is is something goes through can do you cannot do it or it is too bad because it was so there are you're asking if this is something of DG can do this sort could not address of the if DVD is obsolete while I mean the answer is yes but not for the reason you're thinking of the i th so we always have to tell you although uses DVD and doesn't use and I remember the machine interface so sorry about it the runs the CLI tries to parse the output but we never make any promises really about the CLI output even if your person this COI of what you're just setting yourself up for pain so occasionally people come and complain like you stop working this article not not not more M. Eisemann around 15 years or something there's no excuse now what's the at DDI know and it's cool you know what it does is called the what's cool about this is you know that window like just just picture for a minute if you would like you wanna do a graph display of a data structure in your program while you could add that it DGG requests a thing you could you could certainly added to anything because those really have the same information a G G B does but the difference there is on of 1 of say practicality right in Python I can write this really quickly in a couple hours on unless I was already an eclipse expert I don't believe I could do that clips a couple of hours you know of this just so much more Harry environment in indeed you know there's argument in the C code the and indeed he specifically trying to pass output a set of principles and it would the I will do that certainly now and I can do it in 2 hours the the point is you kind of have an extreme of customizability here but I know I want to talk about 1 other trees example aside use you get out to a huge cherry pie and you which is like this web server so all you know you can write a web interface and driver from your browser through it you what's easiest for you so cycling the previous question the the difference that strikes me between DDT and this is a DVD tried to do it generically linking it tried to figure out how to represent graphically Harchaoui deviated structures whereas is your expected that you could do that but you know the structure you can build something specific that on the other hand you don't get anything for free you have to write what you want well there's pros and cons that is true but like in this case the display part in all American show you are rolling 0 the code for that it's it's some call it I graphed please drop us now in and the mapping between GCC's structure diagram data structure just it's extremely trivial you know it's like all this is in no doubt node you know so yeah I mean I a certain would be interesting to try and do that with what you've done have some linear logic and you know you're unlikely structures the I certainly think that the interest you be interesting to say here you could abstract out right to say here some pretty can visualize rivers and they can work in the same way as all the other books you know that we have where they'd be associated with your application in some kind of registration processes on you could say show me a linked list indicated talk to your linked list abstractor thing the display you know that the interesting for me this is just around so you know not all I want to be a temporary good but you know I just put out there sort of a publication give you an idea of things you can do you know a in other questions what do we would you recommend using the GPU what I recommend you get some you know there's there's a lot of other things that are going of uh and also depends on what your needs are you know like if you like I eclipsed on there's Qt creators if you like something more minimal there's only number of OK developed either of tables from the library actually use that 1 of the dozens of pretty abbreviated and in red hats working on their own honest trimmed-down eclipse where it's just like a wrapper for the debugger for people who don't want the whole idea there's a project on the Eclipse Eclipse wiki they can follow from that if you're interested in but anyway that's a handful ones a it the and lots of questions thank you very much Tom O'Connor so that others have