On Tue, 6 Aug 2013, Stefan Falk wrote:

Hey guys, it's me again!
 
Trying to get rid of the need of Keil I am trying to be able to debug a
program that was compiled under the SDCC.
 
The program runs on a eval-board which communicates with a server. 
I can communicate with this server by bridgeing some .dll files which then
allows me to do stuff like this:
 
// a java plugin
server.getDevice.getPc();
server.getDevice().getAllRegisters();
 
and so on..
But all this would only make sense if I was able to "highlight" that line on
wich the PC at the moment is.
 
Keil generates a table like:
 
  C:C006H         LINE#         60   C:C009H         LINE#         62  
C:C00FH         LINE#         63   C:C014H         LINE#         64
 
so if the PC == 0xC006 line 60 in the corresponding .c file would be
highlichted.
 
Can anyone provide me some guideline how I could manage this under Eclipse?
 
- I got a plugin
- I can receive all ?C information
- I (technically) can debug in Eclipse already (but without useful
visualisation)
 
but
- I can not associate the PCs address with a specific line of a .c or .asm
file to highlight it in Eclipse
 
Is there already an easy way how one could do this? If not, where can I get
a description about
how I can filter these information from the files that will be generated
using the "--debug" option?
 
Okay, I know this is not a small request from me but I'd be glad about
anything that could 
help me since getting so far really took me a lot. 
 
Thank you very much and best regards,
Stefan

There used to be a link on the SDCC web page that described the .cdb file format that has debugging information, including the line/address relationships. I'm not sure what happened to i, but I'll tell you the part you need to know.

The .cdb file is a plain text file with one debugging record per line. The lines that begin "L:C" are the records with the address of a particular "L"ine of "C" source. This is followed by the source filename and line number, both separated by the "$" symbol. Then there are two other fields that aren't particularly important, also separated by a "$" symbol. At the very end is a ":" symbol and the hexadecimal address associated with that line (although there is no prefix explicitly denoting the use of hexadecimal).

So for example, the line:

L:C$sample.c$32$1$16:51

indicates that the code associated with line 32 of sample.c begins at address 0x51 in memory.

Although I have no idea how to integrate this with Eclipse, it should be fairly simple to translate the line/address information in the .cdb file to the format that Keil generated using a convenient scripting language of your choice.

  Erik
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to