puncover icon indicating copy to clipboard operation
puncover copied to clipboard

nothing in stack column

Open ali-rostami opened this issue 1 year ago • 3 comments

Hi there, Recently I came across Puncover. It is a very nice and useful tool. But unfortunately, it doesn’t show me anything in the stack column. Folders are also unknown! image So would you please help me with this?

ali-rostami avatar Dec 18 '23 13:12 ali-rostami

I had the same issue.

  1. Make sure you compile with -fstack-usage
  2. Point --build-dir to the build dir with the newly created .su files
  3. My compiler's objdump doesn't contain filenames, which puncover is looking for, so no symbols match. Check with $CROSS_COMPILE-objdump -dslw file.elf If you don't see filenames with the function names, this is a problem. Maybe there's a compile option to include it, but I didn't go this route. Instead, I modified the code to just match by function name and ignore filename and line

collector.py:

-        basename_symbols = [s for s in self.symbols.values() if s.get(BASE_FILE, None) == base_file_name]    
+        basename_symbols = [s for s in self.symbols.values() ]
-            if symbol.get(LINE, None) == line or self.display_names_match(symbol_name, symbol.get(DISPLAY_NAME, None)):
+            if self.display_names_match(symbol_name, symbol.get(DISPLAY_NAME, None)):

lawm avatar Dec 27 '23 20:12 lawm

Hi @lawm , thank you so much for your response. 🙂🙏 when I add --build-dir like this:

python runner.py --elf_file ../myProject/prj/stm32-build/build/myProject-debug.elf --build_dir ../myProject/prj/stm32-build/build/

it gives me so many warnings like this:

WARNING:  Couldn't find symbol for stm32g4xx_hal_pcd.c:2047:HAL_PCD_EP_DB_Transmit

I also tried your modification(3) unfortunately it didn't help. It seems to me I should focus on the warnings. Do you have any idea about it?

ali-rostami avatar Jan 04 '24 14:01 ali-rostami

no, you'll have to debug it

lawm avatar Jan 04 '24 19:01 lawm