Home > Backend Development > C++ > Why is GDB throwing an error about a missing raise.c file even though I'm catching an exception?

Why is GDB throwing an error about a missing raise.c file even though I'm catching an exception?

Patricia Arquette
Release: 2024-11-10 06:57:02
Original
1024 people have browsed it

Why is GDB throwing an error about a missing raise.c file even though I'm catching an exception?

GDB Error: Missing raise.c File

When running GDB to debug a program, users may encounter an error message complaining about the missing raise.c file. This occurs despite catching an exception. To resolve this issue, it is necessary to prepare GDB for full-source-code debugging of the C library.

  1. Install Debuginfo Version of Libc6:

    If not already installed, install the debuginfo version of libc6 using:

  2. Prepare Package System:

    Ensure the package system can process source code packages by:

    • Installing dpkg-dev: sudo apt install dpkg-dev
    • Checking for deb-src lines in /etc/apt/sources.list (unycomment if necessary)
    • Updating the repositories: sudo apt update
  3. Download Source Code:

    • Create a directory (e.g., /opt/src)
    • Download the source code for the installed C library version:

    • Note the directory name (e.g., /opt/src/glibc-2.23)
  4. Configure GDB:

    Determine the directory where GDB expects the source code by running (gdb) info source within GDB. Specify the correct directory path using (gdb) set substitute-path or move the source code to the expected location.

The above is the detailed content of Why is GDB throwing an error about a missing raise.c file even though I'm catching an exception?. For more information, please follow other related articles on the PHP Chinese website!

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