Menu

AVR Studio Debugging: cygdriveProblem

Help
2009-09-02
2012-12-09
  • Tobias Lawrenz

    Tobias Lawrenz - 2009-09-02

    sorry for my bad english, I hope you can guess what I mean.

    The Problem I have:
    I want to debug the Project via JTAG on a windows system with AVR studio.
    Basically it works , I can load the main.elf file. 
    Unfortunately within the elf file, the path to the sources are stored as cycwin path ( ../src/cygdrive/c/ ...).  AVR studio is asking for the right dirs, and this works basically, but the created avr studio project is not really usable, because the file references are still pointing the the cygdrive. If I want to add a breakpoint, the only way I found is to step into the user code until the desired .c file is open, then I can set the breakpoint.

    I've experimented with avr-objcopy to get ride of the wrong paths within the elf file, but had no success.

    Is there a way to correct the elf files?

    many thanks!

    Tobias

     
    • Tobias Lawrenz

      Tobias Lawrenz - 2009-09-03

      Compiling is not the problem. To compile, I'm using your makefile and eclipse with CTD, just  as you described in the readme file. The elf file is generated by this makefile, and I'm happy about this fact. So I can
      use AVR studio to do the Debugging witin my hardware via the JTAG Interface of a mega AVR..  ( If there is another way to debug, direct with eclipse, please let me know, it's my first project an AVR )  On AVR Studio I only have to open the elf file. The problem is the "linux path" c/cygwin/.. stored in the elf file.  I do not have experiences with linux nor cygwin, so maby this is just a litle think that I don't understand.
      Why at all is cygwin necessary? I cannot find the reason nor the playce where cygwin is used by the compiler/linker, nevertheless the linker links the path to the project with the (..cygwin/c prefix.)

      To put it all into a nutshell: I need a better way to debug vio JTAG on windows then with the generated elf file.

      So zhis is not a FemtoOS problem, it's more a problem that I don't know gcc and cygwin as good as MS Visual Studio. Unfortunately I found no solution by googling for it.

      Tobias

       
      • De Vlaam

        De Vlaam - 2009-09-03

        Ok, i am beginning to understand. I will try to help you, but i don't know if it is of any use, because i myself never debug, i trace. Debugging on an OS, which does interrupts all the time makes me crazy. Ok, i admit, i can be handy sometimes, but usually tracing produces the same information (and more) just as well. I it a matter of taste i guess. Did you notice that Femto OS comes with a trace facility to trace your tasks and the OS actions? It works (only) on Windows. It uses bitbanging on the parallel port. Yes i know ... i still have to write the docs for that ...

        It is possible to debug with Eclipse using cross platform GDB, but as said, i don't like that so much. Google for 'Eclipse GDB AVR' for more info, or look directly here:
        http://avr-eclipse.sourceforge.net/wiki/index.php/Debugging

        Then to the question why cygwin is used. It is possible to build avr-gcc without cygwin. Sure. Will all the other tools run natively under windows? Possibly, yes. But it will certainly not be possible to have one toolchain installer that runs under Linux, Windows and Mac alike. Thus, this is most of all a management problem. It would be possible to make three different native distributions i guess, but i simply do not have the time to maintain that.

        On the other hand, the paths incorporated in the elf, are valid windows paths, except for the slashes. Can you no simply replace / for \ ? And subsequently load them in your debugger?

        I hope these tips bring you any further. Did you try to just compile the sources under WinAVR? Mabye that is a solution too. Start with the most easy examples first, but make sure WinAVR uses the same gcc version. I haven't tried is yet, maybe i will in the coming days.

        Regards,
        Ruud

         
    • Tobias Lawrenz

      Tobias Lawrenz - 2009-09-07

      sorry for the late answer, I had less time the last days.
      I tried to compile with AVR-Sudio, but this is not an easy task for me, because I'm not a gcc expert at all.  Anyway, the AVR IDE is awful (not even block copy/paste is supported) . I like cdt.
      Thanks for the link, it was very useful.
      I'm not a friend of tracing, for me, especially foreign code is much easier to understand while debugging. I will see. Unfortunately I have no port at all free,  tracing is not  implemented for RS232 output  too?
      Connecting to the jtag interface with cygwin was successful, I think I proceed the way with debugging via GDB/avarice on cygwin.

      Best regards,

      Tobias

       

Log in to post a comment.