CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

ROM listing debugger?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
equack



Joined: 21 Sep 2009
Posts: 21

View user's profile Send private message

ROM listing debugger?
PostPosted: Wed Aug 04, 2010 12:05 pm     Reply with quote

I'm using V4.095 of the IDE with an ICD-U64. I compile for debug and everything works fine- I can single step, set breakpoints, use the eval() tab to examine variables, etc.

EXCEPT: when I look at the ROM() tab all I get is a list of addresses with no data. I'm trying to debug a ROM based look up table so I really need to see this.

It's a PIC18F2455 if it matters. I'm only using PGC and PGD on the ICSP connection- I do not have PGM (RB5) connected. Would it help?

The help file says the ROM display comes from the HEX file and is not read directly from the device.

What am I doing wrong?

I have also found that the C/ASM listing generated by the compiler does not include all of the code. For example, I have declared an array:

Code:
const char font48[]={0x00,0xff, repeat for ~6500 bytes};


When I look at the assembly code for:

Code:
base=font48[long index];


I see


Code:

  ...
  MOVLB     0
  CALL        13E2
  TBLRD*+
  ...


but there is no assembly code at "13E2" in the listng.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 04, 2010 2:34 pm     Reply with quote

Sometimes you need to comment out the #nolist statement at the start
of the .h file for your PIC, in order to see all the code in the .LST file.

Also, with 'const' tables, you may not see all the code for the following
reasons:

1. If two or more entries (rows) of constants are the same, the compiler
will only put code into ROM for one set. That's done to save ROM.
It's optimizing the code.

2. If you access the array with a constant index value (a number, not
a variable), the compiler will load the value as an immediate value,
with the MOVLW instruction. The table won't be put into ROM.

3. To have the whole 'const' array put into ROM, you need to access it
with a variable as the index. Then the compiler has no way to know the
value that's being accessed at compile-time. It can't optimize it into a
MOVLW. It has to put the whole table into ROM.
equack



Joined: 21 Sep 2009
Posts: 21

View user's profile Send private message

still no ROM data
PostPosted: Wed Aug 04, 2010 3:55 pm     Reply with quote

Comment out the "#define NOLIST" line in my 18F2455.h file solved part of the problem. Now I can see the "missing" assembly code in the listing file.
Thank you!

I still cannot see anything when I switch to the debugger's ROM tab. The RAM and Data EE tabs work properly but the ROM tab just shows a list of addresses but no data.

Do I have to do something special to load the HEX file into the debugger?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 04, 2010 4:16 pm     Reply with quote

I don't have the CCS ICD-U64 debugger so I can't help on that.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group