Cart New Account Login

HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
Main Disappeared
Robert R. Nov 14, 2016 at 04:39 PM (16:39 hours)
Staff: Takao Y.

  • Hi, for some reason the Codewarrior 6.3 debugger the file my "main" entry point in is not listed and I get a warning that main cannot be found so obviously no breakpoint gets set on startup.  I checked my map file and both the file and main entry points are listed.  Any idea why this is happening?  All the other files are there.  This seems to have just started happening last week for some reason. Thanks,




    Comments

  • Greetings,

    Are you building your code within Codewarrior? Or are you loading an ELF file that was compiled somewhere else?

    Did you make any changes to firmware of your P&E hardware recently?


    Takao Yamada

  • Hi, I am using the complete Codewarrior IDE.  The ELF file was produced by the Codewarrior Coldfire compiler inside the IDE.  The only changes I made was to update the P&E drivers to support the Multilink Universal under CW 6.3 as instructed by one of your other Tech Support people.

  • Greetings,

    If you create a brand new project within Codewarrior 6.3 and try to debug, are you able to breakpoint to main and run the simple code? If so, then something must be wrong within your project.

    Are you able to place a breakpoint anywhere?


    Takao Yamada

  • Hi, All files show up except the file with main in it.  I can breakpoint.  I know something must be wrong but what?  It all compiles fine, the map shows main, I can breakpoint in other files.  I am just trying to figure out how to fix this.  Where should I look?  Thanks,

  • Greetings,

    Have you made changes to pathing recently? For example, moving the main.c file or changing compiler settings?

    Did you create a new project yet? This is important because this can help point to whether it is a problem within or outside your project.


    Takao Yamada

  • Hi, no I have not made changes.  I will make a new project in a while and get back to you.  Thanks

  • Actually, now that I think of it, there is one change I made.  Since I build several projects off a common code base, the main.c file under the Codewarrior source directory is not used.  I get rid of it and I use file in another directory.  I checked all the preferences and cannot see where I would need to change anything else when making this change.  If there is, can you point me to it? Thanks,

  • Greetings,

    This is more of a question you need to ask NXP/Freescale. I can help you flash programming and debugging, but not the intricate details of the compiler or IDE settings. I am sure once you get this resolved that you will be able to get main.c to show up in the debug session.


    Takao Yamada

  • OK, I guess you may have hit something.  I do not use main.c, its called something else but still has a main function.  Does your software look for the file main.c and not just the function main?  Basically I have two files for the two builds, Bootloader.c and Firmware.c, each has a main function but each is used only for a particular target.  So, if your code is really looking for main.c to find the main function I need to change some things to be compatible with you. I am pretty sure this is an issue with how your software finds the function main as the code compiles, links and runs just fine.

  • Greetings,

    Our debugger will follow what the map file or ELF file says. If your main is within a different file, as long as the map file lists this correctly, then it will bring the file up correctly during debugging.

    If you no longer have a main function, then that is a different story. Our debugger does try to find the function "main" when placing a breakpoint. You can change this in the debug configurations to set a starting breakpoint somewhere else.


    Takao Yamada

  • I have a main function and it is definitely in the map file.  I can send you the map file if you would like to look at it.  I don't think there is a way to attach a file here.  Thanks.

  • I did a new project and it found main.  I guess this means that the problem is in the project but I am not sure how to track it down and I doubt NXP/Freescale can help as the project compiles, links and executes fine.  Its something about how your software recognizes the main function to set the breakpoint.  It is also not finding the file that main is in.  So, what does your software look at to include files and search for main?  Thanks,

  • So, is there any help you can offer me at this point or should I just deal with the issue?  I don't expect any help from NXP/Freescale since their tool chain seems to be working correctly.  Its just that your software seems to have an issue parsing what ever file it uses to find the file main is contained in and the function main itself.

  • Can you tell me what these errors mean?  They show up in the command window when the debugger is finished programming the flash. 

    Postload command file correctly executed.
    ^
    Error: unknown identifier
    ^
    Error: expression expected (use BS ? to query syntax)
    Stop at Function: No function with the name "main" was found.


    Thanks,

  • Greetings,

    Could you go to our support page -> support requests and submit a ticket with your map file and possibly the projects involved in this problem. That way I can try to replicate the problem and give you pointers.


    Takao Yamada

  • Done

Add comment


   Want to comment? Please login or create a new PEMicro account.







© 2017 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement