|
View:
New views
8 Messages
—
Rating Filter:
Alert me
|
|
|
MPLAB IDE: C Programming: Using watch function for symbolsI am using PICC Lite software with MPLAB IDE. I write some code and try to
get a "watch" for the variables that I create. I can add watches for built in registers (using 16F877 setup), but cannot click the "Add Symbol" button because it is "gray" (does nothing when clicked). I read from the website http://www.microchipc.com/ That I need to add the switch '-fakelocal' to the linker options. I click "project, build, project" and it opens a dialog. There is a text box with linker options label at the bottom. I add the text, but the project build fails and says that it doesn't recognize that command. What is going on with my innability to add symbol names from the program (I set the variables up as unsigned chars)? Thanks. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
RE: MPLAB IDE: C Programming: Using watch function for symbols> -----Original Message----- > From: piclist-bounces@... [mailto:piclist-bounces@...] On Behalf > Of Zachary Noyes > Sent: 28 April 2008 17:43 > To: piclist@... > Subject: [PIC] MPLAB IDE: C Programming: Using watch function for symbols > > I am using PICC Lite software with MPLAB IDE. I write some code and try to > get a "watch" for the variables that I create. I can add watches for built > in registers (using 16F877 setup), but cannot click the "Add Symbol" > button > because it is "gray" (does nothing when clicked). > > I read from the website http://www.microchipc.com/ That I need to add the > switch '-fakelocal' to the linker options. I click "project, build, > project" > and it opens a dialog. There is a text box with linker options label at > the > bottom. I add the text, but the project build fails and says that it > doesn't > recognize that command. > > What is going on with my innability to add symbol names from the program > (I > set the variables up as unsigned chars)? Thanks. Local variables are often optimised away by the compiler if possible. Try disabling optimisation perhaps? Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
|
|
|
Re: MPLAB IDE: C Programming: Using watch function for symbolsI have not used PICC Lite, but have instead used Microchip's C18 and C30.
Someone pointed out that optimization may cause variables to disappear. I have not seen that, but have seen wild program line execution order when single stepping if I have full optimization on. For debug, I either turn off optimization or set it to "debug." I am also not familiar with the fakelocal flag, but I expect that it makes local variables static instead of automatic so they have a permanent location in RAM instead of a location on the stack. You do not indicate whether the problem is with global or local variables (apparently it's with both since you have the button grayed out). I have not ever seen that happen. With C18 and C30, local variables are visible in the watch window when you are in the function they are defined in. If you step outside the function, the watch window says they are out of scope. Global variables are always visible. So... Since I have not use PICC Lite, I am not really answering your question. There are some general comments on the watch window, though. Good luck! Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: MPLAB IDE: C Programming: Using watch function for symbolsOn Mon, 28 Apr 2008, Zachary Noyes wrote:
> I am using PICC Lite software with MPLAB IDE. I write some code and try to > get a "watch" for the variables that I create. I can add watches for built > in registers (using 16F877 setup), but cannot click the "Add Symbol" button > because it is "gray" (does nothing when clicked). > > I read from the website http://www.microchipc.com/ That I need to add the > switch '-fakelocal' to the linker options. I click "project, build, project" > and it opens a dialog. There is a text box with linker options label at the > bottom. I add the text, but the project build fails and says that it doesn't > recognize that command. The "fakelocal" flag was deprecated several years ago. microchipc.com generally has lots of obsolete and incorrect information. -- John W. Temples, III -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
Re: MPLAB IDE: C Programming: Using watch function for symbolsOn Mon, 2008-04-28 at 12:43 -0400, Zachary Noyes wrote:
> I am using PICC Lite software with MPLAB IDE. I write some code and try to > get a "watch" for the variables that I create. I can add watches for built > in registers (using 16F877 setup), but cannot click the "Add Symbol" button > because it is "gray" (does nothing when clicked). > > I read from the website http://www.microchipc.com/ That I need to add the > switch '-fakelocal' to the linker options. I click "project, build, project" > and it opens a dialog. There is a text box with linker options label at the > bottom. I add the text, but the project build fails and says that it doesn't > recognize that command. > > What is going on with my innability to add symbol names from the program (I > set the variables up as unsigned chars)? Thanks. Welcome to C! :) A problem I've had is you have to remember that in C variables have a "scope", meaning they exist only when the code they are in scope with is running (unless you modify the scope, i.e. declaring a variable outside of all code blocks, that effectively makes them "global" variables). In your case, you have to stop your execution in the section of code where that variable exists, add it, and then continue or reset. This might not be your problem, but it is a common thing that people forget. TTYL -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist |
|
|
|
|
|
Re: MPLAB IDE: C Programming: Using watch function for symbols
|
| Free Forum Powered by Nabble | Forum Help |