Bug 23464 - Attaching on FreeBSD using MI works, but yields a error
Summary: Attaching on FreeBSD using MI works, but yields a error
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: mi (show other bugs)
Version: 8.1
: P2 normal
Target Milestone: 8.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-30 09:53 UTC by Gleb Popov
Modified: 2018-11-14 16:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gleb Popov 2018-07-30 09:53:46 UTC
A simple way to reproduce the problem:

1. Start a long-running process:
# yes > /dev/null

2. Find out the PID:
# ps

3. Start gdb in MI mode:
# /usr/local/bin/gdb --nx --interpreter=mi2 -quiet

4. Try attaching:
-target-attach <pid>

This produces

=thread-group-started,id="i1",pid="2510"
=thread-created,id="1",group-id="i1"
^error,msg="Couldn't get registers: Device busy."
(gdb)
=library-loaded,id="/lib/libc.so.7",target-name="/lib/libc.so.7",host-name="/lib/libc.so.7",symbols-loaded="0",thread-group="i1",ranges=[{from="0x00000008002c3000",to="0x0000000800419f68"}]
=library-loaded,id="/libexec/ld-elf.so.1",target-name="/libexec/ld-elf.so.1",host-name="/libexec/ld-elf.so.1",symbols-loaded="0",thread-group="i1",ranges=[{from="0x000000080020a000",to="0x000000080022253e"}]
~"[Switching to LWP 100938 of process 2510]\n"
~"_write () at _write.S:3\n"
~"3\tPSEUDO(write)\n"
*stopped,frame={addr="0x000000080041878a",func="_write",args=[],file="_write.S",fullname="/usr/obj/usr/src/amd64.amd64/lib/libc/_write.S",line="3"},thread-id="1",stopped-threads="all"

So, it attaches fine, but produces error message:

^error,msg="Couldn't get registers: Device busy."

Any way to fix/workaround this?
Comment 1 Gleb Popov 2018-11-07 12:34:12 UTC
This seems to be fixed in 8.2. Feel free to close this.
Comment 2 Tom Tromey 2018-11-14 16:42:07 UTC
(In reply to Gleb Popov from comment #1)
> This seems to be fixed in 8.2. Feel free to close this.

Thanks!