Keil™, An ARM® Company

Discussion Forum

Linker configuration or debuggable libraries

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Author
Jan Raddatz
Posted
27-Nov-2009 10:19 GMT
Toolset
ARM
New! Linker configuration or debuggable libraries

Hello forum,
I've got the following situation:
I am writing a huge library in C++ with many classes. My Cortex-M3 applications are using this library. Right now I am putting the library source files together with the application source files into the same project. This has one reason. I tried to build a dedicated library which is then linked to my application. Sadly I did not find a way to debug my application aaand step into library funtions. The uVision debugger is just showing the library assembler code.

The problem is as follows:
- When putting library and application code together the linker is also linking the unused library code into the executable which leads to blow up of my executables size.

- When building the library as dedicated code library I can't debug the library source code.

So my question is:
1st: Is there a way to tell the linker to ignore unused code/c++ classes?

2nd: Is there a way that I have not yet revealed to debug an application and an attached library so that I can single step through the application as well as the library code?

Thanks a lot in advance!
Best regards
Jan

Author
Tamir Michael
Posted
27-Nov-2009 10:47 GMT
Toolset
ARM
New! RE: Linker configuration or debuggable libraries

1. I thought it was the default behavior, unless specified otherwise by the --keep token (see linker documentation).
2. you need the source to be present and build in the project - and debug information enabled.

Author
Robert Rostohar
Posted
27-Nov-2009 10:54 GMT
Toolset
ARM
New! RE: Linker configuration or debuggable libraries

Libraries can also be debugged at source level.

First build the libraries with debug information. Then when debugging the application which uses this library just execute the "SET SRC=path_to_library_source" command which will tell the debugger where the library source files used to build the library are located. After that you should be able to debug the library at source level.

Author
Jan Raddatz
Posted
27-Nov-2009 11:06 GMT
Toolset
ARM
New! RE: Linker configuration or debuggable libraries

Great! I tried it and it works!
Thanks a lot you two!

Best regards!
Jan

Next Thread | Thread List | Previous Thread Start a Thread | Settings