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

Clarify how addressRange is supposed to be represented in Module event #424

Open
theIDinside opened this issue Aug 4, 2023 · 2 comments
Labels
under-discussion Issue is under discussion for relevance, priority, approach

Comments

@theIDinside
Copy link

theIDinside commented Aug 4, 2023

The spec says:

  /**
   * Address range covered by this module.
   */
  addressRange?: string;

In the Module type

It's entirely unclear (from what I gather) how this is supposed to be represented and I haven't been able to find any of the other types, requests or events reference a range of addresses as just one string. I think this probably needs some clarification. Is it supposed to be 0xba5 .. 0xf00 or 0x123:0x456, or 0x123...0x456 or 0x123,+0x80 or any other of the many ways to do it? I think a uniform way would be preferable. But even if the spec doesn't desire a uniform way to represent an address range, it's probably best to at least mention that it's implementation defined.

@connor4312
Copy link
Member

connor4312 commented Aug 4, 2023

I believe in the current state that this is only for display in UI's; it predated any other knowledge of memory in DAP, so the answer would be "whatever the adapter thinks is the best representation."

However, now that DAP has learned about disassembly and memory, perhaps we should allow associating a range more explicitly for interop with the disassemble request, e.g. two additional properties startAddress and endAddress whose formats are the same as DisassembleRequest.address...

@connor4312 connor4312 added the under-discussion Issue is under discussion for relevance, priority, approach label Aug 4, 2023
@theIDinside
Copy link
Author

theIDinside commented Aug 5, 2023

However, now that DAP has learned about disassembly and memory, perhaps we should allow associating a range more explicitly for interop with the disassemble request, e.g. two additional properties startAddress and endAddress whose formats are the same as DisassembleRequest.address...

I agree. Also, "bolting this down" probably will mean that less divergence happen here.

Perhaps a separate new type is to prefer? Like AddressRange: { start: string, end: string }. This way, if there is no range associated (with the module, in this case), the sub object in it's entirety is not serialized. It would also clearly state that, iff there is an addressRange field, both start and end will be defined (since its sub fields are not optional). What do you think?

That would make the field on Module look like:

addressRange: AddressRange?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

No branches or pull requests

2 participants