Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PAL_IsDebuggerPresent for SunOS #37273

Merged
merged 1 commit into from
Jun 8, 2020
Merged

Implement PAL_IsDebuggerPresent for SunOS #37273

merged 1 commit into from
Jun 8, 2020

Conversation

am11
Copy link
Member

@am11 am11 commented Jun 1, 2020

On illumos and Solaris, unlike Linux, /proc/{pid}/status does not:

  • return a textual representation
  • contain TracerPID: when debugger is attached

Instead it returns data for struct pstatus_t.

When the debugger is attached, the flags are set in fltset_t pr_flttrace field, where fltset_t is defined as a struct wrapping int word[4] and it is described in proc(4) as /* set of traced faults */.

I have tested it under the debugger and this (zero'th) index is always set.


Also:

  • fix some fatal warnings (as-error) in palsuite, reported by gcc 8.4 in illumos sysroot.
  • fix some non-fatal warnings in JIT, reported by gcc 8 and also in CI, with gcc 7.

Contributes to: #34944.

@am11
Copy link
Member Author

am11 commented Jun 1, 2020

Some of the remaining gcc warnings have explanation in code:

src/coreclr/src/jit/codegenxarch.cpp:2510:54: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
src/coreclr/src/jit/codegenxarch.cpp:83:54: warning: comparison of integer expressions of different signedness: 'int' and 'GSCookie' {aka 'long unsigned int'} [-Wsign-compare]
src/coreclr/src/jit/emitxarch.cpp:7069:89: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
src/coreclr/src/jit/emitxarch.cpp:7105:77: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]

and all the rest are related to #33541.

@am11
Copy link
Member Author

am11 commented Jun 1, 2020

cc @janvorli, @jclulow

@am11 am11 marked this pull request as ready for review June 1, 2020 22:29
@janvorli
Copy link
Member

janvorli commented Jun 2, 2020

The PAL and PAL tests changes look good.
@dotnet/jit-contrib can someone please review the jit changes?

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor request

src/coreclr/src/jit/importer.cpp Outdated Show resolved Hide resolved
@BruceForstall
Copy link
Member

@am11 can you push an update (e.g., rebase to master) to force the tests to run again, and hope they don't have infrastructure failures?

@am11
Copy link
Member Author

am11 commented Jun 7, 2020

@BruceForstall, rebased to master.

@BruceForstall BruceForstall merged commit b143003 into dotnet:master Jun 8, 2020
@am11 am11 deleted the feature/sunos/debugger branch June 8, 2020 06:00
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants