mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
e22b4007d3
The following files were deleted: - components/esp_hw_support/include/soc/cpu.h - components/soc/esp32s3/include/soc/cpu.h The following functions are deprecated: - get_sp() The following functions declared in soc/cpu.h are now moved to esp_cpu.h: - esp_cpu_configure_region_protection() The following functions declared in soc/cpu.h are now moved to components/xtensa/include/esp_cpu_utils.h: - esp_cpu_process_stack_pc() All files with soc/cpu.h inclusion are updated to include esp_cpu.h instead. Signed-off-by: Sudeep Mohanty <sudeep.mohanty@espressif.com>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
/*
|
|
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#include <string.h>
|
|
#include "esp_gdbstub.h"
|
|
#include "esp_gdbstub_common.h"
|
|
#include "sdkconfig.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
|
|
static void init_regfile(esp_gdbstub_gdb_regfile_t *dst)
|
|
{
|
|
memset(dst, 0, sizeof(*dst));
|
|
}
|
|
|
|
void esp_gdbstub_frame_to_regfile(const esp_gdbstub_frame_t *frame, esp_gdbstub_gdb_regfile_t *dst)
|
|
{
|
|
init_regfile(dst);
|
|
dst->pc = frame->mepc;
|
|
|
|
// We omit register x0 here since it's the zero register and always hard-wired to 0.
|
|
// See The RISC-V Instruction Set Manual Volume I: Unprivileged ISA Document Version 20191213 for more details.
|
|
memcpy(&(dst->x[1]), &frame->ra, sizeof(uint32_t) * 31);
|
|
}
|
|
|
|
#ifdef CONFIG_ESP_GDBSTUB_SUPPORT_TASKS
|
|
|
|
/* Represents FreeRTOS TCB structure */
|
|
typedef struct {
|
|
uint8_t *top_of_stack;
|
|
/* Other members aren't needed */
|
|
} dummy_tcb_t;
|
|
|
|
|
|
void esp_gdbstub_tcb_to_regfile(TaskHandle_t tcb, esp_gdbstub_gdb_regfile_t *dst)
|
|
{
|
|
const dummy_tcb_t *dummy_tcb = (const dummy_tcb_t *) tcb;
|
|
|
|
const RvExcFrame *frame = (RvExcFrame *) dummy_tcb->top_of_stack;
|
|
esp_gdbstub_frame_to_regfile(frame, dst);
|
|
}
|
|
|
|
#endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS
|
|
|
|
int esp_gdbstub_get_signal(const esp_gdbstub_frame_t *frame)
|
|
{
|
|
return 5; // SIGTRAP, see IDF-2490
|
|
}
|
|
|
|
void _xt_gdbstub_int(void * frame)
|
|
{
|
|
|
|
}
|