Debugging under Eclipse

  • Stefan Falk

    Stefan Falk - 2013-08-06

    I was wondering if it is somehow possible to debug a program that I compiled with SDCC in Eclipse?

    I could not find anything so I tried to extend the SDCC plugin but here is the thing:

    Though I can receive all information from my µ-device (PC, Registers..) and I build my LaunchConfiguration for Eclipse, I am not able to associate the value of the PC to its corresponding line.

    Here is a small example how Keil seem to solve this problem:

      VALUE           TYPE          NAME
      // ...
      C:C003H         LINE#         59
      C:C006H         LINE#         60
      C:C009H         LINE#         62
      C:C00FH         LINE#         63
      C:C014H         LINE#         64
      C:C01DH         LINE#         66
      C:C020H         LINE#         67
      C:C020H         LINE#         68
      C:C020H         LINE#         69

    so if PC == 0xC014 the line 64 will be highlighted.

    How does SDCC manage these information? I found that SDCC generated files like *.rst and *.lst but I have no idea how I could connect these information to the Eclipse IDE.

    Any hints?

  • Stefan Falk

    Stefan Falk - 2013-08-07

    Okay I came to that point where I'd just need a .cdb-file parser. ^^

  • Joffrey

    Joffrey - 2013-09-13

    How about OMF files?

    Did you manage to get debugging working under Eclipse?

    I would be interested to know how you do this under Eclipse.


  • Brutte

    Brutte - 2013-09-20
    I was wondering if it is somehow possible to debug a program that I compiled with SDCC in Eclipse

    You didn't mention architecture so I suppose that is a generic question.

    1. You need some debugger server (preferably GDB with MI interface).
    2. You need the dongle that can talk to the debugger server.
    3. A compiler must generate a debugging information that is compatible with GDB.
    4. IDE must support the commands of the debugger server.
    5. IDE parser should understand the language syntax (to follow headers inclusions, function declarations etc).
    6. etc..

    For Eclipse you can have all those (1:6) features with GCC and ARMs, MIPSes, AVR8s and obviously x86.

    For SDCC you can have (1:4) with MPLABX + SDCC plugin for PIC8s. The (5) does not work very well.

    I suggest you should see how mentioned architectures/toolchains manage debugging.

  • Stefan Falk

    Stefan Falk - 2014-03-21

    The used architecture is MCS51. There is already a server that is able to communicate with that device in a quiet straight forward way. E.g. you can always ask the current value of the program counter or any other register. So this part is already done. The only thing that is missing is to connect the information I can get from the device to the C code and/or assembly code that describes the program.

    Basically "all I need" would be a parser for .cdb and .lst files to convert these information to objects at runtime.

    (Sorry I did ask axact the same question today - I thought this question here never got any answers)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks