Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gdbserver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
gdbserver
Commits
766580cc
Verified
Commit
766580cc
authored
Jun 22, 2020
by
jD91mZM2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vCont on Redox
parent
7edaeb06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
29 deletions
+34
-29
Cargo.lock
Cargo.lock
+10
-1
src/os/redox.rs
src/os/redox.rs
+24
-28
No files found.
Cargo.lock
View file @
766580cc
...
...
@@ -89,7 +89,7 @@ dependencies = [
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.56 (git+https://gitlab.redox-os.org/
redox-os/syscall
)",
"redox_syscall 0.1.56 (git+https://gitlab.redox-os.org/
jD91mZM2/syscall?branch=ptrace-fexec
)",
"strace 0.1.0 (git+https://gitlab.redox-os.org/redox-os/strace-redox)",
"structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
]
...
...
@@ -183,6 +183,14 @@ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.56"
source = "git+https://gitlab.redox-os.org/jD91mZM2/syscall?branch=ptrace-fexec#c23d36e8923b8087039c26fcde3c359b5e0accc7"
dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex"
version = "1.3.9"
...
...
@@ -373,6 +381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
"checksum redox_syscall 0.1.56 (git+https://gitlab.redox-os.org/jD91mZM2/syscall?branch=ptrace-fexec)" = "<none>"
"checksum redox_syscall 0.1.56 (git+https://gitlab.redox-os.org/redox-os/syscall)" = "<none>"
"checksum regex 1.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
...
...
src/os/redox.rs
View file @
766580cc
...
...
@@ -50,6 +50,13 @@ impl FromOsError<syscall::Error> for Box<dyn std::error::Error> {
}
}
fn
stopped
()
->
usize
{
let
status
=
(
SIGSTOP
<<
8
)
|
0x7f
;
assert
!
(
syscall
::
wifstopped
(
status
));
assert_eq!
(
syscall
::
wstopsig
(
status
),
SIGSTOP
);
status
}
macro_rules!
e
{
(
$result:expr
)
=>
{{
match
$result
{
...
...
@@ -326,40 +333,29 @@ impl super::Target for Os {
let
mut
tracer
=
self
.tracer
.borrow_mut
();
e!
(
tracer
.next
(
strace
::
Flags
::
STOP_SINGLESTEP
));
let
rip
=
e!
(
tracer
.regs
.get_int
())
.rip
;
// Just pretend ptrace SIGSTOP:ped this
let
status
=
(
SIGSTOP
<<
8
)
|
0x7f
;
assert
!
(
syscall
::
wifstopped
(
status
));
assert_eq!
(
syscall
::
wstopsig
(
status
),
SIGSTOP
);
self
.last_status
.set
(
status
);
Ok
(
None
)
// unsafe {
// Ok(
// if libc::WIFSTOPPED(self.last_status.get())
// && libc::WSTOPSIG(self.last_status.get()) == libc::SIGTRAP
// {
// let rip = e!(libc::ptrace(
// libc::PTRACE_PEEKUSER,
// self.pid,
// libc::RIP as usize * mem::size_of::<usize>()
// ));
// Some(rip as u64)
// } else {
// None
// },
// )
// }
self
.last_status
.set
(
stopped
());
Ok
(
Some
(
rip
as
_
))
}
fn
cont
(
&
self
,
_
signal
:
Option
<
u8
>
)
->
Result
<
()
>
{
let
mut
tracer
=
self
.tracer
.borrow_mut
();
e!
(
tracer
.next
(
strace
::
Flags
::
STOP_BREAKPOINT
));
// Just pretend ptrace SIGSTOP:ped this
let
status
=
(
SIGSTOP
<<
8
)
|
0x7f
;
assert
!
(
syscall
::
wifstopped
(
status
));
assert_eq!
(
syscall
::
wstopsig
(
status
),
SIGSTOP
);
self
.last_status
.set
(
status
);
match
tracer
.next
(
strace
::
Flags
::
STOP_BREAKPOINT
)
{
Ok
(
_
)
=>
{
// Just pretend ptrace SIGSTOP:ped this
self
.last_status
.set
(
stopped
());
},
Err
(
err
)
if
err
.raw_os_error
()
==
Some
(
syscall
::
ESRCH
)
=>
{
let
mut
status
=
0
;
e!
(
syscall
::
waitpid
(
0
,
&
mut
status
,
WNOHANG
));
self
.last_status
.set
(
status
);
},
Err
(
err
)
=>
e!
(
Err
(
err
)),
};
Ok
(())
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment