Transcript for:
Overview and Introduction to RemedyBG Debugger

hey how's it going everyone um so my name is Jason and I just wanted to go through a uh quick application here that I really like and I just wanted to go through how to use it and some of the different features it has uh this is a debugger that you can use for Windows uh it's called remedy BG used for 64-bit Windows um it's basically an alternative to something like Visual Studio which I know is very popular and everyone uses um in my opinion the more that we try and get away from Microsoft tools the better so I um so I greatly appreciate works like this and I want to try and promote them and one way to do that I think is just to show you how to use it so that there's not much confusion whenever you download it if you do download it and decide to use the program now this is actually created by single developer uh and he's done a pretty good job with it uh the site that you can download this to buger at is is called uh you can see right here we have remedy bg. itch.io remedy BG so that will bring you to this page here you can see here it's $30 which in my opinion is nothing and should be uh you should be you should have no problem purchasing it for this price given what you're um the product you're given which is a very good debugger that's been pretty stable over the past year or so with Windows now the latest version is the 394 uh I currently I think I have this installed but I'm going to go show I'm going to go through here and actually just show you how to download it and install it basically once you purchase it you will have an option to go to the download page and you can see here's some past versions here that you can download I'm just going to go ahead and download the latest which is 394 and we click download boom it's in my downloads folder and here it is now the one of the beautiful things about it is this is it this is all that's involved in remedy BG so all you have to do to install this is to just place this XE wherever you want it so wherever you uh want this application to live so on my system I actually have it within my C drive so in order to show you that real quick uh let me open up where I have it installed I have it installed right here um like I said I already had the latest version installed but say I didn't say this wasn't here um I have these just for reference in case something goes wrong with the new version maybe there's a slight bug that's bothering me whatever um I have these previous versions that I can just go back and grab if I need to so that's not something you have to do that's just something I do that's why you see these different version numbers uh but basically so all you got to do is just copy and paste in here that's it it's installed so you can see this is already a way better process than something like Visual Studio where you have to do downloaded Installer app and then you have to wait for it to install and all these different components and blah blah blah blah blah this is really nice really simple uh and you can see I can just click it and Microsoft being annoying and it's open and we're good to go what I want to do now is actually go through and show you how to use this application so in order to do that I have a project already set up I have it here so you can see I just have a simple project we have a file which just holds our main function I have a build file and then we have our this is for 10x the 10x editor that I've been using and I really like it um so we'll open up our project here with this uh editor file and you can see we have our three files here and we have our main.c file um this just has some functions or I'm sorry some some structures and another helper macros and things like that just to go it's going to help me whenever I show you some of the features that we're going to do within remedy to to show them off so these are just some helper things for us um you can see I have a build file that's going to go ahead and build this program just a simple build file here uh we'll go over a little bit about it more in a moment all right so I can go ahead and build it and the application will now be within our bin folder okay so what we want to do is we're going to uh get the remedy set up so that we're able to step into our XE and debug so the first thing uh we want to do here is open up remedy I'm going to go to the command line and I have remedy already set up as uh in my path environment variable so all I have to do is type remedy bg. XE and it will open so we have our application here and the next thing we're going to do so we have a session uh the session tab here and this is what if you're familiar with debuggers at all you'll understand some of this stuff so we set the command which is basically the path to the executable so this is just telling the debugger what we want to run and have debug so we could click on the three dots here click on the bin folder and select our main application uh the working directory won't really matter for us today I'm not doing anything that's going to involve the working directory uh we'll just put a dot there um so once I do those two things I can then go to the source file and open the file that we want to debug so we're going to open our main file and we can set a breakpoint here and then I'll just hit F5 and you can see that we have now stepped into the program now the next thing we'll do is we'll just save a a session here so we'll just do a save as this is basically just a file that remedy will use to open back up and it'll have all your settings that you had prev previously before you closed remedy so if we had any breakpoints set or watch window items uh in there you know all that would be saved within this file um so we're just going to create a file here to be used later we'll just call it debug and it'll be debug. RBG and we'll save that so now that is our remedy file that we'll be using so we can see here we have that saved uh so basically now if I were to close remedy now uh you can see that if we just go back to our command line and then if I just type remedy and if I can pass it an argument so I can just pass that file as an argument to the XE on the command line and I can just hit enter and that'll open up that session file that we just saved so now this will have our session that was set up before as it was and then we can just again we can set a breakpoint and jump into it now we can also go in here you know we don't have to have an absolute path for the command once we save a session file so I can just put instead of this I can just say you know slash do meaning look in the current directory then find the bin folder then find a remain. XE so we don't have to have an absolute path in there I can save and you can see if I hit F5 we still are able to run so you know that's useful in case you're moving to different machines and you just want things to work uh you can just make these paths relative as well the next thing you'll see here actually so we'll remove this break point and the next thing we have is the normal entry point or entry point function the normal entry point if we just hover over here basically what this is referring to is if I didn't have a break point already set here to start on like I just did I could just hit F10 and remedy is going to find the main function and then just stop right before entering the main so you can see I have the wind main function here and then it just broke right on that wind main function so that's it does that because we have the normal entry point set and you can see that the entry point functions include window main main uh you know wind main CRT startup that kind of thing um that remedy will automatically look for when we hit F10 and want to just start at the beginning of our program now you can also select entry point function so it's slightly different um you know I can show an example of that if we select that and then I again hit F10 you'll notice that it breaks in the disassembly window now I believe this is because so with c you have the C run time which basically adds in some code that is going to run before the win main function is called so NC I believe it's it might be the wi main CRT startup is the name of the function I forget exactly off hand but basically the C library is being stepped into and called first that is actually the entry point of our program so the C library will be stepped into because again we selected entry point so it's the ACT actual entry point of this application um I think in the description for remedy it just describes it as whatever the entry point is listed in our XE file within the header of the XE file and again since the C run time inserts its own main to be called before our wind main that it's going to break into that so I believe that's what's happening here so it's breaking into wind Main and if we step through it's doing all some things here to set up the C environment and then eventually we would step through step through step through and we would get to our uh breakpoint here inside the actual main function um so that's what it's doing there and that's what those options mean here within the session uh the next thing here are the environment variables that you can set I'm not really going to go into too much detail here um there's basically some things you can set in here for example um I'm going to pull up the remedy help file um let's see if I can find find it uh so you can just see the description here is going to set envir variables used by the process um so one thing you can sent uh ass set is the node debug Heap so in general when Windows operating systems will enable What's called the debug Heap by default and this is basically just a separate Heap little memory area that has some extra debugging capabilities in it I think it's provided by the C runtime Library if I'm not mistaken um but it can actually make your program run slower just because there's that extra debug information in there to help you debug your um issues so remedy just disables it by default but you can enable it if you want to uh so you can set it to zero and you can set that in the environment variable here if you want to so it's stuff like that like I said I'm not going to go too much into it I don't use it much all right so that's basically uh just what I want to talk about with with this here there's really not much going on with it um but now we'll kind of get into some of the meteor stuff here so we can see that if I run my program actually before we do let's check out there's one other thing and again the help file mentions this we're just just so everyone's aware we can access the help file if we go to help and then we can click it here or we can just press F1 and that brings up the remedy help file now this is just going to describe basically everything you can do with remedy and it kind of lists everything here so I'm basically just going to go through and show you everything well most of the stuff there's some things that I just don't use very much I don't know if it's as important to go over um maybe it is down the line I'm just going to go over some of the more basic things some of the things I think that are going to be more immediately helpful as I go through this file uh but one of the initial things you can see here is it talks about your build file and the kind of options you want to make sure you have and you options you want to make sure are disabled so if we look at my build file currently within this project I'm building first with the Microsoft compiler so that's the CL here so when I run this batch file it's calling the Microsoft compiler and then passing in the compiler arguments now the compiler Flags you want to make sure you're using it here all right so if you look within our bin directory we can see our main. X we can see our pdb file that was created because I had this argument here I think I can also put uh z7 and that will also be in there so if I were actually to just remove Durbin so basically that is deleted now and I rebuild and we check our bin directory that file is still there right so there are options where this can actually just be embedded directly in the XE and that's why remedy says you got to make sure that you have this specified so that the pdb file gets uh its own separate file that is not embedded directly in the XE because that's what remedy uses to read the debugging information so that's one of the important things you want to make sure you have in there uh you also want to make sure that you don't have as part of your compiler Flags the JMC option uh this again is mentioned here in the remedy file um as far as the JMC I forget exactly what it is uh let's see when it's enabled it inserts calls to a helper function in function Pro so it basically inserts some information that screws remedy up a bit so you just want to make sure that you do not have this option enabled so we just you know we'll take it out of there and we should be good to go so you should make sure you don't not have that option either and then also you have your Linker Flags also just want to have you have this option here debug full I think I'm not sure if this is the default I think the default with Microsoft and I believe remedy mentions this um we'll see it here it's called Fast link yeah so uh yeah so the the compiler in the Microsoft comp will default to debug fast link and this needs to be changed to debug full so again this just means remedy with how it's built right now just can't handle the debug fast link for whatever reason so we just need to make sure we're passing the debug full argument uh when we're building our project so as long as you have those things specified in your build file you should be able to step into and run your program within remedy all right so one of the first things to realize when using remedy is uh once we so we'll just step into the program here the watch window you can basically put any sort of Expressions that you would put in any normal C program uh I think it mentions c99 in The Help file as far as valid Expressions that you can use I'm not sure if you can use anything that you could use with in program as far as what you can put in here but a lot of things you can just do in this uh watch window so for example we have this uh let me create another variable in my file here uh so we'll just say uh we have a float and we have a variable that holds the float and there's the float compile go to it all right so we have a variable and you can see the value right that's the value we set it to there's some extra garbage numbers because we didn't specify them here um but let's say that uh for whatever reason we don't want to view it as a float anymore we want to view it as an INT so in order to do that just like you would in a regular seat program you would just create a cast right so here we'll just create a cast in far and you you can see we get three so that's what I mean and that's what remedy means when it says you can do a lot of the Expressions that you would be able to do within a a valid c99 program um and then there are some special syntax things that you can do that is remedy BG specific as well that you can modify what you're looking at and I'll go ahead and I'll show you through uh some of that stuff here in a bit but I just wanted to mention that so you know you can do some useful things with that with your variables here in your watch window you can also specify the numeric literals uh slightly differently if you want to in here so if we have let's actually step through okay so we have an array right now right and we have that first one that's set to one let's say for whatever reason I want to multiply that by some value again I could just do say this and it'll give me 10 since it was a one but I could also let's say I want to multiply by a bigger number there you go what is that uh that's a million right one way to have to be able to tell easier that that is a million that you're putting you can do this in remedy right so you can have these little underscores it just makes it slightly easier to view exactly what kind of numbers you are using when you're doing these kind of multiplications and things in the expressions with inside the watch window so remedy allows that and they have a couple different ways uh that you can do that so you can do it that way uh I believe you can also do this so if you do the back tick that will also evaluate to um a million right so that separates those zeros there uh you can also do you can use that within a hexadecimal so you could say you know FF FF or whatever right so you can see we have these underscores listed and we're just multiplying it this is going to be some huge number right this is just to show that you can also use these underscores within a heximal value that you're using at the expression window so remedy allows all that kind of stuff within that um that's good to know going forward so you can see if I do some certain things within this watch window it's just because that's what remedy lets you do uh another quick note here is remedy allows you to specify the registers uh and see the register values as you go you can just actually just talk about them here so racks is a register within the x80 I'm sorry the x64 assembly instructions right so you have the racks register on these systems and remedy will just let you view the contents of that register so if I go ahead and hit start you can see the value that's currently in there uh gets changed as we move through the program and that's because that register is what's getting modified when you're actually running the program so remedy just gives you a quick way to view that register um I don't use these as much currently in my current day-to-day but you can imagine situations where you do want to view these in a simple an easy way and you can just list all the registers here and view their contents all right so the next thing we're going to look at is the relative Scopes so what I'm going to do actually is we're going to create a function now within our normal program actually we already have one here right so I have an add function so if we just say add fun uh three four right and then let's say outside here we had some Rand random variable for something else um just say it right and we'll go compile that if we go back to remedy all right so once I step into this function Remedy by default so in the watch window if we put X it'll show us the value of x because it's within that scope right we are currently in the ad function scope so the within the scope is the variables that are going to be viewable now what I was going to show you initially was we have the x value that we can view if I wanted to view the VAR variable right that's outside the scope of this current function you can see it says it's not found but remedy has a way to view it if you want while within another scope you can do it's going to be the bracket closing bracket right and you're just saying one you're saying look one level up to find this variable and display that value so if I hit enter you can see it actually will display that now so it's just looking one scope up from ad function and then it finds the variable and then it puts the value so this is pretty useful um you can even do something where you don't have to specify the number you can just put a star which is just telling remedy no matter how deep in the call stack you are so if you called this function you know a million times or if you had a of functions that you're calling one right after another and you're way down way down deep in the call stack and you have this variable that you still want to keep an eye on you would just put the star here and basically remedy just moves up the stack until it can find that variable and resolve it and it'll display that value here so that can be pretty useful for some things when you want to see the state of a variable uh maybe outside the current scope and just see how the values are changing uh one other thing to note here is you can also lock the scope at that variable when you're jumping into other functions so say I were to start here and we have that variable and we can see the value you see this little lock symbol here so if we go ahead and select that and then we step into the function you can see that that actually keeps its value so even though we're in a different scope I haven't specified anything here on the watch line uh to to say to you know look up and find this variable it's already been locked so now you can see that that value as you step through so that's just another way to kind of do that same thing um just to show you if I don't have it locked we have the variable I step in it goes away okay all right so now we'll move on to format specifiers now these are things that you can use within remedy to kind of display different values here uh that you want to maybe view your variable as so let me give you an example we have our variable okay right it's going to be 3223 three we have a way in remedy to say I want to view this as a binary number so you would just put a comma and then B so it's comma and then whatever the format uh specifier is hit enter and you can see now it's going to give us the actual binary value of 3223 so you can see right here here are the uh four bytes that are going to compromise or I'm sorry um that are going to make up this in variable and then we can see the values filled in here now we can also view it in hexadecimal with an X so that'll also give us the value in hexadecimal it just removes all the unnecessary zeros and just gives us what the actual value is so again this is representing the 3223 Now by default remedy list things as the decimal Valu so that you know if you want to specify it um explicitly you would put the D here um and then that's how you can see the decimal value now you can also do something like a capital x to have Capital hexadecimal and things like that um there's one other one that's more windows specific I won't worry about uh one other thing you can do with the format specifiers is you can specify count with them so if I go back to our program here and we're just going to have say a array of 10 items and we're just specify the first couple right whatever and we'll build that all right so if we go back to our program come through we have an array now let's get rid of this we'll write it again array right all right so you can see here with this array variable uh we have have the first couple numbers that are displayed and then it's just a bunch of zeros and if you click the arrow uh you can see you know the entire array all the values that are within that array so obviously we only specified the first three so you can see the first three here it knows the length that the array is is 10 so it's just going to give us the first 10 uh you know first values 10 values of this memory address which you know an array is just a memory address um if we close that up so what I was saying earlier is we can use those specifiers that we used before just like we did with the variable so I can again I can put an X here it's going to display all those values in hexadecimal and we can do the same with binary if we wanted to right now you can also specify account so let's say we only wanted to show let's say this array was a th000 elements long we only want to see the first 10 in this case let's say we only want to see the first four four so we would just put four and then now it'll only display the that first four elements of that array uh you can combine this with the specifiers so the way you do that is specifier first followed by the count so we want to view these in heximal and only view four of them and then there we go we can view the heximal values of those four uh variables within the array right uh and again you use any format specifier you could before okay all right so the next thing and this one's actually pretty cool uh this is actually just recently added in remedy and it has to do with link lists all right so uh in order to show you that link list thing I'm just going to create one real quick so we're just going to create a uh link list so with link list you know you have a node right uh we have a node and we have the value and then we have a list which create I'm sorry which holds the head or the first node of the list we have to do this because it's C right okay and then we are going to uh allocate some nodes so I actually have some code over here that I'm just going to copy and paste and here okay I just had to called something differently in the other thing okay all right so all we're doing right we're just allocating some nodes using Malik and then we're putting that into the list and the way we do that is just by pushing with the macros that's going to push it onto the head of the list one and then we'll have our length list right so we're just going to compile that and we're going to go here and we're going to break on that list all right so if we were to view this in the debugger we have our head right we have our next value so as we go on all right so we have node one is 23 so what we expect actually with this stack push is it's going to push things onto the front of the stack and then the rest of the nodes are going to be pushed back behind it so once we push uh one on there we'll view the head and we can see the first node is 23 now when I push the second node 556 so that is now the first one and the next one within the list is 23 so that's just how this one works and then if we push it again we have that one then that one and then that one now you can see with the link lists when you're trying to view it in a debugger normally these kind of get a little annoying right you have to keep opening up the next pointer looking at what's inside it then opening up the next one looking what's inside it right you have to keep like going down this this tree of nodes and that's not extremely helpful a lot of the times so what remedy does it actually gives you a way to view this in a in an array sort of format so let me show you what we're talking about here all right so if we're going to go back uh real quick just to we can make this easier to see uh I'm going to go to this list we're just going to put the value here instead no big deal uh we'll compile it all right so I go back and we're going to now specify the list and for this uh we're going to specify the head so that's the first element that we're going to be looking at in this list and then we're going to view each next pointer and we're going to view three of them okay so we'll hit that so what this does is as we step through okay so we have our values that are populated and we're going to push the first element onto the list now what you can see is right now how it should when using the syntax we can see we have the first element it's at index zero we push again now we have two elements right and we can view it in this sort of array like structure like we would with this so it's not like these tree of nodes that you have to sift through so this is actually really nice and we can see our values right here so right so we have the first value which is again this pushes as we push we're pushing the first one onto the head and then the next one gets pushed down so we can see our three values right here and we can see them all in a line so that is really nice uh it's a nice way to view list within remedy and again this is one of the newer features that was just released uh the version that we're using again is the 3.9.4 all right so the next thing uh we're going to do is strings so I'm just going to show you just some quick string views uh nothing too fancy here so basically if we have a simple string goodness my typing today all right all right so if we have a string okay go there have a string we'll view it in remedy we can see it's displaying it all here now if that string was a little bit longer blah blah blah blah blah right it's the long string come back you can see how it cuts it off here so remedy has a solution for that so if you want to make sure you're viewing the whole string uh we can specify with a format specifier St Str and you can see how it opens up this box to now view basically the entire string contents so this is just an easy way to um you know if you have a long string you can just view it all within the box here uh you can also do a quick specifier uh account here so you can display the number of characters you want so if we did actually there's no comma right so string 10 it's going to just display the 10 characters or 20 or you know however many you want and then I don't know if I mentioned this before you don't have to use a a number literal Within These names in the watch window you can use uh something here as well so basically if something is in scope you can use that variable as the count so I used VAR here just because I had a variable already obviously this is a lot of characters that I would be displaying but you can see how remedy takes that into account and uses that variable which is 3223 um to display the string characters so you know that's always possible as well all right so the next thing we'll do is I'm going to look at a few more format specifiers that you can use and we'll use our array as an example so we already have it here so I'm just going to run remedy again we have our array we'll just put it in the watch window Here Right add to watch and we have our array that has 10 elements now remedy has multiple different format specifiers I think they in the notes here it says that it's actually borrowed these format specifiers from wind dbg which is another Windows debugger it's a little more intense and thorough but they grabb some of these um these letters here from that debugger that you can also use in remedy to view the memory in different ways so if I wanted to I can say specifically okay let's look at the bite values of the array and we can also look at what the asky characters would be so I can do something like DB so what that's saying is uh basically we're going to view the bite values so you can see it's bundled it in these so this is all heximal so two heximal numbers equals one bite so each bite is displayed here separately right so that might be easy for you if if for some reason you want to view it that way right and then we can also view it as double word values so that's going to be 16bit or I'm sorry double word on a 64-bit machine is going to be 4 byte values so if I do DC we have four bytes right one two three four and then we have these four by chunks that we can display our values in right and then again we have with these specific specifi uh specifiers we have the um asky characters that are displayed now these particular specifiers are again notified within the notepad within the readme of Remedy so you can just go through and you can see what exactly they do so you can see we did the DB which just did the bite values and separated by bytes this again separates by double word values with the asky characters and you can see we can also use the DD now DD just removes the asky characters so if you don't care about the ask key it's not representing ask key you can just remove it just use the DD specifier and you get the same thing with the 4 byte at a time values that you can then view the other thing you can do with these specifiers is you can specify how many columns you actually want to look at at a time time so you can see we have four columns right now I think that's the default but if you do slash C and then you can say uh let's just look at two columns right it'll now split it into two columns for you and you can see that these bite addresses have adjusted as well so in you know we can actually look at it through these addresses eight bytes at a time if we wanted to because we can do you know we can also do instead of double word we can do quad word so basically on an x64 machine this will be one whole uh 8 by line and then we can just say one column and now we can view eight bytes at a time pretty easily right this makes a little simpler than trying to view it in a memory window where you know we got this line here and we don't necessarily see the individual addresses between each 8 by value on this at least it's not very easy to to make out whereas this way we can see each 8 by uh line and then we can see the value that's in that line so this can be useful for different things that you're trying to do with an array or something similar right um so again we have different uh other specifiers we can use so we could even say like binary values so we can display things in binary for one to two and again we can look at the columns now since it's binary we're just doing one bite at a time so we got the 80 81 82 83 and we're just viewing the bite values there so we can also do you know instead of just displaying all of these 4 byte values and displaying it all within the row here so you see how it can go down all the way it's going to display all 10 because we have 10 elements in the array let's say we only wanted to view three of them or something like that we can also specify N3 and then we'll just get three values that we can view instead of all 10 so again this can be helpful if you have a giant list of of elements in an array and you just want to view some portion of of that uh you can just you know view view however many you want by specifying the number and again you can also since we can just this is just an expression parser here we can just say if we wanted to look at the array plus however many maybe we don't want to look at the beginning of the array or somewhere in the middle we could do like a plus one and then basically we're looking at the next address as the start so the DF is actually looking at the 223 and then down so you know you can do little things like that as well to to again look at more in the middle of the array or somewhere else in the array that's not right at the start and you can specify how the amount you want to look at and that kind of thing so this is pretty useful and and I use this a lot now and it's it's really helpful with the programming workflow in my opinion all right so the next thing we'll look at is the Matrix format specifier uh so this can be used so if you have a matrix which you know is just going to hold a bunch of number here and this is one way to do a matrix right where you have a union and then you can view it either as a struct so you can do like the dot access um you know say I had a mate four and it was some Matrix and we could then later use that asxx and assign that to a certain number you know doxy you know that might be useful in some situations or we could specify it as an array element we can just say Okay I want to look at this part of the struct as an array format and then it can assign it that way right so that's just what this is doing um but you can see that with matrices in textbooks and and in general math equations you would see it kind of in this format right you would have a a sort of block structure that you could look at the values in rows and it just makes it more intuitive if you're able to view it that way so if we go down here and I just create a matrix so we just say make four Matrix right and then we just specify the identity Matrix right yeah all right all right so we have a matrix here uh okay can we do constant oh here we go and um I don't know do I need to do this whatever okay so we have a matrix so let's say we go to remedy and we go and try and view that Matrix here you know normal view would be something like this so you would have the Matrix and you can see everything's just kind of displayed in a in a row or I'm sorry in a in a straight column right like just like an array would be and that's not particularly helpful for matrices you know you like I said you typically want to view it in a sort of square pattern so with remedy you can do that so we can again use a format specifier with something that is a matrix that we want to view we would type MTX hit enter okay not MTX uh oh I think I have to do because I have yeah sorry since I have this elements array okay so you can take the Matrix and since we had it specified with float with these elements like that we just have to access that elements first and then tell remedy that's what you want to view as the Matrix type and then you can see now our value values are displayed in kind of the normal Matrix form that you're used to so this is pretty cool right if you want to do a lot of math operations and have a lot of matrices you're working with you can kind of view it and and reason about it the same way you would in a math textbook you can also take it and you can say you didn't want to look at it for whatever reason as a 4x4 Matrix maybe you just wanted to look at it as a 2X two you would just do something like that and then you can now view it as a 2 x two Matrix right so this this is pretty cool and like I said can be pretty useful depending on the context you're working in all right now the next thing we're going to look at this is kind of one of my favorite things actually is a table format specifier that you can use within remedy so we are going to use a different structure for this okay so what we're going to do so we have this uh wrect struct right it just holds the positions of a rectangle if we were to have a rectangle in our program okay sorry I just created an array here of just three rectangles so I just did it all in line here so we have three rectangles that's within this array so we'll go ahead and build and we'll check this out in remedy all right so we have our array okay we'll view in the window all right now we have our values now what you can do and this is a little bit more involved as far as the syntax is concerned I mean once you get the hang of it it's not a big deal but so in order to display this so you can see right now since this an array we're just displaying it 012 down down this column here so what might be more useful is to view this as a table and it'll be a named uh table with named columns so let me show you what that would look like so we can first we can specify a count so since this is a three element array we can say three so you want to do three elements in this table that we want to view I believe you can admit this you don't have to put it um but we'll just just put that here for now and then you're going to specify the parameters for the table so you're going to start with a brackets and then what you would do in order to name a column you're going to put the at symbol and we can say something like index so this is going to display the index of the table and then remedy has a built-in variable that you use to grab the index out of the array so you just put index remedy will resolve that so it's going to resolve the indexes zero down right um we can then display the next uh column name that we want to use that we want this to represent so we could say something like width so with this column we want to display the width of the rectangle now in our rect you know we have a width field so in order to grab that field out and display it what we use is the dollar sign and that's just going to tell remedy okay we're going to grab one of the elements within that array we're going to access the width field field of that array and that's it right we'll display the width and then we can also do the same thing with height height and then dollar sign height okay all right so once we hit enter we can see now what this does it gives us a table View and now we can view the index easily we can view the width more easily and the height more easily so if for some reason this is what we were interested in uh we have a much better way of looking at this and reasoning about kind of what's going on with this array and the rectangles inside it now again this is pretty cool and you can do different things with it so let's say that we wanted to uh see where the the right side of the rectangle is what what the point is the point position of the right side of the rectangle so we could just do something like okay we'll take the X position of each rectangle We'll add it to the Y so or to I'm sorry to the W so the width so we're going to take you know if for example this 100 add the width of 300 and then we get the point um that we're out at in space saying we're on some sort of grid right basically I'm just showing you that you can do little expressions like this to then show information if you want so we can just say um uh Max x max position hit enter and now that has evaluated here and now it displays within this table so again this will give us the max point of each rectangle right so you could do things like that with in here and again you can see it's a little weird at first but once you get the hang of it you understand that these at symbols these are the names of the columns and then the under underscore uncore index again is something that remedy recognizes so you just use that and that knows that it just displays the index values 01 2 uh in the array now again you can just like you would in C code if you wanted to view further down the array you can do an add there and you can also do an add here now this will view from one down right now we have the first index which is now since we added one is this rectangle forward right so we have um and I don't know why is it 233 that's probably just garbage I'm assuming but anyway so this this is now just going looking at the second element in the array and then down because we did this plus one so you can do things like that as well and you can see how we can view different elements if we want to and that's all really cool and like I said makes things a little easier for you as a developer to kind of see what's going on with your structures all right what else we have here so looking at the help file we can do disassembly format specifier so we can just take an ADD address and just specify the number of bytes we want to view and we tell remedy that we want to view this many bytes from this address and please uh display that and disassemble that and display that so what we could do is say you know so from this part in our program so let's say we put a breakpoint come down so the variable is basically near the top of our program here we give the address to that variable so that'll be the first address that we want to look at we type in dis ASM and then the number of bytes we want to view so let's just say 100 no did I spell it wrong yes I did uh dis ASM okay so you can see now it starts at this address in our call stack it goes down and now it it will tell us kind of this whole program the instructions that have been inserted for the assembly instruction instuctions for this program to run right so you can you can just view the disassembly really quick and easy by doing something like this right so that can be useful depending on the context you're working in so just wanted to show that real quick uh you can also just display so remedy has some built-in variables again you can look at the thread ID of the current thread you're on when you're running so if you have that uh money symbol tid so that's the the ID of a thread so you can see we're currently on the 17140 on this Windows system for a thread ID uh you can also look at something like the program ID if you wanted to right um so there's those different things you can use with that dollar symbol I believe I already showed the locals variable maybe I didn't um so again this is something else that's built into the remedy along with the pams okay so it's under _ params or underscore uncore locals and these can be viewed um so the locals is just going to hold all the local variables that within the scope so we have all the variables here so that's just a quick way to pull up all local variables and same thing with the parameters so the parameters that we are of the current function we're in are going to be displayed within this variable so those are quick ways to access that and other than that I think we're done with the specifiers and the different variables used by REM and now we'll go into just some of the things you can do with break points okay so with break points um you have some of the familiar things that if you're program for any length of time you've probably already used so you have uh let's take an example here let's say we have a break point that's set at this variable we can in remedy if we wanted to edit this break point and say we only wanted this to break on a certain condition so actually for this to work we'd have to do it here so variable is set to 3223 so let's say we only wanted this break point to break whenever that variable is 3223 in the condition we can put that variable's name so these remedy is going to resolve anything that's within scope so we can use the name that we have in our you know current function and we can use that as a condition and we can say if VAR equal uh 3223 okay if it does then it'll break so if I hit F5 you can see it's going to break there now let's say I stopped this went back to my uh program and we said instead I want it to be 100 then we go back and we run it nothing happens right because we don't stop on that break point it just goes through our program and ends so I would go back 3223 and now it stops on it because I changed it back to 3223 so remedy when you do things that way will keep that uh break point with that condition right so it has that condition in there so even AC cross runs it's gonna it's going to hold true okay so that's one of the things you can do uh the other thing is just a function breakpoint so you can set breakpoint on it when a specific function is hit so in order to do that you can we'll just do it we'll go to the so it's not running right now we can just go to the breakpoints window say new function breakpoint and we'll just add the function name we'll say add Funk let we won't have a condition here for now we'll just say just add it whenever add Funk is called go ahead and break so now if we hit and run you can see it broke on the ad function uh add Funk function right so that's simple enough right all right so the next thing we'll look at real quick here is the processor breakpoint from my understanding basically debuggers have the options to tell the CPU on a certain architecture so in this case the x64 um we can say whenever you're writing to this address whenever you see that please uh notify us so we can uh break the program at this point so if we were to set a break point here let's say and on that breakpoint actually so one other thing about the processor breakpoints is you'll notice if I go to try and add one when I'm not running rimidi uh I cannot right it's gray out I can't select that option so I have to first step into my program and now I don't know why it's saying that just bar whatever um okay so we're in the program and now I can left click and select new processor breakpoint so this is because you know whenever the the remedy doesn't know what the address of anything is going to be until your program is run um so once we run it we can now specify that we're going to have a variable of R and I want you to look at the address of that and so it's an INT variable so it's four bytes so it's just going to say the number of bytes we're looking at is the four bytes of that variable and if any of those four bytes are written to we want you to break right so if we hit okay we now have a proc a processor break point set so you can see I'm on printf if I hit F5 it now breaks here so it's going to break one line after because obviously this variable doesn't get set until after it's run so it's run it's set and then the program stops so that's what the processor breakpoint is saying it's just saying again we specified whenever those four bytes are written to which they were here any of those four bytes we want you to break so again you can do this with read and write so just reading from the variable um will also break the program and anytime that variable has been executed or something has been executed uh you can also break the program all right so that's a br processor breako okay so one of the last things we'll look at here is auto enabling breakpoints this feature was actually uh just added I think in 3.93 so what it allows you to do is have if you have multiple break points you can actually take a couple of those break points or whatever break points you want and child or add them to a parent breakpoint and then they will only enable if that parot breakpoint is hit so in order to make this a little more concrete I'm going to just create a quick sample uh within our file here and we'll go through that give me one sec though okay so real quick I just added a quick test process here that's just going to show us this feature I've been talking about um you'll notice I just have a simple function here called process and that's going to get um called within this Loop now let's just say we do this the traditional way and we go to our debugger and let's just say we for whatever reason want to break on this line within the function but let's say we only want it to break in this line every so often or if certain conditions are met this will not happen currently right because in this Loop process get run every time so if I hit F5 we hit the process function we come out F5 process come out F5 process come out right because we have uh 10 Loops that we're going through so that means that breako is going to get hit every time so the difference that I was going to say so let's say we only wanted to run into this function run into that break point whenever we have a special trigger some random thing that gets triggered within our debugger so in this case I put the variable special trigger you know this is just some arbitrary thing we're just putting in place of anything more complex right now so we're going to say whenever the special trigger is actually hit whenever this breakpoint gets hit then we want to enable this one so in order to do that let me just remove both break points so that I know which one's which so we'll set this one so this will be our parent breakpoint and then we'll set this one so again we only want this break point to run whenever the special trigger gets hit and basically that only happens when I equals 3 so we're going to take the breako here which is this one control shift click and we're going to you see we just made it a child of the special trigger break point so what this will do is if I run we actually got a break here at the special trigger which means I is three and you'll see that also enabled this break point now so if I is three that means that this function was run a couple times already before this got hit so this break point was never hit right now we just hit this break point here for special trigger so if I do hit F5 now it will now break on this break point so again that can be pretty useful uh for certain situations you'll know it kind of when you come across situation that this might be useful for so like I said this is just a quick example to show you kind of how it works but again that that is that is something that's nice to have because like I said we don't always want maybe our break points to run through an entire four Loop for every part of the loop or whatever or we only want them to run whenever a certain condition has been met so we can do that now with remedy with these paring and child break points all right so that that's basically it that's there's a couple other things that might be in the help sheet here that you know you might want to look at I didn't quite go over everything but I gave you a pretty good overview and I think from now from this point forward you should be able to figure out anything else you want to look at as new versions come out you should be able to look at the help file here see any additions and then go from there all right so that's about all I wanted to show you guys today so again this is remedy BG developed by a single developer and he actually has a Discord channel so if you want to ask questions and and that kind of thing and have a community help you if you go to Discord it's actually within the handmade Network Discord Channel and then it's just a project located uh so it's under projects and there's the thread for remedy BG so the guy's name is well the username is x13 pixels I actually forget his real name so sorry for that um but he's he's a really nice guy and he answers basically any question you have here and if not we also have community members that will that will help you out as well well so I hope you learn something today uh and have a good one