Debugging a Process from main() - 2021.2 English

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
UG1400
ft:locale
English (United States)
Release Date
2021-12-15
Version
2021.2 English

To debug a new process from main(), a global breakpoint (not against any particular target/context) should be set, before starting the process. Symbol files are loaded based on path map settings, so there should be a corresponding entry for the new process before starting it.

To debug a process from main():

  1. Select a project in the Project Explorer view.
  2. Select Debug As > Debug Configurations. The Debug Configurations view appears.
  3. Click the Path Map view to set the path mappings for the selected debug configuration. Path maps help enable source level debugging. The debugger uses Path Map setting to search and load symbols files for all executable files and shared libraries in the system.
  4. Set either the line breakpoint in the source file of the Linux application or function breakpoint at main(). Every time a new process starts, the debugger checks symbols of the process and plants the breakpoint in the process if the source file or the main() function is found in the symbols.
  5. Run the application from the terminal.
  6. As soon as the control hits a breakpoint, the Debug view is updated with the information of the process.
  7. The Debug view also shows the file, function and the line information of the breakpoint hit. A thread label includes the name of the CPU core, if the thread is currently running on a core.
  8. Source level debugging such as stepping in, stepping out, watching variables, stack trace can be performed. The target side path for a binary file does not include a mount point path. This is a known limitation. For example, when the process is located on the SD card, which is mounted at /mnt, the debugger shows the file as <filename> and not as the expected /mnt/<filename>.