Home > Backend Development > C++ > body text

Why is GDB complaining about a missing raise.c file?

Mary-Kate Olsen
Release: 2024-11-09 03:57:02
Original
645 people have browsed it

Why is GDB complaining about a missing raise.c file?

GDB is complaining about missing raise.c

When using GDB, you may encounter an annoying error message related to the missing raise.c file. This error occurs when GDB attempts to catch an exception.

To resolve this issue and enable full source code debugging of the C library on Ubuntu, follow these steps:

  1. Install libc6-dbg: Ensure you have the debuginfo version of libc6 installed. Use sudo apt install libc6-dbg to do this.
  2. Prepare for Source Code Download: Install dpkg-dev and grep for deb-src in /etc/apt/sources.list. If deb-src lines are commented out with #, uncomment them and run sudo apt update.
  3. Download Source Code: Navigate to a directory (e.g., /opt/src) and run apt source libc6. Find the downloaded source directory name (e.g., /opt/src/glibc-2.23).
  4. Adjust GDB Source Path: Run GDB and determine the expected source file location (info source). To correct the path, either move the source code to the expected location or use set substitute-path in GDB to point to the correct directory.

Once these steps are completed, GDB should display the correct source code line when an exception is caught, providing accurate debugging information.

The above is the detailed content of Why is GDB complaining about a missing raise.c file?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template