-
Notifications
You must be signed in to change notification settings - Fork 26
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 support for gdb-oneapi #43
Conversation
Several parts of the core_file_merger script had to be tweaked to make it run on Ubuntu 20.04 + python3.8 without any fatal errors. Unclear if it affects other debugger backends - seems so. In the gdb script on resume function, after sending continue command buffer is flushed to prevent deadlock. For serial attach scenario deadlock was inevitable on Ubuntu 20.04 + python3.8. Co-authored-by: Oguzhan Karakaya <oguzhan.karakaya@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test, please see comments in review
scripts/oneapi_gdb.py
Outdated
def parse_thread_info_line(line, parse_simd_lanes = False): | ||
""" | ||
Extracts thread IDs from a `thread info` output produced by | ||
Intel® Distribution for GDB*. See oneapi_gdb_test.py for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge deal, but when I run, I get a warning about a non-ascii character. I presume this is the R registered character. Can we change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@moguzhankarakaya if you can please address my comment, then I can merge your PR. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced non-ascii ® with (R). 👍🏻
scripts/oneapi_gdb.py
Outdated
logging.info('GDB thread bt ID %d', thread_id) | ||
ret = [] | ||
|
||
lines = self.communicate(f"thread apply {thread_id} bt") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I should deprecate Python 2 eventually, but I am not ready yet. In the meantime, this python 3 formatting string f" is causing warnings/errors:
invalid syntax (oneapi_gdb.py, line 172)
Can we revert this and other instances to the older string formatting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I can use older string formatting. I checked gdb.py and conformed the string formatting used there. In this case for example I changed
f"thread apply {thread_id} bt"
into
"thread apply %s bt" %thread_id
Corefile merger and generic gdb_oneapi driver is implemented. Frame parser is pretified and function names are abbreviated programmatically. Script "oneapi_gdb_test.py" is provided for testing regex parser methotds implemented for the driver. System test is done using stat serial attach mechanism. After setting STAT_GDB environment variable as gdb_oneapi, stat-cl -G -w -t 5 -I <PIDs to attach> can be run to generate bt graph. Additionally, STATmain merge --oneapi -c /path/to/core can be run to generate bt graph from core file. Co-authored-by: Oguzhan Karakaya <oguzhan.karakaya@intel.com>
Add a support to use gdb-oneapi backend along with some minor fixes.
Add a test suite for regexes used in oneapi-gdb.py.
Add a support to use core files with gdb-oneapi backend.