Cannot insert breakpoint / Cannot access memory using eclipse

Open
#2,450 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, linux

Research direction

Reproduce the recorded block program under Eclipse using the documented rrgdb setup and compare it with direct rr replay. Start at src/GdbServer.cc:1159 and inspect the breakpoint insertion and resume-request handling. Done means Eclipse can insert the breakpoint at main, continue execution, and avoid the reported assertion.

Written by the indexing model from the issue text.

Description

I am having a lot of trouble trying to use Mozilla rr together with eclipse.
I'm using eclipse 2019-12 (4.14.0) on Ubuntu 18.04 (fully updated).
I downloaded Mozilla rr using git pull. I built commit ac321e492e3c517ee5a26d990271728c55a732c67
last change by Kyle Huey on 2020-02-27.

I followed the build instructions from
https://github.com/mozilla/rr/wiki/Building-And-Installing

git clone https://github.com/mozilla/rr.git
mkdir obj && cd obj
cmake ../rr
make -j8
sudo make install

Then I manually built the 'block' test program:

gcc -g3 -I../rr/include -I../rr/src/test -I. ../rr/src/test/block.d -lpthread -o block

And then recorded its execution

rr record ./block

I can successfully replay this recording with rr directly, including inserting breakpoints. It all seems to work as intended there.

However, I have trouble trying to run this program under eclipse. I have set up an rrgdb script as per https://github.com/mozilla/rr/wiki/Using-rr-in-an-IDE . Note that eclipse has a breakpoint at main displayed in the Break tab. When I launch the debugging session under Eclipse, the Debugger Console says

0x00007fae688a3090 in _start () from /lib64/ld-linux-x86-64.so.2
(rr) cont
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x2e7c

If I then disable the breakpoint from the eclipse Break tab, then the following is displayed:

(rr) rr: /export/home/stanb/rr/rr/src/GdbServer.cc:1159: rr::GdbServer::ContinueOrStop rr:GdbServer:debug_one_step(rr:GdbRequest&): Assertion `req.is_resume_request()' failed.
(rr)

If I terminate the debugging session in eclipse and start a new one, and ensure that the breakpoint is disabled, then I can successfuly run the program. However, I cannot insert a breakpoint running under eclipse, which is a serious problem for a debugger.

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

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.

More from rr-debugger/rr

All issues in rr-debugger/rr

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.