Netbeans/C2/Netbeans-Debugger/Gujarati

From Script | Spoken-Tutorial
Revision as of 17:20, 13 June 2014 by Jyotisolanki (Talk | contribs)

Jump to: navigation, search
Time Narration


00.01 નમસ્કાર.
00.02 Netbeans Debugger. પરના આ ટ્યુટોરીયલમાં સ્વાગત છે.
00.06 જો તમે પ્રથમ વખત 'Netbeans વાપરી રહ્યા હોય તો આગળના ભાગ અમારા 'Spoken Tutorialની વેબ સાઈટ જુઓ.
00.14 આ ડેમોનસ્ટ્રેટ કરવા માટે હું વાપરી રહી છુ લીનક્સ ઓપરેટીંગ સીસ્ટમ ઉબ્નટુ આવૃત્તિ v12.04,
00.21 અને Netbeans (નેટબીન્સ) IDE v7.1.1
00.26 આપણે બધા જાણીએ છીએ કે debugging પ્રોગ્રામ એ કાળજીપૂર્વક કરવો પડે છે.
00.31 તેથીdebugging' ટૂલ જાણીને અને તેના ફીચરો સાથે પરિચિત હોવાથી તમે મૂલ્યવાન સમય બચાવી શકો છો.
00.39 આ શક્તિશાળીdebugging ' ટૂલ ખૂબ જ ઉપયોગી છે,
00.42 ખાસ કરીને જ્યારે તમે મોટા પ્રોગ્રામ્સને કોડ કકરવા અથવા ચકાસતા હોવ.
00.46 આ ટ્યુટોરીયલ આપણે 'NetBeans ડિબગર' પૂરી પાડેલ કેટલાક ફીચરો શીખીશું.
00.53 આ ટ્યુટોરીયલ સાથે પરિચિત થવું પડશે.
00.55 debugging વિન્ડો


00.58 બ્રેકપોઇન્ટ્સ રૂપરેખાંકિત કરવા
01.00 સમીકરણો ઉકેલવા અથવા વોચ સુયોજિત કરવી.


01.04 તમારા પ્રોગ્રામના અમલીક્ર્ણ માટે ટ્રેસીંગ વિકલ્પો.


01.17 અને ' debugger' ને કોન્ફીગર કરવા માટેના વિકલ્પો


01.12 હવે ચાલો શરુ કરીએ અને સેમ્પલ કોડ debug કરીએ.
01.17 Netbeans IDEપર જાઉં છુ.


01.20 મેં ડેમોનસ્ટરેશન કરવા માટે IDE માં પહેલેથી જ sampleDebug જાવા એપ્લીકેશન બનાવ્યું છે.
01.27 આ નાનો પ્રોગ્રામ છે જે a, b, અને c ત્રણ ઇનટીજર વેલ્યુઓને ઇનશીલાઈઝ કરશે.


01.35 પછી તે 'Hello World!' અને 'a'. ની વેલ્યુ પ્રિન્ટ કરે છે.
01.40 તે 'SampleClass', નામ નો ક્લાસ ઓબ્બેજ્ક્ત પણ બનાવશે જેની વેલ્યુ ઇનટીજર પ્રકારની અને પ્રાઇવેટ હશે.
01.52 ', પછી તે ' 'b' ની વેલ્યુ કાઢશે.
01.55 અને c,ની વેલ્યુ કાઢવા માટે ફંક્શન કોલ કરશે.


02.00 અને 'b' અને 'c'.ની વેલ્યુ પ્રિન્ટ કરશે.


02.05 'debuggingની શરૂઆત breakpoint (બ્રેક પોઈન્ટ)સેટ કરવાથી કરીએ.


02.09 બ્રેક પોઈન્ટની સેટ કરવા માટે લાઈન નંબર પર કિલક કરો.
02.13 હું Hello World! પ્રિન્ટ કરનાર લાઈન પર સેટ કરીશ.


02.18 બ્રેક પોઈન્ટ સેટ કરેલ લાઈન નો રંગ ગુલાબી થયો છે.અને લાઈન ના નંબરને નાના ચોરસ થી માર્ક કર્યું છે.
02.28 debuggingમોડ માં જયારે તમે પ્રોગ્રામ રન કરો છો,
02.31 , ટૂલ બારમાં ' Debug Projectબટન પર ક્લિક કરીને,
02.35 breakpointવાડી લાઈન પર આવીને પ્રોગ્રામ એક્ઝેક્યુશન થવા નું બંદ થશે.
02.41 હજુ સુધી 'a'ની વેલ્યુ સેટ કરી છે.
02.45 વેલ્યુ તપાસવા માટે તેના પર જાવ.


02.49 અહી વેલ્યુ 10બતાવે છે.


02.52 તમે જોઈ શકો છો વર્કસ્પેસ હેઠળ હજુ એક વિન્ડો છે.
02.59 ત્યાં 'Variablesવિન્ડો છે જે વેરીએબલ અને તેની વેલ્યુઓ ની સૂચી બતાડે છે.


03.07 હજુ સુધી ફક્ત 'aવેરીએબલ ઈનીશીલાઈઝ થયું છે.


03.11 આપણે સેમ્પલ 'debug આઉટપુટ સાથે પણ આઉટપુટ વિન્ડો જોઈ શકીએ છીએ.


03.17 ત્યાં હજુ આઉટપુટ નથી.


03.19 'Debugger Console' ' (ડિબગર કન્સોલ) બતાવે છે કે પ્રોગ્રામ 29 લાઈન પર બ્રેકપોઈન્ટ થોભ્યું છે.


03.28 ત્યાં 'Breakpoints' વિન્ડો પણ બતાવે છે જે 29 ના લાઈન પર બ્રેકપોઈન્ટ સેટ કર્યું છે.


03.36 આગળ વધતા પહેલા, ચાલો વોચ કેવી રીતે ઉમેરવી તે જુઓ.


03.40 ઉદાહરણ તરીકે મને ' 'aSample'પર મને વોચ જોઈએ છે.


03.48 વર્ક સ્પેસ હેઠળ વેરીએબલ વિન્ડોમાં Enter new Watchવિકલ્પ પર ડબલ ક્લિક કરો અને વેરીએબલ 'aSample.value' મન આપો.


04.02 OK. પર ક્લિક કરો.


04.06 હજુ શુધી 'aSample' બન્યું ન હોવાથી તેને વેલ્યુ વિશે ખબર નથી.


04.12 એક વખત પણ લાઈન એક્ઝીક્યુટ થાય તો વેરીએબલની વેલ્યુ સમઝાશે.



04.16 એ જ રીતે તમે પણ સમીકરણો જોઈ અને મૂલ્યાંકન કરી શકો છો.


04.21 અહી હું b=a+10.માટે તાપસીસ


04.25 a-4 કેટલા છે તે મને જાણવું હોય તો ?


04.29 તે માટે મેનુ બાર પર Debug મેનુ માં જઈ Evaluate expression' વિકલ્પ પસંદ કરો.
04.37 વર્કસ્પેસમા 'Evaluate Code' વિન્ડો દ્રશ્યમાન થશે.
04.41 અહીં હું સમીકરણ 'a-4'. 'દાખલ કરીશ.
04.45 અહી Evaluate Expression buttonબટન પર ક્લિક કરો.અને વેરીએબલ વિન્ડોમાં 'a-4' ની વેલ્યુ 6 બતાવે છે.
04.56 ચાલો હવે આગળ વધો અને કોડના એક લાઇનમાં એક્ઝેક્યુટ કરીએ.
05.00 તે કરવા માટે ટુલબાર માંથી Step-Over પસંદ કરો.


05.06 તે ફક્ત “Hello World”. પ્રિન્ટ કરનાર એક લાઈનના કોડ ને એક્ઝેક્યુટ કરશે.
05.12 આઉટપુટ જોવા માટે આઉટપુટ વિન્ડો પર જઈ sampleDebug' આઉટપુટ પર જાઓ.


05.17 Hello World! a is 10. આ આઉટપુટ દેખાય છે.


05.22 હવે પ્રોગ્રામ SampleClass ઓબ્જેક્ટ બનાવવા માટે તે લાઈન પર થોભ્યું છે.
05.28 હવે SampleClass.ના કંસ્ટ્રક્ટરમાં જવું છે.


05.32 તે માટે હું ટુલ બાર પરથી Step Into વિકલ્પ પસંદ કરીશ.


05.41 પછી હું Step Over પસંદ કરીશ અને કંસ્ટ્રક્ટર કોલમાં આવેલી વેલ્યુ 10 પર સેટ થયી છે.
05.51 તમે વેરીએબલ જઈને પણ જોઈ શકો છો.
05.55 ફરીથી જયારે હું Step Over પર જઈશ તો આપને જોશું કે this.variable' પણ 10 પર સેટ છે.


06.03 આ ફન્કશન માંથી બહાર જવા માટે હું 'Continue,' Step Over અથવા Step Outપસંદ કરીશ.


06.11 મેથડ માંથી બાર આવવા માટે Step-Out પસંદ કરો.
06.14 અને હવે હું જ્યાંથી ફંક્શન કોલ કર્યું હતું ત્યાં પાછી આવી છુ.
06.19 ફરી Step-Over કરવાથી aSample.valueહવે 10 પર સેટ થયેલું દેખાશે.
06.27 જેના માટે આપણે માટે જોઈ રહ્યા છે.
06.30 Breakpointsઅને StepOversઉપરાંત જે લાઈન પર કર્સર મુક્યું છે ત્યાં પ્રોગ્રામનું એક્ઝેક્યુશન થવું થોભી શકે છે.


06.38 ઉદાહરણ તરીકે અહી ફંક્શન માં જઈ d=b-5; લખેલ લાઈન પર કર્સર સેટ કરો.


06.49 હવે ટુલબાર પરથી Run To Cursor વિકલ્પ પસંદ કરો.
06.54 You will notice that the execution of the program gets into the function and stops at the line where the cursor is located.
07.05 You can see that it has computed the value of b, as 20.
07.10 And inside the variable window, it has set 'b' to be 20.
07.14 Now, I can choose Step Over again and d's value also gets initialized and becomes 15.
07.23 Now, I can either choose to return or completely finish the execution of the program.
07.29 Let me choose Step Out and come back to the function call.


07.36 When you hover on the getC() function, you'll notice that the function has returned a value of 15.
07.43 The variable 'c' has not yet been assigned that value.
07.47 So, when we Step Over and execute that line, 'c' will get a value of 15.


07.55 We can now check it in the variable window or hover on the variable to check it's value.
08.03 Now if you want to stop the debugging session, you can choose the Finish Debugger Session option from the toolbar.
08.12 If you want to continue the execution to the next breakpoint you can choose the Continue option.
08.19 Once you finish, you can also choose the Continue option to complete the execution of the remaining program.
08.25 Let me choose Continue here.
08.27 In the Output window, it shows me the output as: b is 20 and c is 15.
08.34 Now, this was a quick overview of the options of debugging on netbeans.


08.39 If you want any advanced feature settings, you can -


08.42 Go to Tools menu, click on Options, go to Miscellaneous option, click on the Java Debugger tab.


08.53 Here you can change settings for multi-threaded program breakpoint options.
08.59 Or have filters to decide on which methods you would want to step in.
09.07 Now to the assignment.
09.09 As an assignment, take any of your programs, excellent if it has already errors.
09.16 If not, introduce some errors with the logic or algorithm.
09.20 Set breakpoints in the code. Usually, you would set a break at the calling point of a function which you suspect has the error.
09.29 Use Step-Into to go into the function.
09.32 Use Step-Overs to execute the lines and make sure to inspect the values of variables in the variable window.


09.41 Add some watches to help you identify and correct the error.


09.45 Step-Out of the method.
09.48 Continue till you reach the next breakpoint.
09.51 And finally, Finish the debugger session and Run your application.
09.57 In this tutorial, we became familiar with the netbeans debugger.
10.02 We saw how to set breakpoints and watches.
10.06 Add expressions which we want to evaluate, while the code is running.
10.11 Trace execution of a program with Step-Into, Step-Over, Step-Out and Run-to-Cursor options.
10.19 Also saw how to configure the debugger for advanced debugging.
10.24 Hope this tutorial saves you a lot of time in your testing and debugging tasks.


10.30 Watch the video available at the link shown on the screen.
10.33 It summarizes the Spoken Tutorial project.
10.36 If you do not have good bandwidth, you can download and watch it
10.41 The Spoken Tutorial project team conduct workshops using Spoken Tutorials.


10.46 Gives certificates to those who pass an online test.


10.49 For more details contact contact@spoken-tutorial.org


10.55 Spoken Tutorial Project is a part of the Talk to a Teacher Project
10.59 It is Supported by the National Mission on education through ICT, MHRD, Government of India
11.05 More information on this mission is available at spoken-tutorial.org/NMEICT-Intro
11.14 This tutorial has been contributed by IT for Change


11.18 Thank you for joining us.

Contributors and Content Editors

Gaurav, Jyotisolanki, Pratik kamble