Home
"user manual"
Contents
1. Now we are able to click the Add button and say we want to monitor x Pointless agreed but it will show you how it s done Please enter the new watch keyword Select okl when you re done Edit debugger watches keyword Format Undefined Decimal Unsigned C Hexadecimal Binary Character 0 Floating point Array E Watch as array Start 0 Count p a Function Arguments No arguments 6 Using NED to track down novice errors NED the Novice Errors Detector web application has a double objective Allow students to run a few analyzers on their program to warn them about potential errors Run the compiler on their programs with a set of options making it more likely to warn them about anything even remotely suspicious Provide students with tutorials on the most difficult to understand messages to help them understand their meaning amp determine whether or not the warnings apply to their programs The web application may be accessed via a web browser or invoked directly from within your IDE Using NED from Code Blocks You may apply NED on the files in your current project by going in the Tools menu then selecting Debug wxSmith Tools Plugins Settings Valgrind Help Detect Novice Errors or Z PEELA Prepare Submission _ROWS NB_COLS void Configure tools include lt stdio h gt include estdlib he When you do so a Firefox wind
2. When you update software you will be prompted for the administrative password It is the same as your login password The process will require you to be on the internet for the entire duration of the update 5 Shutting down your virtual appliance When you are done working with your virtual appliance you should shut it down There are different ways to shut it down Shutdown from within Ubuntu Linux Use the gear icon located at the top right corner of your Linux desktop When you click it you will be offered several options select eas ss Ty 4 4 34AM S amp B studentuser G System Settings Displays Startup Applications Updates Available Printers Lock Screen Log Out Shut Down Shutdown from virtual box If you attempt to close the window in which your virtual machine runs you will be offered 3 options You want to O Save the machine state Send the shutdown signal WF Power off the machine a The option will allow you to let the virtual machine handle a proper shutdown The option will shutdown the virtual machine without giving the guest OS an opportunity to handle it Save this option for a situation where the guest OS is no longer responding as it might result in damage to the files on your virtual disk Hibernate from Virtual Box The Save the machine state option is equivalent to hibernating The machine will save its state before to shut down When yo
3. Here you will find links to VirtualBox binaries and its source code ou Screenshots VirtualBox binaries R E ER Downloads By downloading you agree to the terms and conditions of the respective license Documentation ee e VirtualBox platform packages The binaries are released under the terms of the GPL version 2 End user docs o VirtualBox 4 1 2 for Windows hosts x86 amd64 o VirtualBox 4 1 2 for OS X hosts gt x86 amd64 Technical docs fs o VirtualBox 4 1 2 for Linux hosts Contribute i o VirtualBox 4 1 2 for Solaris hosts gt x86 amd64 Community upport for 0 devices VirtualBox an oot for Intel cards See this chapter from the User Manual for an introduction to this Extension Pack The Extension Pack binaries are released under the VirtualBox Personal Use and Evaluation License PUEL Please install the extension pack with the same version as your installed version of VirtualBox If you are using VirtualBox 4 0 12 please download the extension pack gt here VirtualBox 4 1 2 Software Developer Kit SDK All platforms See the changelog for what has changed _ You might want to compare the e SHA256 checksums or the e MDS checksums to verify the integrity of downloaded packages Note After upgrading VirtualBox it is recommended to upgrade the guest additions as well User Manual The VirtualRay Llcar Manual ic includad in the VirtualRoy hinariac ahowe If however sou would like ta take
4. http subversion apache org http git scm com http bazaar canonical com en http www fossil scm org index html doc trunk www index wiki http www splint org http cppcheck sourceforge net
5. a debugger you need to have an idea of where things are going wrong in your program The best way to do this is to put a breakpoint so that when you run your program with the debugger execution will pause at that line in the code Select a line of code and use Debug gt Toggle Breakpoint to set or unset a breakpoint at this line You may also use the F5 shortcut instead Notice the red dot on the break point line below J main c HellowWorld CodeBlocks 10 05 A peo s pe gt Samy File Edit View Search Project Build Debug weSmith Tools Plugins Settings Help include lt stdio h gt eG Workspace include lt stdlib_h gt HellowWorld El void flint data print The value of x is d n data int maini Bil z int x 42 printf Hello world n Eix return Debugger finished with status 0 Command CA Usersalessio Desktop Hello WINDOWS 1252 Line 11 Column 2 default Now we may run our program with the debugger by selecting Debug 7 Start A popup will inform you that the IDE will now display your project in Debug Mode The the program will start executing until it reaches your breakpoint The display Console will be blank since we inserted a breakpoint before any of our printf Meanwhile the IDE window will mark that we are at the break point with a right pointing triangle f main c HellowWorld Code Blocks 10 05 gt ee g Erm File Edit V
6. a lonk at it without havina to inctall tha Make a note of where the resulting file was downloaded 3 Run the Virtual Box installer We are going to install the Virtual Box virtualization software on our host OS Locate the Virtual Box installer file you downloaded in the previous section Open a file navigation window on your host OS and double click the file to execute it The Virtual Box s setup wizard will start We will accept the default options until the last screens During this setup additional network adapters will be added to your host OS The whole process will take some time When the installation is finished you will be offered the option to run Virtual Box Do not run it yet we still have to install the extensions You will then be prompted to reboot your machine always do so If you do not the next installation steps will not work properly 4 Install the Virtual Box extension pack Virtual Box Extensions are add ons that provide the capacity to share clipboards between the host and guest OS share printing and limited network sharing These elements are not required to operate a virtual machine however these features make it easier to interact with the CLUE Virtual appliance Start the Virtual Box software The Virtual Box main interface will open It should be very similar to the one in the screenshot below 8 Oracle VM VirtualBox Manager File Machine Help E o F n P i
7. help you understand the requirements amp develop your own comprehensive suite of tests In order to run the functions you implemented to solve the problem at hand against the instructor s tests you need to use the drop down menu labeled Build Target It is generally located toward the top right of the IDE window A oeio ch gt amp Build target validate my tests validate my solution ROWS NB COLS int test Select Vvalidate my solution from the drop down menu then Build gt aid The tests you developed in your project will be set aside amp replaced by the instructor s The output produced by running your functions against these tests will be displayed This form of validation will provide you with partial hints as to what your own tests should be doing This in turn will shed some light on the requirements amp the correctness of your solutions Validating your solution against the instructor s tests Similarly you may select the Vvalidate my tests build target then Build gt Build in order to run your tests against the instructor s solution This form of validation will provide you with an idea of whether some of your tests are incorrect If one of your test fails with the instructor s solution make sure to email immediately to rule out the possibility of your test being based on an inaccurate understanding of the requirements 8 Preparing your submissions Another tool has been added to yo
8. this is your only file in the project A T reir anm zm pan mm Sree ee tee to mehana E7 Tan l Each tutorial will have a mini survey at the bottom of its page allowing students to let us know whether it was useful or not This feedback is important to help us improve tutorials during the semester so they may be more useful Was this tutorial useful Your feedback is essential in helping us identity both the tutorials which need improvement amp the tutorials which we should be using as models So please take a second to let us know whether this tutorial was useful to you Yes this tutorial was helpful to me e No this tutorial was not helpful to me Don t hesitate to Drop us an email to let us know in more details how we may improve this tutorial You may even attach your file or provide screenshots to supplement your explanation Some warnings do not have yet a tutorial However if you have trouble with them you will find a button which will allow you to inform the authors you could have used a tutorial to help you with this error message Our goal is not to provide tutorials on warnings or error messages which are trivial to understand but rather identify the ones which our students struggle to find useful so we may attempt to explain them better To this end your feedback is essential in helping us identify both missing tutorials amp those which are useful as is or need improvement What does it mean to validate y
9. 12 for Oc N baii EA n alate eee Tate 3 Vetem 4 17 for Lie howe Eonia a risali 4 1 for Bolara heis rii ei Commune a Virtuailion 401 7 Orada YH irus atermin Fi mapai for Li 7 0 nn tual OF acd Pt Il Exteraean Pork The Eaten Pack beri ore melee esa ee pa ee a ere ha Gee TT ever feat cers Ga Bare a mam Ha ar Hana Fer aan viet ba E and Evian Lorene P ue AY pay Sa de Pa a ie a Vin aiiog 4 1 7 fodiens Darp Bit Sie Al platforms Tea he chargais for whak has chumps Wa mehi wank boa compara the A Pei cr Ete a cika ci Wipidraskai iuba iri L LE T hee After following these steps you should have the installer on your disk as an executable file Make a note of the location where it was downloaded since we will need to find it and execute it later 2 Download the Virtual Box Extension Pack In addition to the Virtual Box installer we are going to download the Oracle VM virtualbox Extension Pack which will provide additional features facilitating the integration of the virtual machines running inside Virtual Box with our host OS Use the All platforms link to download the extension pack Firefox 7 W Downloads VirtualBox j ul virtualbox org https www virtualbox org wiki Downloads wie 9 VirtualBox Most Visited _ Getting Started gt Latest Headlines amp Roboform Search amp Logins V3 passcards mcdermm E Save Generate Login Settings Register Help Guide Pe
10. B v2 12 04 student Settings General Shared Folders System Display Storage Folders List Mame Path Auto Mount Access Machine Folders id Audio SLE C Users alessio Desktop SLB Network Transient Folders Serial Ports USE Shared Folders Lists all shared folders accessible to this machine Use net use x Wwboxsvrishare to access a shared folder named share from a DOS ike OS or mount t vboxsf share mount_point to access it from a Linux OS This feature requires Guest Additions Close the settings dialog box by using the button amp restart your virtual machine The folder will be mounted automatically Accessing the shared folder from the guest OS Because you need administrator access to copy files to it we suggest you open a file browser in Ubuntu with such privileges when you have to exchange files y This may be done by opening a terminal window using the terminal icon on the left launcher bar In the new window type the following gksudo nautilus amp You will be prompted to enter your password A new file explorer window will then open which will be able to enter the shared folder In the Ubuntu Linux virtual machine this folder will be accessible under the name media sf_SLB which you may reach by Selecting on the left panel Selecting folder Selecting sf _SLB folder 9 Troubleshooting Screen doesn t resize If you resize the virtual box window t
11. B w F A 8 Details Snapshots New Settings Start Discard Welcome to VirtualBox The left part of this window is a list of all virtual machines on your computer The list is empty now because you haven t created any virtual machines yet _ In order to create a new virtual machine press the New button in the main tool bar located at the top of the window You can press the Fi key to get instant help or visit www virtualbox org for the latest information and news Go in the menu select the option The following panel will open fal Oo VirtualBox Settings i eS Default Machine Folder C U erm VirtualBox VMs Language vVRDP Authentication Library E VBoxAuth P Network lt gt Extensions Proxy Select a settings catagory from the list on the left hand side and move the mouse over a settings item to get more Select the option from the left panel The main panel will show an empty list of installed extensions a Locate the following icon to the right of the list SS A file selection dialog box will open Navigate your file system to select the extension file you downloaded in previous section A dialog box will prompt you to start the installation select Install GP VirtualBox Questio You are about to install a VirtualBox extension pack Extension packs complement the functionality of VirtualBox and can contain system level software that could be potentially harmful to y
12. Student Linux Box SLB User Guide CEReAL Computing Education Research amp Adult Learning http CEReAL forest usf edu Disclaimer This material is based in part upon work supported by the National Science Foundation under award number 0836863 Any opinions findings and conclusions or recommendations expressed in this publication are those of the author s and do not necessarily reflect the views of the National Science Foundation Table of Contents DAMON OP COEN asec ose E E E E A E 2 Proda UO E E ieee 4 E ONT E E patch E E E E 4 2 TOO y e a AE E A E E 4 Os Regured Hardware SOM ANC essnee ina Eaa EE E E a eE 5 alne vea IB OX e a ade cities ctonae oe Ue acta ane y ewiiten cteaaion 6 1 Downloading the Virtual Box installer file eecccccccceeceeeeeeeseeeceeeeeeaeeeeeees 6 2 Download the Virtual Box Extension Pack cccccccseesseecececeeeeeeeseseceeeeeeeaaeeeeees 7 3 R n The Virtual Box TSANG sssrin snoei E eeni 8 4 Tostal tine Vitrual Box extension ae Kehoe seessaed atten accesses ul iatecaeysegesalahieeneenysdatiaes 8 Installing the SLB Virt al Applian ssscciesscsscavarssnersencnnesnecsonesmsnesinanerersecqunneneieacrerecamentaces 12 1 Download the SLB virtual appliance eee cccccccccesseseeseeeeeeeeaaeeeeeeceeeeeeeaaeenees 12 2 Importing the SLB virtual Appliance cece ccccccssesssseeeccceeeeeeesseeeeecceeesaeeesees 12 3 Login into your virtual appliance cececeeeccccececeee
13. Workspace o PA303 Sources D main c int main ij HH printf Hello world n return 1 2 3 4 5 6 7 B j CACLUE Assigr WINDOWS 1252 Line 1 Column 1 T default Compiling and Executing a project In order to run your program you must build it This entails compiling each of the c source files which are part of your project linking them together along with any needed library with a tool named the linker Refer to the first module s videos lectures for more information about this whole process You will achieve this by using the Build gt Build menu or the Ctrl F9 shortcut The Build log tab in the bottom panel will show you any potential errors Code Blocks Q Search results Build log x Build messages Debugger Compiling main c Linking console executable bin Debug PASOS exe Output size is 25 28 KB Process terminated vith status 0 0 minutes 1 seconds errors warnings S main c WINDOW S 1252 When your project is built you may run it with Build gt Run or Ctrl F10 shortcut The interaction with your program will take place in DOS text Console window which will prompt you to press any key before to close when your program is done executing a CA Users alessio Desktop PA303 P4303 bin Debug PA303 exe Hello world Process returned thxi execution time Press any key to continue 5 Debugging with Code Blocks IDE One of t
14. ccssssessseceeeceeeeeeseeeeeeeeeeeeeeeeeees 22 3 Working on prepared projects with the Code Blocks IDE ccceeeeeeees Z2 St ane BIO ES e ee cana tbeestians E E S 22 Compiling Building Running your projects ccccccccccessseseseececeeeecaeeeseeeceeeeeeeaas 23 4 Developing your own projects with Code Blocks IDE 2 0 ccccccccceeeeeeeeees 23 Pie amd TC W JOGO ICCE e arsaa teat tue A 23 Compiling and Executing a project ccccccccccccssssesseeeeceeeeeeeeeeseecceeeeeeeaeaeseeeeeeeeeeaaas 30 5 Debugging with Code Blocks IDE cc ccccccccccccceseseeseeceeeeeeaaeesseeeeeeeeseaaeeeeees 51 8 Preparing your program to be ran with the debugger cccceceeeeeeceeeeeeeeeeeeeeeeees 31 CHINO Break PONS arrra A E A 32 Stepping throush your Prostas se cossrein rai a a a eieerencediee 34 Inspecting Variables Values on the g0 nessssssssseersssssssserssssssssseeresssssssseeersssssssees 37 Using NED 16 track down NOVICE Erfors sersisoisanasiennsr a ESS 4 Using NED from Code BIOCKS siacissssusedavinutiaxetintdsnbahedssent taxeieondiabdarvaiaroebadarvantiaxiihs 42 Using NED Tron a DrOW SEM rerema sien cadndimeseniashcatvasacsnieeetadien 42 US OES ie DO GUS ea cris netenice E E E 43 What does it mean to validate your program with NED 00 eeecceeceeeceeeeeeeeeees 45 Validating your tests amp solutionSs sssseeeeesssssssseeresssssssscerresssssseseeersssssssseeeressss 45 Validating your solut
15. e you haven t created any virtual machines Y Exit Ctrl Q t In order to create a new virtual machine press the New button by _ in the main tool bar located at the top of the window T gt Y f rm A You can press the F1 key to get instant help or visit www virtualbox org for the latest information and news Import an appliance into VirtualBox The import wizard window will open allow you to navigate your file system to select the SLB virtual appliance file you previously downloaded The setup of the virtual appliance will then be displayed select Import to proceed with installing it in Virtual Box The import should take a few minutes after which the Virtual Box main window will show your new virtual machine listed in the left panel You are now ready to start the SLB virtual appliance 3 Login into your virtual appliance As you start the virtual appliance you will be shortly student user prompted to login with a specific account Simply click on the Student user account to begin the login process Password You will now be asked for your password which is the same Guest Session as your login name student 4 Updating Ubuntu Linux As you work with your Ubuntu Linux environment you will occasionally be prompted to update software Feel free to update any amp all of the available software but make sure to take a snapshot of the virtual machine before hand see section on snapshots below
16. eeseeeccceeeeaaeesseeeeeeeeeeeaeensees 13 A at UD ntu LINUX ceeseeeensccicsoamaieecetcacceoansuiaceeaneaesencrneusanceueomiadieaedeees nese 13 5 Shutting down your virtual appliance cece ccccccccccsseseeeeeeeeeeeeeeeeseeseeeeeeeeaeeesees 13 Shutdown from within Ubuntu Linux cccecccceccceeceeeeseeseeceeeeeeaaeaeeeseceeeeeeaaas 13 SS UITO Wi Tron vinal DOX erered E E lost ouenseasieadannesueatensdrete 13 Hibernate irom Vittal BOX serii E Ea 14 6 Taking amp Restoring Snapshots cccssesesececeececeeeeeseeeeceeeeeeaaeesseeeeeeeeeeaaeeesees 14 VY Wy Tae SASOS a E E 14 How totakea snapshot iecc cassoeasstanenccndaciuncigeredoatsdienndtenneccdbustinestsaedincttitieestianencsitts 15 How touse Saps MOUS erer ee E neces voees 16 7s Installing ihe guest addiUons eersersinie enn aE EEES 16 8 Sharing folders with the host OS c ccc cccccccccssssesseeeeeeeceeaeeseeeeeeeeeseeeseeeseeeeeeaaas 17 Preparing the virtual machine for Sharing cccccccccccssseeeseececeeeeaeeeeseeceeeeeeeeeees 17 Accessing the shared folder from the guest OS 0 0 0 ccceesssecceeecceeeeeeseeeceeeeeeeeeeees 19 Me POU Ie SOOT ae sae os E E E E E 20 E OS FC S17 E soscoueasaisesetanecnucaesatenetsoseouesdensedetanncnuceenatences 20 SLB to kean Pro rani is cosusenictenasvecenvat anan n a S e E TEE EEEE 21 Mi CANS S OV N aa coe nent ectec esos oancea ee E E E E S AE 21 2 Accessing the available study material ccccccc
17. en you are done selecting all the files in your project use the Analyze button to upload them to our server amp have them analyzed The report page you will get in return is the same as the one you would get by using NED from within the IDE Using the reports When warnings are available from any of the tools NED displays a green View button in front of them Compilation Warnings splint cppcheck CLUE Uploaded Files Results Meremees Mmain c 4 6 Function exported but not used outside main SsomeFunction main c 6 1 Definition of SomeFunction Using this button will open the tutorial page on this specific warning V arming Function should not be exported What does this error warning mean You have a non static function defined in a file This entails it might be used from another file However no other files are using it Troubleshooting Finding the problem The analyzer will refer you to the function Fixing the problem Adding the static keyword in front of the function s definition will solve the problem If you are uploading a single file to be validated you will get this error for defined function This is simply due to the fact the analyzer was working only on your file amp therefore assumed no other files were using the function if it s true in your project folder Examples splint fn exports 1 c Download Analyze 1 J All functions not used in other files should be static aa Tt s silly if
18. g Running your projects Open any of the PAs provided in the My Program Design folder on your desktop In order to run your program you must build it This entails compiling each of the c source files which are part of your project linking them together along with any needed library with a tool named the linker Werecommend you compile c files individually by double clicking them in the left panel list then using the menu Build 2 Compile current file This allows you to see the error amp warnings reported by the compiler in the log window at the bottom Make sure you address all the warnings errors for each file before to go to the next step When your individual files are compiling use the Build 2 Build menu option to generate the executable file You might find some more warnings or errors during this process Address them all When your project is built you may run it with Build gt Run The interaction with your program will take place in a text window which will prompt you to press any key before to close when your program is done executing 4 Developing your own projects with Code Blocks IDE In addition to working on the projects already provided to you in this SLB you might want to implement from scratch new projects to learn by playing with the language or simply to work on practice exercises This section guides you through such a project Preparing a new project Let us prepare a new project by navigati
19. he benefits of using Code Block is that you are able to execute step by step a program and display the value of key variables at each step However keep in mind you would be able to do the same thing by adding a few instructions to display the values of these same variables as your program execute So again make sure you do not spend hours learning to use the debugger when you should be instead learning to program Preparing your program to be ran with the debugger For the sake of demonstrating how the debugger works we are going to use a simple Hello World program i Ha main c PA303 Code Blocks E x File Edit Miew Search Project Build Debug weSmith Tools Plugins Settings Help include lt stdio h gt ee Workspace finclude lt stdlib h gt i PA303 printf Hello world n return 1 2 3 4 5 6 7 8 i Logs amp others J Code Blocks C Search results Build Debug in PA303 Target ia up to date Nothing to be done CACLUE Assignments PA30F WINDOWS 1252 Line 9 Column 1 As you may notice in the above screenshot the project is already built and ready to execute You may not debug any project which is not already building properly amp executing If you project produces bad results or crashes while running it s ok This is why we are going to troubleshoot it But a debugger won t be able to help with syntax errors Setting up BreakPoints When you use
20. he guest OS should adapt immediately the resolution to fit available screen real estate If it doesn t modify its size to force a refresh e g maximize the window This is likely to happen if you start the virtual machine with a maximized window if you resume it from hibernation or if you are on the login screen For the latter situation you will have to wait to be logged in to be able to modify the resolution SLB to learn C Programming In this section we will walk through using the Student Linux Box features which are relevant to Program Design 1 Features overview The initial motivation for this virtual appliance was to make easily accessible to our students a few tools specifically meant to simplify the learning of the C programming language For more details please refer to the project s home pages http CEReAL forest usf edu clue http clue ide sourceforge net http sourceforge net projects clue ide As this virtual appliance was initially developed to improve support for the learning of this programming language most of the available features to date are as follows The Code Blocks IDE which we have been using for years with Program Design students It is simpler to use than other industry standard IDEs so it doesn t get in the way of your learning while still providing relevant features syntax coloring debugger build Integration in the IDE of the NED Novice Error Detector web ap
21. iew Search Project Build Debug weSmith Tools Plugins Settings Help a Q Workspace Cl void f int data 5 49 HellowWorld a printf The value of x is fbdin dataj printf Hello world n z E x Debugger name and version GHU gdb GDB F Z Child process PID 5476 At C Users alessio Desktop HelloWorld HellowWorld main c lz K CA Usersalessio Desktop Hello WINDOWS 1252 Line 13 Column 1 Read Write default Stepping through your programs Right now we might just select Debug gt Continue and the debugger would just run until the program is done Generally though we don t want to do this We want to step line per line throught the program There are two ways of stepping Next Line or Next Instruction will do pretty much what it sounds it d do Here is the result after using it twice File Edit View Search Project Build Debug wxSmith Tools Plugins Settings Help eG Workspace Elwoid f int data HellowWorld printf The value of x is fbdin dataj I int maini int x 42 printf Hello world n Eix return O Debugger name and version GHU gdb GDB F Z Child procesas PID 5476 At C Users alessio Desktop HelloWorld Hellownorld main c l At C U0serasalessioiDesktopHelloWorid HellowHWorldimain c 14 At C Users alessio 7 Desktop HelloWorld HellowWorldmain ciise WINDOWS 1252 Line 16 Column 1 Read Write default y No
22. ion against the instructor s tests sssesssseoeeesesssssseeerrssss 45 Validating your solution against the instructor s tests essssssseoeeeessssssseeerrssss 45 Prepariney OUr SUDINISSLONG ia A 46 i Oer too aaa a a a a a O ew eee 46 Introduction 1 Overview This guide is intended for students who plan on using the Linux virtual appliance we are making available to support learning of specific topics in our Information Technology Department It will provide you with instructions on how to install the necessary software deploy the virtual appliance amp use the tools we have pre installed on it for you 2 Terminology Virtualization tools uses a few key terms which we will define before we begin our installation The Host Operating System Host OS is the operating system which is installed on your physical machine You will need a recent version of Linux Windows or MacOSX which is able to run the virtualization software specified below The virtualization software also referred to as hypervisor is the software which runs on your host operating system and simulates a virtual machine s hardware The specific virtualization software we will be using is the open source Virtual Box https www virtualbox org The Guest Operating System Guest OS is the operating system that runs inside the virtual machine We use Ubuntu Linux as the operating system running the Linux virtual appliance you will be usi
23. is the same with our SLB but the paths will be different Console application Please select the folder where you want the new project Ei Console esee fode ahere Project tite PASOS Folder to create projectin lt C Wsers alessio Desktop PA303 PA303 cbp Resulting filename C Users alessio Desktop PA303 PA303 PA303 chp By default Code Block will be ready to compile two versions of your project The Debug version is the one yov ll work with troubleshoot and then submit The Release one won t be something we ll even use in this offering Please select the compiler to use and which configurations you want enabled in your project Create Debug configuration Deb ug Debug options Objects output dir obj Debug V Create Release configuration Release Release options Output dir bin Release Objects output dir obj Release OOO O O i When you click Finishl you Il be back to the main window with a brand new project opened for you File Edit View Search Project Build Debug wxSmith Tools Plugins Settings Help AT e381 OA Sh Oo Oats occ HD Welcome to Cc default If you open the Sources tree on the left panel you will find a main c already there for you Ho main c PA30 File Edit View Search Project Build Debug wxSmith Tools Plugins Settings Help AFB EEl t FX MAAR SP GOB oudteroet Dew gt include lt stdio_h gt include lt stdlib_h gt a
24. l our variables monitoring by selecting Debug gt gt Watches eb Local variables hex 2130567168 Function Arguments ie Alo arguments This panel shows all the local variables here x only and functions arguments if we are in a function accepting parameters here none We haven t stepped through the line of our program initializing x so it is right now holding a random value File Edit View Search Project Build Debug weSmith Tools Plugins Settings Help eG Workspace Al HellowWorld S F Sources amp main c Registered new type wHotring Registered new type STL String Registered new type STL Vector Setting breakpoints Debugger name and version GNU gdb GDB 7 2 Child process PID 704 At C Users alessio Desktop HelloWorld HellowWorld main cilz At C Users alessio Desktop HelloWorld HellowWorld main c 14 C Users alessio Desktop Hello WINDOWS 1252 Line 14 Colurnn 1 default E Lo hemd Function Arguments The red indicates what was modified since the last line which was executed In addition to watching the variables the debugger finds for you you may also add your own watches by selecting Debug gt Edit debugger watches Keyword Format Undefined Decimal Unsigned Hexadecimal Binary Character Floating point Array E Watch as array Start 0 sen Count n Remove 0
25. lbox org first You should be able to install and use it on Windows Linux or MacOSX platforms We recommend a machine with at least an Intel Core I x processor or Dual Core processor about 4GB of free memory and 20GB of free disk space You will need your machine to be on the internet while using the SLB virtual appliance Your machine doesn t need to be solely dedicated to running the SLB virtual appliance you may boot SLB use it then shut it down as needed The installation steps detailed in the remainder of this guide will require you to have administrator access if you are installing on a Windows machine or root access if you are using a Linux machine Without such privileges you will be unable to install and setup the Virtual Box software When the SLB virtual appliance has been successfully installed on your machine it will operate without requiring further administrator or root privileges from you Installing Virtual Box This section walks through downloading installing amp setting up the virtual box software 1 Downloading the Virtual Box installer file The Virtual Box installer is available from the virtual box official web site Open your preferred web browser Go to the following URL http www virtualbox org A link named should be visible from the site s front page See example illustration below Please note that the version numbers will be more recent that those portrayed in the screen
26. ll be detailed below 8 Sharing folders with the host OS It is often useful to be able to share files between your guest amp host OS The virtual box extension pack allows you to mount inside your SLB a folder from the host We will detail how to do so for Windows please refer to the Virtual Box website for more details http www virtualbox org manual ch04 html sharedfolders Preparing the virtual machine for sharing Shutdown your virtual machine then open its settings You need to go to the Shared section of the settings dialog box SLB v2 12 04 student Settings eae ee General Shared Folders System Display Storage Audio Network Serial Ports USB Shared Folders E Name Path Auto Mount Access Machine Folders DR tF Select 2 setings category Tom the kton the kithand side and move Me mouse over a settings iiem fo get more information There you will be able to use the folder icon on the right of the empty list to add a new shared folder Make sure the shared folder exists on the host For this example we created a SLB folder on the desktop of the Windows host The dialog box will allow you to browse to locate the folder you want to share from the host amp assign it a name Make sure to check the Auto mount option to allow for this folder to be made available to your virtual machine every time you boot it You should now see the new shared folder in the list S L
27. ng The virtual appliance is a package containing all you need to install a guest OS in your virtual box software Virtual appliances are downloaded and imported into compatible virtualization software by end users regardless of their host OS They are then operated often without the need for the users to learn about system administration tasks The virtual machine is the simulated computer in which the guest OS runs We will often use the terms virtual machine amp virtual appliance interchangeably since the latter is really a virtual machine meant to be distributed SLB stands for Student Linux Box it is the name of the virtual appliance we are providing to our students to work By providing a pre made work environment we guarantee that regardless of their preference in terms of hardware or operating system every student will have access to the same tools to help them with their work amp will submit equivalent deliverables for evaluation To summarize and leverage the jargon we just learned this guide will guide you through installing the SLB virtual appliance This will entail installing the virtualization software on your host OS downloading the SLB virtual appliance importing it in your virtualization software amp starting it 3 Required Hardware Software The SLB virtual appliance may be hosted on any machine able to run the Virtual Box software We therefore recommend you check the requirements on http www virtua
28. ng to the Code Block menu File 2 New Project This will open the project pane illustrated in the screenshot below Projects Build targets Files Custom User templates ARM Project AVR Project D application DirectX project Feyk FLTK project GLFW project 4 Irrlicht project Kernel Mode GLEW TIP Try right clicking an item ge Blocks Console application 4 Dynamic Link Empty project Library GLUT Gea GLUT project GTK project View as Large icons a Matlab project List Select a wizard type first on the left Select a specific wizard from the main window filter by categories if needed Press Go We will be always selecting Console Application in this offering Console application F Welcome to the new console application wizard A Co nso le This wizard will guide you to create a new console application When you re ready to proceed please dick Next Go for Next and Skip this page next time if you want to Console application Please select the language you want to use Please make a selection We are going to write C programs in this offering so the selection is fairly obvious In the next panel you will have to provide a project tittle The name is up to you In this example we ll use the name of a PA e g PA303 I m selecting to have the project folder on my desktop Please note that in the examples below you will see Windows paths The process
29. our program with NED NED uses different tools to identify well known novice errors in your programs Most static code analysis tools will generate a fair amount of false positive meaning that they are at best able to produce warnings about anything which look suspect The tutorial pages should help you better understand the meaning of each warning learn about the potential bugs they describe then decide whether or not your program features it Whether you had a false positive or not the end result should be an improvement of your programming skills by simply learning about yet another possible type of bug However we hope the tools we are using will also bring to your attention actual bugs 7 Validating your tests amp solutions As part of our integration of the Programming Assignments with the IDE we have added build targets allowing you to perform two complementary forms of validation of your programs before to submit them for grading Validating your solution against the instructor s tests All but the first two PAs will require you to write functions to address a given problem amp functions to ensure the former are working properly This is meant to get you started thinking about testing your programs automatically using other functions Each PAs has a compiled version of the instructor s tests These are not exhaustive tests but are a sample of tests your program should be able to pass They are provided only to
30. our system Please review the description below and only proceed if you have obtained the extension pack from a trusted source Name Oracle VM VirtualBox Extension Pack Version 4 1 2r73507 Description USB 2 0 Host Controller VirtualBox RDF PXE ROM with E1000 support You will have to read and agree to the license agreements by selecting I Agree A dialog box will inform you of the successful installation of the extension pack which will then appear in the main panel s list VirtualBox e A Input Update Language Network Extensions Proxy Extension Packages Active Name Version Sucess Ye category from the list on the left hand side guse over a settings item to get more Installing the SLB Virtual Appliance 1 Download the SLB virtual appliance This virtual appliance is available as a package which Virtual Box will be able to manage for you via its import feature The file is available from the CLUE project s web site http CEReAL forest usf edu slb 2 Importing the SLB virtual Appliance Start the Virtual Box software if it is not still opened on your desktop sg Oracle VM VirtualBox Manager eca xX eine on Select file Virtual Media Manager and chose import etails Snapshots Export Appliance Ctrl E Preferences Ctrl G je left part of this window is a list of all virtual machines on your computer The list is ipty now becaus
31. ow will open with a report on the analyzis performed by NED on the files of your current project You need your virtual machine to be on the internet for the IDE to be able to reach NED As illustrated below the analyzer report will show the reports from different tools in a tabbed window GCC with specific options splint CPPCheck amp the CLUE syntax analyzer The last tab shows the uploaded files Analyzer Report Analyzed 07 08 2013 06 33 38 Compilation Warnings splint cppcheck CLUE Uploaded Files Results Nothing to report Report generated by Path gt usi bin gec Options Used gt 5 std gnu99 Wall pedantic W Wextra Weconversion Wuninitialized Version gt 4 47 Version Details 9 gt gcc GCC 4 4 7 20120313 Red Hat 4 4 7 3 More Information gt http C Using NED from a browser You may use NED by pointing Firefox to http CEReAL forest usf edu clue ned The interface is simple to use There is a default Browse button allowing you to find the first file you want to upload If your project has a single c file this will suffice Ifyou have more c or h file it is important you add them all To do so use the ladd file to add another Browse button to the page Use it to select another file amp repeat as needed If you added too many just leave the extra blank or use the Remove File button to get rid of the superfluous Browse buttons amp their selected files Wh
32. plication which allows you to run your programs through a suite of tools designed to detected potential errors Integration in the IDE of tools to validate your work on specific Programming Assignments we use with our students For each PA you will be able to run directly from the IDE your solution against the tests we provided to get you started or your tests against our reference implementation Integration in the IDE of a prepare submission tool which will not only store your work in an archive ready to submit to your instructor but also package along with it the entire history of your work on the assignment Desktop links to the educational material used to teach the semester long version of IT Program Design along with a 3 week long version of the material meant for advanced students self study A plethora of Linux development tools which might be used by your instructor to teach you more advanced topics valgrind electric fence subversion git bzr make Relevant IDE plugins have also been pre installed The following sections will discuss how to leverage each of these features 2 Accessing the available study material You will find a folder named My Program Design on your desktop Double clicking it will open the file explorer My Program Design Computer Home Desktop My Program Design Q Search Home Ed Desktop 3 Documents 102 EJ Downloads W Music jm Picture
33. s 203 H Videos File System amp i Trash 7 NED Novice Errors Program Design Self Study Website Network Detector Beta Website Browse Net Various programming assignments are available each in their own folder In addition links to the following resources will open a Firefox browser when double clicked A link to self study modules http CEReAL forest usf edu clue self study A link to the full semester version of the above http CEReAL forest usf edu clue progdesign A link to the Novice Error Detection web application which is also integrated in your IDE http CEReAL forest usf edu clue ned 3 Working on prepared projects with the Code Blocks IDE The Code Blocks IDE is provided with this virtual appliance This section provides you with an overview of how to use it Refer to your instructor or the online documentation for more details Starting Code Blocks wey You may open it by using its icon on the left panel launcher You may also open it by double clicking any cbp file in a Programming assignment folder Computer Home Desktop My Program Design 201 F Q Search igi Home Ei Desktop int Fincl E Documents incl 8 B Downloads main c PA201 cbp PA201 layout adi Music Finci ifnd inct defi incl Fincl jm Pictures Hg H Videos tests c tests h tools c File System ifmd def mr Trash incl Network tools h i Browse Net Compiling Buildin
34. s Help Settings Host J Take Snapshot Host T ey Take Screenshot Host E E Session Information Host N GJ Disable Mouse Integration Host I Insert Ctrl Alt Del Host Del Pause Host P Reset Host R W ACPI Shutdown Host H ers Close Host By default the system will give a name to your snapshot based on how many previous snapshots you already took We suggest you keep it but add some notes to the Description field to help you remember what it is for e g Before update A Snapshot Name Snapshot 1 Snapshot Description Your snapshot will now be visible in the virtual box main window when you select your virtual machine amp press the button in the top right area of the window Details J Snapshots 1 G Snapshot 1 1 minute ago Current State changed How to use snapshots When you try to close the virtual machine window the Power off the machine option will now allow you to reset it to a specific snapshot thus allowing you to revert to a previous state A A You want to Save the machine state W Send the shutdown signal F Power off the machine Restore current snapshot Snapshot 1 7 Installing the guest additions In order to benefit from the full set of virtual box features you need to install software in your guest OS allowing it to communicate efficiently with virtual box This is necessary for some of the fea
35. shots below fecioe 7 Frm rA gt wl eric ong tt aana Sry B Whi D koae wore lagian Ta pancanda modemem H Save Gerente chat ba freely avedeble 26 Open Barte Software ude che bewa af the CPU Gebara Putte Loewe G raen 2 ae Aa bae fear an miig ee asara pecker heap Car Muceceh red palma here ue alm ri BFT a area mkin Gut mot bried to Mimin HT 4 cil IP Seme hood vate Windows F Doane Lr Lue Ja eed 2 6 Sele ed Opel 0 os Oper Whalen beng ecb reip eeth frequeect rele ond Pao a weer ONE et of features epee qe oes pies fel pla oe oo elo oe a ey ot beech by b ote Cyr SSE oe in coi hee Crete eee Pee pee ee eh profes Comeran bee Bk Hat picks Bras aiaa muchas for Genie cee tO Grech Tech riene php Virtualfics A Fsb nbel oot ote Download the Virtual Box installer by using the link which matches the host OS of the machine you plan to dedicate to running the CLUE virtual appliance See example illustration below Fiepiga p Met Vinea O Geting uted a Laet Headin E obom Hort OW Logie Tadase To ederm HY Save Generne Download VirtualBox Right Click to get this Bore woes mi ird kki Bi rio eae re A ce diang Sonemahois WirtualBox binaries Ogee Dep Gera your gees to he barma ard condita of ih Peigi Bret eterno Cece babes ii a eel peter p T Dees are e b eq p gf e G pe Ff Erima doe oO Veteefes 4 12 lor injin bs B ee a Miber 4
36. tose LSewchrente GQaudes Pascnenases Debugger x Child procesa PID 5476 C Users alessio Desktop HelloWorld HellowWorld main c ilz C Users alessio Desktop HelloWorld HellowWorld main c 14 C Users alessio Desktop HelloWorldsHellowWorld main c 16 C Users alessio Desktop HelloWorld HellowWorld main c 6 C Users alessio Desktop HelloWorld HellowWorld main c l17 WINDOWS 1252 Line 17 Column 1 Read Write default Inspecting Variables Values on the go The other main feature of a debugger is to allow you to keep an eye on a list of variables as you step through the program Let s finish the previous run and start a new one with Debug gt Start a a a BB main c HellowWorld Code Blocks 10 05 a 4 Sas eG Workspace printf The value of x ias d n data dM HellowWorld F amp Sources int main i int uw 42 i printf Hello world n A Code Blocks A Search results Adding file bin Debug HellowWorld exe Starting debugger done la iemaiain new type weotring Registered new type SIL String Registered new type STL Vector Setting breakpoints Debugger name and version GNU gdb GDB 7 2 Child process PID 704 At C Users alessio Desktop HelloWorld HellowWorld main_c ilz C Users alessio Desktop Hello WINDOWS 1252 Line 12 Column 1 Read Write default We are going to open the window holding al
37. tures we will be using such as sharing folders between the guest amp host OS Before to do the following we suggest you take a snapshot of your virtual machine The Devices menu of the virtual machine s window has an option to Install Guest Additions Selecting this option will insert a virtual CD which the Linux virtual machine will detect Devices Help C CD DVD Devices d USB Devices Shared Clipboard P Drag n Drop E Network Adapters Shared Folders Enable Remote Display Install Guest Additions Host D An ao will be offered for to execute the software on the medium inside Ubuntu This medium contains software intended to be automatically started Would you like to run it The software will run directly From the medium VBOXADDITIONS 4 2 12_84980 You should never run software that you don t trust IF in doubt press Cancel Running the software will open another dialog which will prompt you to provide the administrator password type in your user password You will then see a text window detailing what is being installed The installation should take a few minutes after which you will be instructed to Press return to close this window Do so then shutdown your virtual machine When you boot it again you should be able to see the guest OS adjust its resolution every time you resize the virtual machine s window This will also enable your virtual machine to share a folder with the host OS as wi
38. u restart it it will resume operation exactly where you left it 6 Taking amp Restoring Snapshots While it is not our intent to turn this guide into a virtual box user manual being able to make snapshots goes a long way in making your life easier Why taking snapshots A snapshot is a way to tell virtual box to remember the exact settings of your guest OS so you may revert back to it later It is a good idea to take a snapshot before any operation which might potentially break the virtual machine The most notable example is upgrading the system You should be able to update any software package on the system without problems However if you update your kernel to a newer version the virtual box guest addons will need to be re installed in order to allow you to resize dynamically your screen Installing the new Guest addons will require you to update your version of virtual box to the latest available then re perform their installation Sometimes there is a delay between the release of a new Linux kernel amp the release of new addons During this time you won t be able to resize your screen We recommend that you snapshot the virtual machine before any update so you may easily revert back to it 1f the result is not to your likings How to take a snapshot Go to the Machine menu of your virtual machine s window amp select the Take Snapshot option r SLB v2 12 04 student Running Oracle VM Vir View Device
39. ur IDE By going to the Tools menu amp selecting you will be able to generate an archive of your project which you may then submit to your instructor as he or she instructed you to e g transfer it to the host s shared folder in order to email it upload or FTP it to a specific site ett pa Debug wxSmith Tools Plugins Settings Valqrind Help Detect Novice Errors 2 P 2 Prepare Submission ROWSJ NB_COLS void Configure tools include lt stdio h gt include estdlib h gt After select this tool you will find a new file on your desktop The file name will be always based on the number of the PA you are working on e g PA201 followed by a data amp time stamp Please note that the material being packaged also includes the entire development history of your project 1 e how amp when you modified the files in between every compilation or build of the project This extra information might be required by your instructor to allow him or her to not only grade you on the final result but also on how you reached it This will allow you to also receive feedback on how you worked on your project therefore potentially improving your technique 9 Other tools A plethora of other tools have been pre installed on your SLB virtual appliance We invite you to spend some time researching amp leveraging them http valgrind org http elinux org Electric_Fence http www gnu org software make
40. w that we are on a function call things are different If we use the same way of stepping the whole function call will be executed and we ll find ourselves on line 17 without having a possibility to step through the code of the function This is when you might want to use Step into instead which will allow you to get into the function s code and step through it a Q Workspace C void fiint data printf The value of x is bdin dataj int main i O int x 42 printf Hello world n Debugger name and version GHU gdb GDB F Z Child process PID 5476 At C Users ales3io Desktop HelloWorld HellowWorld main_ c l1lz At C Users alessio Desktop HelloWorld HellowWorld main c 14 At C Users alessio Desktop HelloWorld HellowWorldmain ciilse At C Users aless3io 7 Desktop HelloWorld HellowWorld main c 6 C Users alessio Desktop Hello WINDOWS 1252 Line 6 Column 1 If you want to step through all its code go for it If at some point you just want to run until the function returns then use the Step Out option IW main Hetowword eo e Ee File Edit View Search Project Build Debug wxSmith Tools Plugins Settings Help SOMA CK MAAR SPH SS Bautdtager dee OOOO r f H void fiint data eG Workspace os HellowWorld print The value of x is d n data int maini E i 2 int x 42 printf Hello world n Eix return Logs amp others Ticei
Download Pdf Manuals
Related Search
Related Contents
Call4U Pro Samsung AR09FSSEDWUN Užívateľská príručka GE V Installation Guide Calculo de Edad Gestacional GBC Opaque Binding Covers A4 180 Micron Gloss Black (100) Copyright © All rights reserved.
Failed to retrieve file