Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nothing in stack column #99

Open
ali-rostami opened this issue Dec 18, 2023 · 3 comments
Open

nothing in stack column #99

ali-rostami opened this issue Dec 18, 2023 · 3 comments

Comments

@ali-rostami
Copy link

ali-rostami commented Dec 18, 2023

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?

@lawm
Copy link

lawm commented Dec 27, 2023

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)):

@ali-rostami
Copy link
Author

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?

@lawm
Copy link

lawm commented Jan 4, 2024

no, you'll have to debug it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants