* see the code in gdb_read_memory_packet() for further explanations */
int gdb_report_data_abort = 0;
* see the code in gdb_read_memory_packet() for further explanations */
int gdb_report_data_abort = 0;
-int gdb_last_signal_packet(struct connection *connection, target_t *target, char* packet, int packet_size)
+int gdb_last_signal_packet(struct connection *connection, struct target *target, char* packet, int packet_size)
-void gdb_target_to_reg(target_t *target, char *tstr, int str_len, uint8_t *bin)
+void gdb_target_to_reg(struct target *target, char *tstr, int str_len, uint8_t *bin)
-int gdb_get_registers_packet(struct connection *connection, target_t *target, char* packet, int packet_size)
+int gdb_get_registers_packet(struct connection *connection, struct target *target, char* packet, int packet_size)
reg_packet_p = reg_packet;
for (i = 0; i < reg_list_size; i++)
{
gdb_str_to_target(target, reg_packet_p, reg_list[i]);
reg_packet_p = reg_packet;
for (i = 0; i < reg_list_size; i++)
{
gdb_str_to_target(target, reg_packet_p, reg_list[i]);
- gdb_put_packet(connection, reg_packet, CEIL(reg_packet_size, 8) * 2);
+ gdb_put_packet(connection, reg_packet, DIV_ROUND_UP(reg_packet_size, 8) * 2);
-int gdb_set_registers_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_set_registers_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
if (packet_p + chars > packet + packet_size)
{
LOG_ERROR("BUG: register packet is too small for registers");
}
if (packet_p + chars > packet + packet_size)
{
LOG_ERROR("BUG: register packet is too small for registers");
}
gdb_target_to_reg(target, packet_p, chars, bin_buf);
gdb_target_to_reg(target, packet_p, chars, bin_buf);
- /* get register arch_type, and call set method */
- arch_type = register_get_arch_type(reg_list[i]->arch_type);
-
- arch_type->set(reg_list[i], bin_buf);
+ reg_list[i]->type->set(reg_list[i], bin_buf);
-int gdb_get_register_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_get_register_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
- gdb_put_packet(connection, reg_packet, CEIL(reg_list[reg_num]->size, 8) * 2);
+ gdb_put_packet(connection, reg_packet, DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2);
-int gdb_set_register_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_set_register_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
- bin_buf = malloc(CEIL(reg_list[reg_num]->size, 8));
- int chars = (CEIL(reg_list[reg_num]->size, 8) * 2);
+ bin_buf = malloc(DIV_ROUND_UP(reg_list[reg_num]->size, 8));
+ int chars = (DIV_ROUND_UP(reg_list[reg_num]->size, 8) * 2);
/* fix!!! add some sanity checks on packet size here */
gdb_target_to_reg(target, separator + 1, chars, bin_buf);
/* fix!!! add some sanity checks on packet size here */
gdb_target_to_reg(target, separator + 1, chars, bin_buf);
- /* get register arch_type, and call set method */
- arch_type = register_get_arch_type(reg_list[reg_num]->arch_type);
- arch_type->set(reg_list[reg_num], bin_buf);
+ reg_list[reg_num]->type->set(reg_list[reg_num], bin_buf);
-int gdb_read_memory_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_read_memory_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
-int gdb_write_memory_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_write_memory_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
-int gdb_write_memory_binary_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_write_memory_binary_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
-int gdb_step_continue_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_step_continue_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
-int gdb_breakpoint_watchpoint_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_breakpoint_watchpoint_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
- flash_bank_t *b1, *b2;
- b1=*((flash_bank_t **)a);
- b2=*((flash_bank_t **)b);
+ struct flash_bank *b1, *b2;
+ b1=*((struct flash_bank **)a);
+ b2=*((struct flash_bank **)b);
-int gdb_query_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_query_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
struct gdb_connection *gdb_connection = connection->priv;
if (strstr(packet, "qRcmd,"))
struct gdb_connection *gdb_connection = connection->priv;
if (strstr(packet, "qRcmd,"))
* Normally we only execute this code once, but no big deal if we
* have to regenerate it a couple of times. */
* Normally we only execute this code once, but no big deal if we
* have to regenerate it a couple of times. */
- qsort(banks, flash_get_bank_count(), sizeof(flash_bank_t *), compare_bank);
+ qsort(banks, flash_get_bank_count(), sizeof(struct flash_bank *), compare_bank);
-int gdb_v_packet(struct connection *connection, target_t *target, char *packet, int packet_size)
+int gdb_v_packet(struct connection *connection, struct target *target, char *packet, int packet_size)
{
struct gdb_connection *gdb_connection = connection->priv;
struct gdb_service *gdb_service = connection->service->priv;
{
struct gdb_connection *gdb_connection = connection->priv;
struct gdb_service *gdb_service = connection->service->priv;
int gdb_input_inner(struct connection *connection)
{
struct gdb_service *gdb_service = connection->service->priv;
int gdb_input_inner(struct connection *connection)
{
struct gdb_service *gdb_service = connection->service->priv;
{
register_command(command_context, NULL, "gdb_sync",
handle_gdb_sync_command, COMMAND_ANY,
{
register_command(command_context, NULL, "gdb_sync",
handle_gdb_sync_command, COMMAND_ANY,