-
Notifications
You must be signed in to change notification settings - Fork 133
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
Support for a new WriteMemoryRequest if debuggee permits to #163
Comments
The "write" request makes sense. I'm not sure about the response--is the use case to return that if the write only partially succeeded? We also should have |
Exactly. My first proposition was to ensure that content has been updated correctly. For your second point, I was considering C/C++ debugging in a view which should not grow nor shrink memory size, but rather edit it in place. |
I'm not very familiar with C/++ debugging. Are there cases where a write to memory would fail? From the little C work I've done, wouldn't it either always succeed or (if the write was in an unallocated/freed area) segfault? |
On some devices/operating systems it could partially succeed if the address range crossed a memory page boundary such that some of the addresses were valid and writable while others were not. If we want to support partial failures, I wonder if we should have this return a 'bytesWritten' count instead of returning |
Good point, |
Thanks for the proposal and the subsequent discussion. Yes, I prefer the @gregg-miskelly you said:
This means that a Or is it enough to have a single |
@connor4312 I have created a new feature request for your comment from above:
|
There are two use cases I can think of for WriteMemoryRequest:
To support these two cases I would suggest:
|
Thanks everyone for the input. A new capability interface Capabilities {
/**
* The debug adapter supports the 'writeMemory' request.
*/
supportsWriteMemoryRequest?: boolean;
} For the
interface WriteMemoryArguments {
/**
* Memory reference to the base location to which data should be written.
*/
memoryReference: string;
/**
* Optional offset (in bytes) to be applied to the reference location before
* writing data. Can be negative.
*/
offset?: number;
/**
* Optional property to control partial writes. If true, the debug adapter should attempt to write memory
* even if the entire memory region is not writable. In such a case the debug adapter should stop after
* hitting the first byte of memory that cannot be written and return the number of bytes written in the
* response via the 'address' and 'bytesWritten' properties.
* If false or missing, a debug adapter should attempt to verify the region is writable before writing,
* and fail the response if it is not.
*/
allowPartial?: boolean;
/**
* Bytes to write, encoded using base64.
*/
data: string;
} For the
interface WriteMemoryResponse {
body?: {
/**
* Optional property that should be returned when 'allowPartial' is true to indicate the address
* of the first byte of data successfully written.
* Treated as a hex value if prefixed with '0x', or as a decimal value otherwise.
*/
address?: string;
/**
* Optional property that should be returned when 'allowPartial' is true to indicate the number
* of bytes starting from address that were successfully written.
*/
bytesWritten?: number;
};
} @gregg-miskelly @yannickowow @connor4312 |
I forgot to include the |
what's the semantics of the returned |
@puremourning your question about the In the In the @gregg-miskelly do you agree? |
Updated proposal: A new capability interface Capabilities {
/**
* The debug adapter supports the 'writeMemory' request.
*/
supportsWriteMemoryRequest?: boolean;
} For the
interface WriteMemoryArguments {
/**
* Memory reference to the base location to which data should be written.
*/
memoryReference: string;
/**
* Optional offset (in bytes) to be applied to the reference location before
* writing data. Can be negative.
*/
offset?: number;
/**
* Optional property to control partial writes. If true, the debug adapter
* should attempt to write memory even if the entire memory region is not
* writable. In such a case the debug adapter should stop after hitting the
* first byte of memory that cannot be written and return the number of bytes
* written in the response via the 'offset' and 'bytesWritten' properties.
* If false or missing, a debug adapter should attempt to verify the region is
* writable before writing, and fail the response if it is not.
*/
allowPartial?: boolean;
/**
* Bytes to write, encoded using base64.
*/
data: string;
} For the
interface WriteMemoryResponse extends Response {
body?: {
/**
* Optional property that should be returned when 'allowPartial' is true to
* indicate the offset of the first byte of data successfully written. Can
* be negative.
*/
offset?: number;
/**
* Optional property that should be returned when 'allowPartial' is true to
* indicate the number of bytes starting from address that were successfully
* written.
*/
bytesWritten?: number;
};
} @gregg-miskelly @yannickowow @connor4312 @puremourning |
Hi,
In order to implement a full set of debug tools from DAP, I would like if it would be ok to implement a request such as
WriteMemoryRequest
, the same way it works forReadMemoryRequest
For the response, I don't know if it can be the same way as ReadMemoryResponse. It can also be a new Memory event with a flag 'modified' and a content/address
Thanks in advance
The text was updated successfully, but these errors were encountered: