MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "warnings": {
        "query": {
            "*": "Formatting of continuation data will be changing soon. To continue using the current formatting, use the 'rawcontinue' parameter. To begin using the new format, pass an empty string for 'continue' in the initial query."
        }
    },
    "query-continue": {
        "allpages": {
            "gapcontinue": "Robostix_toolchain"
        }
    },
    "query": {
        "pages": {
            "2202": {
                "pageid": 2202,
                "ns": 0,
                "title": "Remote Debugging with GDB",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "In this tutorial we will go over how to perform a basic debugging with GDB, the GNU debugger. This environment allows us to debug C, C++ and Java (compiled to machine code, not for running in a Java Virtual Machine) programs.\n*We will complete these tasks step by step\n:*Install the GDB debugger\n:*Run the debugger\n:*Set Breakpoints\n:*Navigate the code in your program\n:*Diagnose an error and how to fix it\n\n*Required Items\n:*Overo COM with Expansion Board\n:*Mini B to Standard A Cable\n:*Bootable MicroSD card\n:*5V Power Supply\n\n*Required Reading (things you should know, or tutorials that explain)\n:*[[HelloWorld | HelloWorld in Python, C and C++]]\n:*[[Eclipse on Gumstix for new users | Eclipse Tutorial]]\n::*Although the majority of this tutorial pertains to debugging and C programming, it contains useful information which leads to basic understanding of your Overo COM\n\n==Installing the GDB Debugger==\nBefore starting this, you should have Console access to your Overo COM and should know how to program and run a basic C++ program. If you do not know how to do this, see [[HelloWorld | HelloWorld in Python, C and C++]].\n\nIf you haven't yet, install a C/C++ SDK with the following command\n opkg update \n opkg install task-native-sdk\n\nTo install the GDB debugger, run the following command in your command line:\n opkg update\n opkg install gdb\nOnce this has completed, you will have the GNU GDB debugger installed on your Overo COM\n\n==Creating the Test File==\nNow that we have the debugging environment\n\nRun the following in your command line:\n nano broken.cpp\nThen copy and paste the code from [http://cs.baylor.edu/~donahoo/tools/gdb/broken.cpp |Broken.cpp] into your shell. When you copy and paste there will be two syntax errors that you must fix at the lines:\n cout << \"This program is used to compute the value of the following\n series : \" << endl;\nand\n cout << \"(x^0)/0! + (x^1)/1! + (x^2)/2! + (x^3)/3! + (x^4)/4! + ....\n .... + (x^n)/n! \" << endl\n\nCopying and pasting added an extra line break to these two lines, and we want to undo this by deleting one space at the beginning of each second line so it looks like this:\n cout << \"This program is used to compute the value of the following series : \" << endl;\nand\n cout << \"(x^0)/0! + (x^1)/1! + (x^2)/2! + (x^3)/3! + (x^4)/4! + ........ + (x^n)/n! \" << endl\n\nNow save and exit by pressing the following:\n:*Ctrl + O\n:*<Enter>\n:*Ctrl + X\n\n==Compile and Run broken.cpp==\nNow that we have our test file (broken.cpp) ready to go, it is time to run it. \n\nCompile the program to create an executable file (broken) by entering the following command:\n g++ -g broken.cpp -o broken\nThe '-g' switch tells the compiler to include debugging symbols in the executable. Run the program as such:\n ./broken\n----\nNote:\nUse 'g++ -g broken.cpp -o broken' to compile. If you use g++ -o, g++ --ggdb -Wall, or any other method of compilation the debugging will not follow this tutorial exactly.\n----\n\nEnter any numbers into the program for x and n. Run it a couple times, you should notice that the answer is always the same: infinity. This is obviously wrong.\n\nConsider: x=1, n=1\n(1^0)/0! + (1^1)/1!\n1/1 + 1/1\n2\n\nNOT infinity\n\n==Debugging the Program==\nNow, it is time that we debugged our program. \n\nFirst, you need to start the GDB environment by issuing the following command:\n gdb\nYou should see the following command line appear:\n (gdb)\nThen, you need to 'tell' the debugger which file it is that we are debugging, do this by issuing the command:\n (gdb) exec-file broken\nNow, it is time to run our program by issuing the command:\n (gdb) run\n\nNotice that the program runs normally and again, gives us the answer inf. This is because the error we have is a computation error, and does not cause our program to crash. So, its time to set a Breakpoint in our program.\n\n===Setting a Breakpoint===\n----\nHint:\nA breakpoint is a point in the program at which the debugger will stop the code from executing. Then, you can choose to 'step' through the program line by line to 'see' exactly what the CPU is doing. This way, you can effectively watch the program execute and discover where the problem is!\n----\nLets set a breakpoint within the program so that we can see what is going on. Lets start by setting a breakpoint at line 43. Do this with the following command:\n (gdb) b 43\nYou could also set a breakpoint to a specific functions call, such as:\n (gdb) b ComputeSeriesValue\nHowever, for the purpose of this tutorial, use the line number. If you wish, you can play around with using the function instead, but it will cause you to diverge from this tutorial.\n\nIf the program outputs: No symbol table is loaded.  Use the \"file\" command. Then use the following command:\n (gdb) file broken\nThis will set the file so that you can add a breakpoint without error\n\nLine 43 is the following:\n double seriesValue = ComputeSeriesValue(x, n);\nSo the program will stop executing immediately before it executes the function ComputeSeriesValue(x, n).\n\nNow, lets run the program with our command:\n (gdb) run\nLet's enter the values as x=2 and n=3, with an expected output value is 5. \nHere is a snapshot of what the program should output at this point:\n This program is used to compute the value of the following series : \n (x^0)/0! + (x^1)/1! + (x^2)/2! + (x^3)/3! + (x^4)/4! + ........ + (x^n)/n! \n Please enter the value of x : 2\n Please enter an integer value for n : 3\n Breakpoint 1, main () at broken.cpp:43\n 43  double seriesValue = ComputeSeriesValue(x, n);\nThe program has stopped at our breakpoint, line 43.\n\n===Stepping into a function===\nNext, we are going to step into the function ComputeSeriesValue(x, n)\n----\nHint:\n'Stepping' through a function allows us to go line by line, and see exactly what lines of code are being executed. This way we can manually diagnose the computation problem.\n----\nTo start stepping, issue the following command\n (gdb) step\n----\nHint:\nA nice thing about the GDB Debugger is that it will save the last command you issued so that you don't need to type it over and over. This way you can keep stepping through the function by pressing <enter>. You do not need to retype 'step' <br>\nHint:\nThe GDB Debugger also has nice 'shortcuts'. For example, 'step' and 's' are the same command. So is 'breakpoint' and 'b'. \n----\nYou should see the following outputted:\n ComputeSeriesValue (x=2, n=3) at broken.cpp:17\n 17  double seriesValue=0.0;\nAt this point, the program has gone to line 17, and is at the first line of the function ComputeSeriesValue, which sets the double seriesValue to 0.0.\n\nNow, we wish to use the 'next' function until we reach the function CompueFraction(). To do this, use the following commands:\n (gdb) next\n 18  double xpow=1;\n (gdb) <enter>\n 20  for (int k = 0; k <= n; k++) {\n (gdb) <enter> \n 21    seriesValue += xpow / ComputeFactorial(k) ;\n (gdb) step\n ComputeFactorial (number=0) at broken.cpp:7\n 7  int fact=0;\n\n==Using Backtrace==\n*If you want to know where you are in the program's execution (and how, to some extent, you got there), you can view the contents of the stack using the backtrace command as follows:\n (gdb) bt\n #0  ComputeFactorial (number=0) at broken.cpp:7\n #1  0x08048907 in ComputeSeriesValue (x=3, n=2) at broken.cpp:21\n #2  0x08048a31 in main () at broken.cpp:43\n----\nHint: \nBacktrace lets you see where you have been and what you have done. In case, you get lost or confused it is very useful. <br>\nHint: \nA stack is a data structure in Computer Science which stores data much like a stack of cards. It is a Last On, First Off data structure. For more explanation of how a stack functions, see the wikipedia article. <br>\nhttp://en.wikipedia.org/wiki/Stack_(data_structure)\n----\nSee the error?\n\nThe print command (abbreviated p) reveals that the value of fact never changes. Note that the function is returning a value of 0 for the function call ComputeFactorial(number=0). This is an ERROR! The answer will always equal zero.\n\nBy taking a closer look at the values printed above, we realize that we are computing fact=fact * j where fact has been initialized to 0, (0 = 0 * j); fact should have been initialized to 1. We quit GDB with the quit command. Next we need to change the following line:\n\nchange the line\n int fact = 0;\nto\n int fact =1;\nand you're all set!\n\n==More Tutorial==\nFor another tutorial which is more in depth, see:\nhttp://www.cs.cmu.edu/~gilpin/tutorial/"
                    }
                ]
            },
            "2593": {
                "pageid": 2593,
                "ns": 0,
                "title": "RoboVero",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "RoboVero\u2122 is a robotics expansion board for the Overo COM series.\n\nGetting started information about RoboVero is available at [http://robovero.org/ RoboVero.org]"
                    }
                ]
            }
        }
    }
}