mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
Change members of tui_locator_window to std::string
This changes two members of tui_locator_window to have type std::string. This removes a static limit. gdb/ChangeLog 2019-09-20 Tom Tromey <tom@tromey.com> * tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN): Remove define. (struct tui_locator_window) <full_name, proc_name>: Now std::string. * tui/tui-stack.c (tui_locator_window::make_status_line) (tui_locator_window::set_locator_fullname) (tui_locator_window::set_locator_info): Update. * tui/tui-source.c (tui_source_window::set_contents) (tui_source_window::showing_source_p): Update.
This commit is contained in:
@ -1,3 +1,14 @@
|
|||||||
|
2019-09-20 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* tui/tui-stack.h (MAX_LOCATOR_ELEMENT_LEN): Remove define.
|
||||||
|
(struct tui_locator_window) <full_name, proc_name>: Now
|
||||||
|
std::string.
|
||||||
|
* tui/tui-stack.c (tui_locator_window::make_status_line)
|
||||||
|
(tui_locator_window::set_locator_fullname)
|
||||||
|
(tui_locator_window::set_locator_info): Update.
|
||||||
|
* tui/tui-source.c (tui_source_window::set_contents)
|
||||||
|
(tui_source_window::showing_source_p): Update.
|
||||||
|
|
||||||
2019-09-20 Tom Tromey <tom@tromey.com>
|
2019-09-20 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* tui/tui-stack.c (tui_locator_window::set_locator_fullname):
|
* tui/tui-stack.c (tui_locator_window::set_locator_fullname):
|
||||||
|
@ -179,7 +179,7 @@ tui_source_window::set_contents (struct gdbarch *arch,
|
|||||||
element->line_or_addr.loa = LOA_LINE;
|
element->line_or_addr.loa = LOA_LINE;
|
||||||
element->line_or_addr.u.line_no = cur_line_no;
|
element->line_or_addr.u.line_no = cur_line_no;
|
||||||
element->is_exec_point
|
element->is_exec_point
|
||||||
= (filename_cmp (locator->full_name,
|
= (filename_cmp (locator->full_name.c_str (),
|
||||||
symtab_to_fullname (s)) == 0
|
symtab_to_fullname (s)) == 0
|
||||||
&& cur_line_no == locator->line_no);
|
&& cur_line_no == locator->line_no);
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ bool
|
|||||||
tui_source_window::showing_source_p (const char *fullname) const
|
tui_source_window::showing_source_p (const char *fullname) const
|
||||||
{
|
{
|
||||||
return (!content.empty ()
|
return (!content.empty ()
|
||||||
&& (filename_cmp (tui_locator_win_info_ptr ()->full_name,
|
&& (filename_cmp (tui_locator_win_info_ptr ()->full_name.c_str (),
|
||||||
fullname) == 0));
|
fullname) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,12 +166,12 @@ tui_locator_window::make_status_line () const
|
|||||||
/* Procedure/class name. */
|
/* Procedure/class name. */
|
||||||
if (proc_width > 0)
|
if (proc_width > 0)
|
||||||
{
|
{
|
||||||
if (strlen (proc_name) > proc_width)
|
if (proc_name.size () > proc_width)
|
||||||
string.printf ("%s%*.*s* ", PROC_PREFIX,
|
string.printf ("%s%*.*s* ", PROC_PREFIX,
|
||||||
1 - proc_width, proc_width - 1, proc_name);
|
1 - proc_width, proc_width - 1, proc_name.c_str ());
|
||||||
else
|
else
|
||||||
string.printf ("%s%*.*s ", PROC_PREFIX,
|
string.printf ("%s%*.*s ", PROC_PREFIX,
|
||||||
-proc_width, proc_width, proc_name);
|
-proc_width, proc_width, proc_name.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line_width > 0)
|
if (line_width > 0)
|
||||||
@ -250,8 +250,7 @@ tui_locator_window::rerender ()
|
|||||||
void
|
void
|
||||||
tui_locator_window::set_locator_fullname (const char *fullname)
|
tui_locator_window::set_locator_fullname (const char *fullname)
|
||||||
{
|
{
|
||||||
full_name[0] = 0;
|
full_name = fullname;
|
||||||
strcat_to_buf (full_name, MAX_LOCATOR_ELEMENT_LEN, fullname);
|
|
||||||
rerender ();
|
rerender ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -272,16 +271,13 @@ tui_locator_window::set_locator_info (struct gdbarch *gdbarch_in,
|
|||||||
if (fullname == NULL)
|
if (fullname == NULL)
|
||||||
fullname = "";
|
fullname = "";
|
||||||
|
|
||||||
locator_changed_p |= strncmp (proc_name, procname,
|
locator_changed_p |= proc_name != procname;
|
||||||
MAX_LOCATOR_ELEMENT_LEN) != 0;
|
|
||||||
locator_changed_p |= lineno != line_no;
|
locator_changed_p |= lineno != line_no;
|
||||||
locator_changed_p |= addr_in != addr;
|
locator_changed_p |= addr_in != addr;
|
||||||
locator_changed_p |= gdbarch_in != gdbarch;
|
locator_changed_p |= gdbarch_in != gdbarch;
|
||||||
locator_changed_p |= strncmp (full_name, fullname,
|
locator_changed_p |= full_name != fullname;
|
||||||
MAX_LOCATOR_ELEMENT_LEN) != 0;
|
|
||||||
|
|
||||||
proc_name[0] = (char) 0;
|
proc_name = procname;
|
||||||
strcat_to_buf (proc_name, MAX_LOCATOR_ELEMENT_LEN, procname);
|
|
||||||
line_no = lineno;
|
line_no = lineno;
|
||||||
addr = addr_in;
|
addr = addr_in;
|
||||||
gdbarch = gdbarch_in;
|
gdbarch = gdbarch_in;
|
||||||
|
@ -26,12 +26,6 @@
|
|||||||
|
|
||||||
struct frame_info;
|
struct frame_info;
|
||||||
|
|
||||||
#ifdef PATH_MAX
|
|
||||||
# define MAX_LOCATOR_ELEMENT_LEN PATH_MAX
|
|
||||||
#else
|
|
||||||
# define MAX_LOCATOR_ELEMENT_LEN 1024
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Locator window class. */
|
/* Locator window class. */
|
||||||
|
|
||||||
struct tui_locator_window : public tui_gen_win_info
|
struct tui_locator_window : public tui_gen_win_info
|
||||||
@ -57,8 +51,8 @@ struct tui_locator_window : public tui_gen_win_info
|
|||||||
/* Set the full_name portion of the locator. */
|
/* Set the full_name portion of the locator. */
|
||||||
void set_locator_fullname (const char *fullname);
|
void set_locator_fullname (const char *fullname);
|
||||||
|
|
||||||
char full_name[MAX_LOCATOR_ELEMENT_LEN];
|
std::string full_name;
|
||||||
char proc_name[MAX_LOCATOR_ELEMENT_LEN];
|
std::string proc_name;
|
||||||
int line_no = 0;
|
int line_no = 0;
|
||||||
CORE_ADDR addr = 0;
|
CORE_ADDR addr = 0;
|
||||||
/* Architecture associated with code at this location. */
|
/* Architecture associated with code at this location. */
|
||||||
|
Reference in New Issue
Block a user