if (reg->valid == true) {
LOG_DEBUG("examining dirty reg: %s", reg->name);
- LOG_DEBUG("writing register %i "
- "with value 0x%8.8" PRIx32, i, buf_get_u32(reg->value, 0, 32));
+ LOG_DEBUG("writing register %d with value 0x%8.8" PRIx32,
+ i, buf_get_u32(reg->value, 0, 32));
reg_arch_info = reg->arch_info;
if (FD0 <= reg_arch_info->num && reg_arch_info->num <= FD31)
int nds32_resume(struct target *target, int current,
uint32_t address, int handle_breakpoints, int debug_execution)
{
- LOG_DEBUG("current %d address %08" PRIx32 " handle_breakpoints %d debug_execution %d",
+ LOG_DEBUG("current %d address %08" PRIx32
+ " handle_breakpoints %d"
+ " debug_execution %d",
current, address, handle_breakpoints, debug_execution);
struct nds32 *nds32 = target_to_nds32(target);
switch (syscall_id) {
case NDS32_SYSCALL_EXIT:
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "exit");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_OPEN:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "open");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of path */
}
break;
case NDS32_SYSCALL_CLOSE:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "close");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_READ:
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "read");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
break;
case NDS32_SYSCALL_WRITE:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "write");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
break;
case NDS32_SYSCALL_LSEEK:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "lseek");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
case NDS32_SYSCALL_UNLINK:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "unlink");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of path */
case NDS32_SYSCALL_RENAME:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "rename");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_FSTAT:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "fstat");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
case NDS32_SYSCALL_STAT:
{
uint8_t filename[256];
- fileio_info->identifier = (char *)malloc(5);
+ fileio_info->identifier = malloc(5);
sprintf(fileio_info->identifier, "stat");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_GETTIMEOFDAY:
- fileio_info->identifier = (char *)malloc(13);
+ fileio_info->identifier = malloc(13);
sprintf(fileio_info->identifier, "gettimeofday");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
break;
case NDS32_SYSCALL_ISATTY:
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "isatty");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
break;
case NDS32_SYSCALL_SYSTEM:
{
uint8_t command[256];
- fileio_info->identifier = (char *)malloc(7);
+ fileio_info->identifier = malloc(7);
sprintf(fileio_info->identifier, "system");
nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
/* reserve fileio_info->param_2 for length of old path */
}
break;
case NDS32_SYSCALL_ERRNO:
- fileio_info->identifier = (char *)malloc(6);
+ fileio_info->identifier = malloc(6);
sprintf(fileio_info->identifier, "errno");
nds32_set_mapped_reg(nds32, R0, nds32->virtual_hosting_errno);
break;
default:
- fileio_info->identifier = (char *)malloc(8);
+ fileio_info->identifier = malloc(8);
sprintf(fileio_info->identifier, "unknown");
break;
}
int nds32_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, bool ctrl_c)
{
- LOG_DEBUG("syscall return code: 0x%x, errno: 0x%x, ctrl_c: %s",
+ LOG_DEBUG("syscall return code: 0x%x, errno: 0x%x , ctrl_c: %s",
retcode, fileio_errno, ctrl_c ? "true" : "false");
struct nds32 *nds32 = target_to_nds32(target);