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

Add new debugger-log-level option to debug.mono.log #3969

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

grendello
Copy link
Contributor

XA runtime supports setting the Mono debugger log level by setting the
loglevel option of the Mono runtime's --debugger-agent paremeter via the
debug.mono.extra system property (set by the IDEs). However, it turns out that
the IDEs (via AndroidTools) always set the log level to 0. Fixing the issue
would require updates to AndroidTools and then IDEs, however.

To allow setting the debugger level without having to wait for the next IDE
release, this commit adds a new option to the debug.mono.log system property:

debugger-log-level=LEVEL

where LEVEL is a positive 32-bit signed integer or 0. This option will take
precedence when the level is set both in debug.mono.extra and debug.mono.log
system properties.

XA runtime supports setting the Mono debugger log level by setting the
`loglevel` option of the Mono runtime's `--debugger-agent` paremeter via the
`debug.mono.extra` system property (set by the IDEs). However, it turns out that
the IDEs (via AndroidTools) always set the log level to `0`. Fixing the issue
would require updates to AndroidTools and then IDEs, however.

To allow setting the debugger level without having to wait for the next IDE
release, this commit adds a new option to the `debug.mono.log` system property:

    debugger-log-level=LEVEL

where `LEVEL` is a positive 32-bit signed integer or 0. This option will take
precedence when the level is set both in `debug.mono.extra` and `debug.mono.log`
system properties.
@grendello grendello requested a review from jonpryor as a code owner November 27, 2019 17:06
@grendello grendello added the full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps) label Nov 27, 2019
@jonpryor jonpryor merged commit 83cd391 into dotnet:master Dec 5, 2019
@grendello grendello deleted the debugger-logging branch December 5, 2019 07:35
jonpryor pushed a commit that referenced this pull request Dec 12, 2019
The mono debugger infrastructure code supports a `loglevel` option,
which the mono debugger team would like to set.

In theory we have code to allow setting set it: the `debug.mono.extra`
system property can contain a `loglevel=LEVEL` option, which is
parsed by `mono_runtime_init()`/`parse_runtime_args()` when
constructing the options for use with `mono_jit_parse_options()`.

In practice, we don't: [all codepaths][0] which set `debug.mono.extra`
always hardcode `loglevel=0`, with no way to override it.

To allow the mono debugger team to *actually* set the `loglevel`
value, add a new `debugger-log-level=LEVEL` option for use with the
`debug.mono.log` system property:

	adb shell setprop debug.mono.log debugger-log-level=10

The `debug.mono.log` system property is comma-separated, so it can be
used with other options as well:

	adb shell setprop debug.mono.log timing,gref,debugger-log-level=10

The `LEVEL` value is a positive 32-bit signed integer or `0`.  This
option will take precedence when the level is set in both the
`debug.mono.extra` and `debug.mono.log` system properties.

[0]: https://github.com/xamarin/androidtools/blob/master/Xamarin.AndroidTools/Debugging/DebuggingExtensions.cs#L92-L102
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants