gdb: extend maint print address-spaces to show all dbgapi available info - #218
gdb: extend maint print address-spaces to show all dbgapi available info#218czidev-amd wants to merge 1 commit into
Conversation
92c8d64 to
5158025
Compare
d609587 to
8c2130e
Compare
|
Pushed a new version with the next changes:
|
8c2130e to
d841773
Compare
|
Thank you @amd-shahab for your input, I have fix that and each error message will contain the returned error status too (as Pedro requested in #225) |
d841773 to
1934fd1
Compare
lumachad
left a comment
There was a problem hiding this comment.
Just nits. Take it or not, your choice.
|
|
||
| # The actual output isn't very important, we want to verify that GDB | ||
| # doesn't have any latent error. Moreover, the number of address | ||
| # spaces can vary, if one is setting a different architecture. |
There was a problem hiding this comment.
What does "setting a different architecture" mean?
Did you mean "testing"?
We do "set architecture amdgcn:gfx90a" above, though, so the architecture is fixed. So how can the premise that the output varies be true?
There was a problem hiding this comment.
Trailing message from previous refactoring, removing.
There was a problem hiding this comment.
Well, that still leaves the whole premise that lead to not parsing actual specific address spaces incorrect -- if we're hard coding one specific architecture, then we could make the testcase look closer to the address spaces that came out. OTOH, maybe we want instead to loop over all architectures and issue the command, to confirm that we (gdb, dbgapi, etc.) don't do anything bad in any.
There was a problem hiding this comment.
That (having a strict testcase for a specific architecture) was my initial draft, however, after speaking with Lancelot, I've simplified the test case to what we have right now. However, I can loop over a list of known architectures, and check if we crash or something of a sort.
There was a problem hiding this comment.
The issue with testing the values is: aperture configuration are not part of the ABI. Those are not expected to change often, but they could, and are different on Windows and Linux.
We could have "probe" kernels which we use to figure out the configuration and deduce valid conversions we want to test for if we really wanted to test conversion.
There was a problem hiding this comment.
You are thinking of the address alias PR instead? This PR is about listing this:
Name DWARF Addr Bits Null Address Access
global 0 64 0x0 all
generic 1 64 0x0 all
local 3 32 0xffffffff all
private_lane 5 32 0xffffffff all
private_wave 6 32 0xffffffff all
There was a problem hiding this comment.
ah, sorry for the confusion. Yes, I was thinking about the alias PR.
The list of address space supported is a per architecture, but we could teach GDB what to expect for here, and match the actual output.
There was a problem hiding this comment.
I have updated the test, now it loops over the gdb's known amdgpu arches and executes for each one the maintenance command. Please let me know if you want to strength more up the test. For example, null address can be either 0x0+ or 0xf+
1934fd1 to
11e9b8d
Compare
The maint print address-spaces command previously printed only a flat list of address-space names. Rewrite address_spaces_dump to query dbgapi for five properties per address space and emit them as a structured ui_out table: name, DWARF number, address size in bits, null address, and access class. A new helper, address_space_access_to_string, maps the amd_dbgapi_address_space_access_t enum to a human-readable string (all, program-constant, dispatch-constant). The command help text and the maint print address-spaces section in gdb.texinfo are updated to document the new columns. A new test, gdb.rocm/maint-print-address-spaces.exp, runs the command, and checks that a header row and at least one data row are printed without error.
11e9b8d to
722c868
Compare
lancesix
left a comment
There was a problem hiding this comment.
Thanks, this LGTM.
Maybe give some time to other people who contributed reviews before merging see if they are happy to.
| Displays the address space names supported by the current architecture."), | ||
| Display address-space properties supported by the current architecture.\n\ | ||
| For each address space, print its name, DWARF id, address size,\n\ | ||
| null address, and access class."), |
There was a problem hiding this comment.
This still has the same problem:
Display address-space properties supported by the current architecture.\n\
The set of properties is fixed! What varies is the address spaces.
For each address space, print its name, DWARF id, address size,\n
null address, and access class."),
So this would be more correct:
Display properties of address spaces supported by the current architecture.\n
For each address space, print its name, DWARF id, address size,\n
null address, and access class."),
Motivation
The maint print address-spaces command previously printed only a flat list of address-space names. Rewrite address_spaces_dump to query dbgapi for five properties per address space and emit them as a structured ui_out table: name, DWARF number, address size in bits, null address, and access class.
Technical Details
A new helper, address_space_access_to_string, maps the amd_dbgapi_address_space_access_t enum to a human-readable string (all, program-constant, dispatch-constant). The command help text and the maint print address-spaces section in gdb.texinfo are updated to document the new columns.
Test Plan
A new test, gdb.rocm/maint-print-address-spaces.exp, runs the command, and checks that a header row and at least one data row are printed without error.
Submission Checklist