Esempio n. 1
0
/* Send file close request to gdb on behalf of mbed LocalFileSystem.

    Data Format: Fclose,ff
    
    Where ff is the hex value of the file descriptor to be closed.
*/
int IssueGdbFileCloseRequest(uint32_t fileDescriptor)
{
    static const char  gdbCloseCommand[] = "Fclose,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbCloseCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, fileDescriptor);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}
Esempio n. 2
0
/* Send file unlink request to gdb on behalf of mbed LocalFileSystem.

    Data Format: Funlink,ff/nn
    
    Where ff is the hex representation of the address of the filename to be deleted.
          nn is the hex value of the count of characters in the filename pointed to by ff.
*/
int IssueGdbFileUnlinkRequest(const RemoveParameters* pParameters)
{
    static const char  gdbUnlinkCommand[] = "Funlink,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbUnlinkCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->filenameAddress);
    Buffer_WriteChar(pBuffer, '/');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->filenameLength + 1);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}
Esempio n. 3
0
/* Send file read request to gdb on behalf of mbed LocalFileSystem or stdin.

    Data Format: Fread,ff,pp,cc
    
    Where ff is the hex value of the file descriptor of the file from which the data should be read.
          pp is the hex representation of the buffer to be read into.
          cc is the hex value of the count of bytes in the buffer to be read from the specified file.
*/
int IssueGdbFileReadRequest(const TransferParameters* pParameters)
{
    static const char  gdbReadCommand[] = "Fread,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbReadCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->fileDescriptor);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->bufferAddress);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->bufferSize);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}
Esempio n. 4
0
/* Send file seek request to gdb on behalf of mbed LocalFileSystem.

    Data Format: Flseek,ff,oo,ww
    
    Where ff is the hex value of the file descriptor to be seeked within.
          oo is the hex value of the signed offset for the seek.
          ww is the hex value of the flag indicating from where the seek should be conducted (whence.)
*/
int IssueGdbFileSeekRequest(const SeekParameters* pParameters)
{
    static const char  gdbSeekCommand[] = "Flseek,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbSeekCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->fileDescriptor);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteIntegerAsHex(pBuffer, pParameters->offsetFromStart);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteIntegerAsHex(pBuffer, SEEK_SET);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}
Esempio n. 5
0
/* Send file open request to gdb on behalf of mbed LocalFileSystem.

    Data Format: Fopen,ff/nn,mm
    
    Where ff is the hex representation of the address of the filename to be opened.
          nn is the hex value of the count of characters in the filename pointed to by ff.
          mm is the hex value of the mode to be used for the file open.
*/
int IssueGdbFileOpenRequest(const OpenParameters* pParameters)
{
    static const char  gdbOpenCommand[] = "Fopen,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbOpenCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, (uint32_t)(size_t)pParameters->pFilename);
    Buffer_WriteChar(pBuffer, '/');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->filenameLength + 1);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->flags);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->mode);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}
Esempio n. 6
0
/* Send file rename request to gdb.

    Data Format: Frename,oo/aa,nn/bb
    
    Where oo is the hex representation of the address of the original filename.
          aa is the hex value of the count of characters in the original filename pointed to by oo.
          nn is the hex representation of the address of the new filename.
          bb is the hex value of the count of characters in the new filename pointed to by nn.
*/
int IssueGdbFileRenameRequest(const RenameParameters* pParameters)
{
    static const char  gdbCommand[] = "Frename,";
    Buffer*            pBuffer = GetInitializedBuffer();

    Buffer_WriteString(pBuffer, gdbCommand);
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->origFilenameAddress);
    Buffer_WriteChar(pBuffer, '/');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->origFilenameLength);
    Buffer_WriteChar(pBuffer, ',');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->newFilenameAddress);
    Buffer_WriteChar(pBuffer, '/');
    Buffer_WriteUIntegerAsHex(pBuffer, pParameters->newFilenameLength);
    
    SendPacketToGdb();
    return processGdbFileResponseCommands();
}