mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-01 01:45:51 +08:00
Remove NULL check from tui_set_exec_info_content
tui_set_exec_info_content ensures that the window's "execution_info" is allocated, so the NULL check here is redundant and can be removed. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_set_exec_info_content): Remove NULL check.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-winsource.c (tui_set_exec_info_content): Remove NULL
|
||||||
|
check.
|
||||||
|
|
||||||
2019-06-25 Tom Tromey <tom@tromey.com>
|
2019-06-25 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-winsource.h (tui_alloc_source_buffer): Change return
|
* tui/tui-winsource.h (tui_alloc_source_buffer): Change return
|
||||||
|
@ -495,46 +495,40 @@ tui_set_exec_info_content (struct tui_win_info *win_info)
|
|||||||
if (exec_info_ptr->content == NULL)
|
if (exec_info_ptr->content == NULL)
|
||||||
exec_info_ptr->content =
|
exec_info_ptr->content =
|
||||||
tui_alloc_content (win_info->height, exec_info_ptr->type);
|
tui_alloc_content (win_info->height, exec_info_ptr->type);
|
||||||
if (exec_info_ptr->content != NULL)
|
|
||||||
|
tui_update_breakpoint_info (win_info, 1);
|
||||||
|
for (int i = 0; i < win_info->content_size; i++)
|
||||||
{
|
{
|
||||||
int i;
|
struct tui_win_element *element;
|
||||||
|
struct tui_win_element *src_element;
|
||||||
|
int mode;
|
||||||
|
|
||||||
tui_update_breakpoint_info (win_info, 1);
|
element = exec_info_ptr->content[i];
|
||||||
for (i = 0; i < win_info->content_size; i++)
|
src_element = win_info->content[i];
|
||||||
{
|
|
||||||
struct tui_win_element *element;
|
|
||||||
struct tui_win_element *src_element;
|
|
||||||
int mode;
|
|
||||||
|
|
||||||
element = exec_info_ptr->content[i];
|
memset(element->which_element.simple_string, ' ',
|
||||||
src_element = win_info->content[i];
|
sizeof(element->which_element.simple_string));
|
||||||
|
element->which_element.simple_string[TUI_EXECINFO_SIZE - 1] = 0;
|
||||||
|
|
||||||
memset(element->which_element.simple_string, ' ',
|
/* Now update the exec info content based upon the state
|
||||||
sizeof(element->which_element.simple_string));
|
of each line as indicated by the source content. */
|
||||||
element->which_element.simple_string[TUI_EXECINFO_SIZE - 1] = 0;
|
mode = src_element->which_element.source.has_break;
|
||||||
|
if (mode & TUI_BP_HIT)
|
||||||
|
element->which_element.simple_string[TUI_BP_HIT_POS] =
|
||||||
|
(mode & TUI_BP_HARDWARE) ? 'H' : 'B';
|
||||||
|
else if (mode & (TUI_BP_ENABLED | TUI_BP_DISABLED))
|
||||||
|
element->which_element.simple_string[TUI_BP_HIT_POS] =
|
||||||
|
(mode & TUI_BP_HARDWARE) ? 'h' : 'b';
|
||||||
|
|
||||||
/* Now update the exec info content based upon the state
|
if (mode & TUI_BP_ENABLED)
|
||||||
of each line as indicated by the source content. */
|
element->which_element.simple_string[TUI_BP_BREAK_POS] = '+';
|
||||||
mode = src_element->which_element.source.has_break;
|
else if (mode & TUI_BP_DISABLED)
|
||||||
if (mode & TUI_BP_HIT)
|
element->which_element.simple_string[TUI_BP_BREAK_POS] = '-';
|
||||||
element->which_element.simple_string[TUI_BP_HIT_POS] =
|
|
||||||
(mode & TUI_BP_HARDWARE) ? 'H' : 'B';
|
|
||||||
else if (mode & (TUI_BP_ENABLED | TUI_BP_DISABLED))
|
|
||||||
element->which_element.simple_string[TUI_BP_HIT_POS] =
|
|
||||||
(mode & TUI_BP_HARDWARE) ? 'h' : 'b';
|
|
||||||
|
|
||||||
if (mode & TUI_BP_ENABLED)
|
if (src_element->which_element.source.is_exec_point)
|
||||||
element->which_element.simple_string[TUI_BP_BREAK_POS] = '+';
|
element->which_element.simple_string[TUI_EXEC_POS] = '>';
|
||||||
else if (mode & TUI_BP_DISABLED)
|
|
||||||
element->which_element.simple_string[TUI_BP_BREAK_POS] = '-';
|
|
||||||
|
|
||||||
if (src_element->which_element.source.is_exec_point)
|
|
||||||
element->which_element.simple_string[TUI_EXEC_POS] = '>';
|
|
||||||
}
|
|
||||||
exec_info_ptr->content_size = win_info->content_size;
|
|
||||||
}
|
}
|
||||||
else
|
exec_info_ptr->content_size = win_info->content_size;
|
||||||
ret = TUI_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user