[GR-48384] Update GDB debugging support for Native Image with gdb-debughelpers.py.#8886
[GR-48384] Update GDB debugging support for Native Image with gdb-debughelpers.py.#8886graalvmbot wants to merge 2 commits intomasterfrom
Conversation
|
|
||
| ##### Limitations | ||
|
|
||
| The `print` still uses its default implementation, as there is no way to overwrite it, while still keeping the capability of the default `print` command. |
There was a problem hiding this comment.
Should be: The print command still uses ...
zakkak
left a comment
There was a problem hiding this comment.
That's very interesting, thanks @dominikmascherbauer!
I know this is still WIP, but I added a few comments for your consideration.
|
|
||
| The pretty printer also supports printing of the primitive value instead of a Java Object for boxed primitives. | ||
|
|
||
| Whenever printing is done via the `p` (alias for `print`) the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. |
There was a problem hiding this comment.
| Whenever printing is done via the `p` (alias for `print`) the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. | |
| Whenever printing is done via the `p` alias of the `print` command the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. |
|
|
||
| Whenever printing is done via the `p` (alias for `print`) the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. | ||
| This also applies for auto-completion when using the `p` command. | ||
| This means, if the static type is different to the runtime type, `print` uses the static types, which leaves finding out the runtime types and type casting to the user. |
There was a problem hiding this comment.
| This means, if the static type is different to the runtime type, `print` uses the static types, which leaves finding out the runtime types and type casting to the user. | |
| This means that if the static type is different to the runtime type, the `print` command uses the static types, which leaves finding out the runtime types and type casting to the user. |
| The pretty printer also supports printing of the primitive value instead of a Java Object for boxed primitives. | ||
|
|
||
| Whenever printing is done via the `p` (alias for `print`) the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. | ||
| This also applies for auto-completion when using the `p` command. |
There was a problem hiding this comment.
| This also applies for auto-completion when using the `p` command. | |
| This also applies for auto-completion when using the `p` alias. |
| Whenever printing is done via the `p` (alias for `print`) the pretty printer intercepts that call to perform type casts to the respective runtime types of Java Objects. | ||
| This also applies for auto-completion when using the `p` command. | ||
| This means, if the static type is different to the runtime type, `print` uses the static types, which leaves finding out the runtime types and type casting to the user. | ||
| Additionally, the `p` command understands Java field and array access and function calls for Java Objects. |
There was a problem hiding this comment.
| Additionally, the `p` command understands Java field and array access and function calls for Java Objects. | |
| Additionally, the `p` alias understands Java field and array access and function calls for Java Objects. |
|
|
||
| #### Options for controlling the behavior of the SVM Pretty Printer | ||
|
|
||
| In addition to the enhanced `p` command `svmhelpers.py` introduces some GDB parameters to customize the behavior of the SVM Pretty Printer. |
There was a problem hiding this comment.
| In addition to the enhanced `p` command `svmhelpers.py` introduces some GDB parameters to customize the behavior of the SVM Pretty Printer. | |
| In addition to the enhanced `p` alias, `svmhelpers.py` introduces some GDB parameters to customize the behavior of the SVM Pretty Printer. |
| * ##### svm-print-string-limit <int> | ||
|
|
||
| Allows to customize the maximum length for pretty printing Java Strings. | ||
| The default value is 200, set to -1 or _unlimited_ for unlimited printing of Java Strings. |
There was a problem hiding this comment.
I think wrapping the values in backtickes will make this more readable
| The default value is 200, set to -1 or _unlimited_ for unlimited printing of Java Strings. | |
| The default value is `200`, set to `-1` or `_unlimited_` for unlimited printing of Java Strings. |
If you agree please apply to the rest of the options as well.
| svmhelpers_py = join(mx.dependency('com.oracle.svm.hosted.image.debug').output_dir(), 'svmhelpers.py') | ||
|
|
||
| test_python_source_dir = join(test_source_path, 'com', 'oracle', 'svm', 'test', 'debug', 'helper') | ||
| gdb_utils_py = join(test_python_source_dir, 'gdb_util.py') |
There was a problem hiding this comment.
Where does this come from? Should it maybe be:
| gdb_utils_py = join(test_python_source_dir, 'gdb_util.py') | |
| gdb_utils_py = join(test_python_source_dir, 'gdb_helper.py') |
?
There was a problem hiding this comment.
Thanks for pointing that out, it's not needed here anymore, I forgot to remove it.
gdb_helper is now imported directly in the testscripts like that:
# add test directory to path to allow import of gdb_helper.py
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__))))
from gdb_helper import *
… Image debugging experience
Fixes the following mx issue:
```
Traceback (most recent call last):
File "/Users/lewurm/work/mx/src/mx/_impl/mx_gate.py", line 492, in gate
_run_gate(cleanArgs, args, tasks)
File "/Users/lewurm/work/mx/src/mx/_impl/mx_gate.py", line 793, in _run_gate
runner(args, tasks)
File "/Users/lewurm/work/graal-enterprise/graal-enterprise/mx.graal-enterprise/mx_graal_enterprise.py", line 308, in _enterprise_gate_runner
maxJavaCompliance = max([d.maxJavaCompliance() for d in mx.dependencies() if d.isJARDistribution()])
File "/Users/lewurm/work/mx/src/mx/_impl/support/comparable.py", line 50, in __lt__
return self._checked_cmp(other, lambda a, b: a < b)
File "/Users/lewurm/work/mx/src/mx/_impl/support/comparable.py", line 46, in _checked_cmp compar = self.__cmp__(other) # pylint: disable=assignment-from-no-return File "/Users/lewurm/work/mx/src/mx/_impl/mx_javacompliance.py", line 214, in __cmp__
return mx.compare(self._parts, other._parts)
AttributeError: 'NoneType' object has no attribute '_parts'
```
No description provided.