Keil Logo

GENERAL: Removing Debugging Info Only From Some Modules


Information in this article applies to:

  • Keil PK51 All Versions

QUESTION

I have a C51 project that must be sent for external analysis, and I can't include debugging information for some .C modules. ( Intellectual Property Protection ). What procedures may I need to execute to be able to send my target with some "protected" modules?

ANSWER

The following example shows you one way to do this:

You may create a Target with two group folders. Call the first group Debug and the second one No Debugging Info, for example. Add all your source files that must have debug information to the Debug folder, and the files that can't have debug information to the No Debugging Info folder. Your project tree will look like this:

[]------+-Target 1
        |
        |----+---DEBUG ( Group 1 )
        |    |
        |    |---main.c
        |
        |----+---NO DEBUGGING INFO ( Group 2 )
             |
             |---nd1.c
             |---nd2.c
             |---print.c

Now go to Options for Target->Output and uncheck Debug information and Browse Information checkboxes. This action disables debug information for the whole Target. You also need to disable ALL listing files by going to Target->Listing and unchecking ALL the items.

The next step is to enable debug information for Group 1 and re-disable it for Group 2. To do this, go to Options for group 'Debug'->C51, and at Misc Controls add the following command: OBJECTEXTEND DEBUG.

Build your target and replace all .C files inside the No Debugging Info group by their generated .OBJ files. If you don't want somebody to read your .C source code, you may delete the replaced .C files. Your project tree will look like this:

[]------+-Target 1
        |
        |----+---DEBUG ( Group 1 )
        |    |
        |    |---main.c
        |
        |----+---NO DEBUGGING INFO ( Group 2 )
             |
             |---nd1.obj
             |---nd2.obj
             |---print.obj

Build your target again and now you don't have debugging information available for Group 2. In this example, if main.c calls several functions inside other modules, you will not be able to see debug information related to those functions.

You may enable your Target listing files again because no listing will be generated to your .OBJ files.

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.