43#define PROC_PREFIX "In: "
44#define LINE_PREFIX "L"
45#define PC_PREFIX "PC: "
48#define SINGLE_KEY "(SingleKey)"
52#define MIN_LINE_WIDTH 4
54#define MIN_PROC_WIDTH 12
55#define MAX_TARGET_WIDTH 10
56#define MAX_PID_WIDTH 19
71 std::string pid_name_holder;
73 pid_name =
"No process";
77 pid_name = pid_name_holder.c_str ();
84 pid_width = strlen (pid_name);
93 xsnprintf (line_buf,
sizeof (line_buf),
"%d", line_no);
95 strcpy (line_buf,
"??");
96 line_width = strlen (line_buf);
106 const char *pc_buf = pc_out.c_str ();
107 int pc_width = pc_out.size ();
112 proc_width = (status_size
117 - (
sizeof (
PC_PREFIX) - 1 + pc_width + 1)
126 proc_width += target_width + 1;
130 proc_width += pid_width + 1;
134 proc_width += pc_width +
sizeof (
PC_PREFIX) - 1 + 1;
138 proc_width += line_width +
sizeof (
LINE_PREFIX) - 1 + 1;
151 if (target_width > 0)
154 string.printf (
"%*.*s ", -pid_width, pid_width, pid_name);
167 if (proc_name.size () > proc_width)
169 1 - proc_width, proc_width - 1, proc_name.c_str ());
172 -proc_width, proc_width, proc_name.c_str ());
177 -line_width, line_width, line_buf);
181 string.puts (pc_buf);
184 std::string string_val =
string.release ();
186 size_t len = string_val.size ();
187 if (len < status_size)
188 string_val.append (status_size - len,
' ');
189 else if (len > status_size)
190 string_val.erase (status_size, len);
192 gdb_assert (string_val.size () == status_size);
203 static char name[256];
212 const char *d = stream.
c_str ();
215 strncpy (
name, d,
sizeof (
name) - 1);
218 char *p = strchr (
name,
'(');
220 p = strchr (
name,
'>');
223 p = strchr (
name,
'+');
232 gdb_assert (
handle != NULL);
235 scrollok (
handle.get (), FALSE);
236 wmove (
handle.get (), 0, 0);
242 (void) wstandout (
handle.get ());
243 waddstr (
handle.get (),
string.c_str ());
244 wclrtoeol (
handle.get ());
245 (void) wstandend (
handle.get ());
247 wmove (
handle.get (), 0, 0);
259 bool locator_changed_p;
265 const char *func_name;
271 func_name = _(
"<unavailable>");
279 if (!locator_changed_p)
284 win_info->maybe_update (fi, sal);
285 win_info->update_exec_info ();
294 if (!locator_changed_p)
298 win_info->erase_source_content ();
326 _(
"Update the source window and locator to "
327 "display the current execution point.\n\
const char * c_str() const
void printf(const char *,...) ATTRIBUTE_PRINTF(2
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
int print_address_symbolic(struct gdbarch *, CORE_ADDR, struct ui_file *, int, const char *)
CORE_ADDR get_frame_pc(frame_info_ptr frame)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
bool get_frame_pc_if_available(frame_info_ptr frame, CORE_ADDR *pc)
symtab_and_line find_frame_sal(frame_info_ptr frame)
void execute_command(const char *, int)
struct gdbarch * gdbarch() const
const std::string & proc_name() const
bool set_location(struct gdbarch *gdbarch, const struct symtab_and_line &sal, const char *procname)
std::string make_status_line() const
std::unique_ptr< WINDOW, curses_deleter > handle
virtual void refresh_window()
std::string target_pid_to_str(ptid_t ptid)
const char * target_shortname()
tui_location_tracker tui_location
bool tui_show_frame_info(frame_info_ptr fi)
static char * tui_get_function_from_frame(frame_info_ptr fi)
void _initialize_tui_stack()
void tui_show_locator_content()
static void tui_update_command(const char *arg, int from_tty)
enum tui_key_mode tui_current_key_mode
bool tui_is_window_visible(enum tui_win_type type)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)