Additional with bash 4.1 or later: If you want to write the debug output to a separate file, add this to your script: exec 5> debugoutput. script.sh or add in your script set -x to see debug output. If it does not match, it increases the error counter. 8 Answers Sorted by: 213 Start your bash script with bash -x. Alternatively, how do setup a script which - as first stage - sets up the environment, and eventually invokes the Eclipse CDT debugger. In a similar way I set up a variable to read the ‘reg’ variable of my application and store it into ‘test_val’:Ī one-liner compares the actual value with the expected value. My question is simply how to do it, so that eventually, I'll be able to invoke the debugger (GDB) where all environment variables are set by some pre-running shell script. Are you familiar with the term Debug Shell During debugging, go to Window->Show View->Debug Shell to turn it on. For this I set up a scripting variable ‘test_expected’ and initialize it with a value of 0x40000 (the expected LED port value): To count the number of errors in my test script, I use an error counter: Next, I’m going to step over that line 9: Reg = (GPIO1_GetPortValue(NULL)&GPIO1_LED_R_MASK) /* get raw register value */ Then let’s run the application and hit that breakpoint: I’m using an ‘automatic’ break point (see Software and Hardware Breakpoints) on line 9, column 1: Next I set a breakpoint in my test program. The first thing is to start the debugger:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |