0

I know that to get the symbol address of the lauterbach, Address.Offset() is used, but this command does not work for the static functions! the static symbol is not found. So what the command to get the address offset of the static symbol?

Khaled
  • 59
  • 1
  • 12

2 Answers2

1

I am using the GreenHills compiler. By adding / GHS option on the Data.Load.Elf, the problem is solved

Khaled
  • 59
  • 1
  • 12
0

I assume your compiler optimized your static function away e.g. including the function's body directly in the caller. Compilers may do this and if they do the entry symbol of the static function is no longer available and thus can't be used in any debugger.

So in your makefile, ensure that you compile code without optimizations (or less optimizations) and ensure that you compile for debugging. Or declare your function external. Or use some vendor specific compiler pragmas or attributes to preserve a static function.

Also ensure that your static function gets called - otherwise it can be also dumped by the compiler.

Holger
  • 3,920
  • 1
  • 13
  • 35
  • My compiler set to no optimization at all. – Khaled Dec 04 '15 at 10:40
  • I think you really have to provide more details. All we know for now is that TRACE32 can not see the entry-symbol of your static function. But which compiler are you using? How do you call the compiler? How do you call the linker? Which CPU architecture are you using? How do you load your ELF file in TRACE32? Is your static function somewhere called? – Holger Dec 04 '15 at 10:44
  • I also suggest to use a tool like GNU's "readelf" to check if your static function appears either in the ELF symbol table or in the DWARF debug information. – Holger Dec 04 '15 at 10:46
  • This makes actually sense. The Greenhills compiler has some rather uncommon ways to interpret the DWARF spec. This is why you have to give TRACE32 a hint with the /GHS option. Thanks for sharing your solution.. – Holger Dec 04 '15 at 12:07