* gdbtk.c (gdb_loc): symtab_to_filename can return NULL
(breakpoint_notify): symtab_to_filename can return NULL (gdb_get_breakpoint_info): symtab_to_filename can return NULL * tracepoint.c (set_raw_tracepoint): fix typo
This commit is contained in:
parent
018d76dddb
commit
6c3908dba3
3 changed files with 45 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Wed Nov 26 15:02:43 1997 Keith Seitz <keiths@onions.cygnus.com>
|
||||||
|
|
||||||
|
* gdbtk.c (gdb_loc): symtab_to_filename can return NULL
|
||||||
|
(breakpoint_notify): symtab_to_filename can return NULL
|
||||||
|
(gdb_get_breakpoint_info): symtab_to_filename can return NULL
|
||||||
|
|
||||||
|
* tracepoint.c (set_raw_tracepoint): fix typo
|
||||||
|
|
||||||
Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com>
|
Wed Nov 26 11:33:09 1997 Keith Seitz <keiths@onions.cygnus.com>
|
||||||
|
|
||||||
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on
|
* tracepoint.c (set_raw_tracepoint): make sure there's a trailing slash on
|
||||||
|
|
15
gdb/gdbtk.c
15
gdb/gdbtk.c
|
@ -464,7 +464,7 @@ gdb_get_breakpoint_info (clientData, interp, argc, argv)
|
||||||
int bpnum;
|
int bpnum;
|
||||||
struct breakpoint *b;
|
struct breakpoint *b;
|
||||||
extern struct breakpoint *breakpoint_chain;
|
extern struct breakpoint *breakpoint_chain;
|
||||||
char *funcname;
|
char *funcname, *filename;
|
||||||
|
|
||||||
if (argc != 2)
|
if (argc != 2)
|
||||||
error ("wrong # args");
|
error ("wrong # args");
|
||||||
|
@ -480,7 +480,10 @@ gdb_get_breakpoint_info (clientData, interp, argc, argv)
|
||||||
|
|
||||||
sal = find_pc_line (b->address, 0);
|
sal = find_pc_line (b->address, 0);
|
||||||
|
|
||||||
Tcl_DStringAppendElement (result_ptr, symtab_to_filename (sal.symtab));
|
filename = symtab_to_filename (sal.symtab);
|
||||||
|
if (filename == NULL)
|
||||||
|
filename = "N/A";
|
||||||
|
Tcl_DStringAppendElement (result_ptr, );
|
||||||
find_pc_partial_function (b->address, &funcname, NULL, NULL);
|
find_pc_partial_function (b->address, &funcname, NULL, NULL);
|
||||||
Tcl_DStringAppendElement (result_ptr, funcname);
|
Tcl_DStringAppendElement (result_ptr, funcname);
|
||||||
dsprintf_append_element (result_ptr, "%d", sal.line);
|
dsprintf_append_element (result_ptr, "%d", sal.line);
|
||||||
|
@ -511,6 +514,7 @@ breakpoint_notify(b, action)
|
||||||
char buf[256];
|
char buf[256];
|
||||||
int v;
|
int v;
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
|
char *filename;
|
||||||
|
|
||||||
if (b->type != bp_breakpoint)
|
if (b->type != bp_breakpoint)
|
||||||
return;
|
return;
|
||||||
|
@ -518,8 +522,11 @@ breakpoint_notify(b, action)
|
||||||
/* We ensure that ACTION contains no special Tcl characters, so we
|
/* We ensure that ACTION contains no special Tcl characters, so we
|
||||||
can do this. */
|
can do this. */
|
||||||
sal = find_pc_line (b->address, 0);
|
sal = find_pc_line (b->address, 0);
|
||||||
|
filename = symtab_to_filename (sal.symtab);
|
||||||
|
if (filename == NULL)
|
||||||
|
filename = "N/A";
|
||||||
sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s}", action, b->number,
|
sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s}", action, b->number,
|
||||||
(long)b->address, sal.line, symtab_to_filename (sal.symtab));
|
(long)b->address, sal.line, filename);
|
||||||
|
|
||||||
v = Tcl_Eval (interp, buf);
|
v = Tcl_Eval (interp, buf);
|
||||||
|
|
||||||
|
@ -605,6 +612,8 @@ gdb_loc (clientData, interp, argc, argv)
|
||||||
Tcl_DStringAppendElement (result_ptr, funcname);
|
Tcl_DStringAppendElement (result_ptr, funcname);
|
||||||
|
|
||||||
filename = symtab_to_filename (sal.symtab);
|
filename = symtab_to_filename (sal.symtab);
|
||||||
|
if (filename == NULL)
|
||||||
|
filename = "N/A";
|
||||||
Tcl_DStringAppendElement (result_ptr, filename);
|
Tcl_DStringAppendElement (result_ptr, filename);
|
||||||
|
|
||||||
dsprintf_append_element (result_ptr, "%d", sal.line); /* line number */
|
dsprintf_append_element (result_ptr, "%d", sal.line); /* line number */
|
||||||
|
|
|
@ -41,6 +41,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int info_verbose;
|
extern int info_verbose;
|
||||||
|
extern void (*readline_begin_hook) PARAMS ((char *, ...));
|
||||||
|
extern char * (*readline_hook) PARAMS ((char *));
|
||||||
|
extern void (*readline_end_hook) PARAMS ((void));
|
||||||
|
|
||||||
/* If this definition isn't overridden by the header files, assume
|
/* If this definition isn't overridden by the header files, assume
|
||||||
that isatty and fileno exist on this system. */
|
that isatty and fileno exist on this system. */
|
||||||
|
@ -299,8 +302,9 @@ set_raw_tracepoint (sal)
|
||||||
|
|
||||||
strcpy (t->source_file, sal.symtab->dirname);
|
strcpy (t->source_file, sal.symtab->dirname);
|
||||||
p = t->source_file;
|
p = t->source_file;
|
||||||
while (*p++) ;
|
while (*p)
|
||||||
if (*p != '/') /* Will this work on Windows? */
|
p++;
|
||||||
|
if (*(--p) != '/') /* Will this work on Windows? */
|
||||||
strcat (t->source_file, "/");
|
strcat (t->source_file, "/");
|
||||||
strcat (t->source_file, sal.symtab->filename);
|
strcat (t->source_file, sal.symtab->filename);
|
||||||
}
|
}
|
||||||
|
@ -710,14 +714,25 @@ trace_actions_command (args, from_tty)
|
||||||
{
|
{
|
||||||
struct tracepoint *t;
|
struct tracepoint *t;
|
||||||
char *actions;
|
char *actions;
|
||||||
|
char tmpbuf[128];
|
||||||
|
char *end_msg = "End with a line saying just \"end\".";
|
||||||
|
|
||||||
if (t = get_tracepoint_by_number (&args))
|
if (t = get_tracepoint_by_number (&args))
|
||||||
{
|
{
|
||||||
if (from_tty)
|
sprintf (tmpbuf, "Enter actions for tracepoint %d, one per line.",
|
||||||
printf_filtered ("Enter actions for tracepoint %d, one per line.\n",
|
|
||||||
t->number);
|
t->number);
|
||||||
|
|
||||||
|
if (readline_begin_hook)
|
||||||
|
(*readline_begin_hook) ("%s %s\n", tmpbuf, end_msg);
|
||||||
|
else if (from_tty && input_from_terminal_p ())
|
||||||
|
printf_filtered ("%s\n%s\n", tmpbuf, end_msg);
|
||||||
|
|
||||||
free_actions (t);
|
free_actions (t);
|
||||||
read_actions (t);
|
read_actions (t);
|
||||||
|
|
||||||
|
if (readline_end_hook)
|
||||||
|
(*readline_end_hook) ();
|
||||||
|
|
||||||
/* tracepoints_changed () */
|
/* tracepoints_changed () */
|
||||||
}
|
}
|
||||||
/* else error, just return; */
|
/* else error, just return; */
|
||||||
|
@ -758,7 +773,10 @@ read_actions (t)
|
||||||
wrap_here ("");
|
wrap_here ("");
|
||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
gdb_flush (gdb_stderr);
|
gdb_flush (gdb_stderr);
|
||||||
if (instream == stdin && ISATTY (instream))
|
|
||||||
|
if (readline_hook && instream == NULL)
|
||||||
|
line = (*readline_hook) (prompt);
|
||||||
|
else if (instream == stdin && ISATTY (instream))
|
||||||
line = readline (prompt);
|
line = readline (prompt);
|
||||||
else
|
else
|
||||||
line = gdb_readline (0);
|
line = gdb_readline (0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue