rr-debugger / rr-debugger/rr

Support loading symbols for shared libraries from the trace

Open
#2,090 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.7k
Forks
662
Avg merge
2d 3h
Merged PRs (30d)
2

Description

Currently gdb tries to load symbols for shared libraries by grabbing the file names from tracee memory and trying to read those files in the local filesystem. That won't work well when the local files have changed or are simply not there. In those cases gdb needs to read symbols from files in our trace.

In 6b272d5a27a73c071ed492db0e4a2ccfcb04536f we added support for vFile in the remote protocol, and gdb would normally use this to load files from the remote target, but we disabled that by forcing set sysroot /. If we remove that command then gdb will request files from rr, so in principle we could return the contents of files from our trace, but there are a couple of problems:

  • Shoveling large files through the remote protocol socket is slow. I don't think there's much we can do about this without modifying gdb.
  • The filenames in tracee memory (and thus supplied by gdb) often refer to symbolic links to the real files. The "original file names" in the rr trace are obtained from /proc/.../maps, which gives the real names. Thus, identifying the correct trace file for the name provided by gdb is difficult.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rr’s vFile handling and the code that disables remote file access via set sysroot /; compare filenames from tracee memory with the original names recorded by /proc/.../maps. Define a way for GDB to obtain shared-library symbols from the trace, including symbolic-link resolution, and verify loading works without relying on changed local files.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
devtools, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.