aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1997-12-09 00:25:07 +0000
committerKeith Seitz <keiths@cygnus>1997-12-09 00:25:07 +0000
commit09e4fde23070f6bb86237a4170bec3ea4a486561 (patch)
tree66f4bd27774f59e98a804f10b26dd666d7906bc1 /gdb/gdbtk.c
parent38d0ccc27a51c0aabd0c04754ade7cc3c08df395 (diff)
downloadgdb-09e4fde23070f6bb86237a4170bec3ea4a486561.zip
gdb-09e4fde23070f6bb86237a4170bec3ea4a486561.tar.gz
gdb-09e4fde23070f6bb86237a4170bec3ea4a486561.tar.bz2
* gdbtk.c (gdb_get_tracepoint_info): use info in struct
symtab_and_line, not struct tracepoint. (tracepoint_notify): use info in struct symtab_and_line, not struct tracepoint
Diffstat (limited to 'gdb/gdbtk.c')
-rw-r--r--gdb/gdbtk.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index 2a29a74..ab356cd 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -2371,11 +2371,11 @@ gdb_get_tracepoint_info (clientData, interp, objc, objv)
Tcl_Obj *CONST objv[];
{
struct symtab_and_line sal;
- struct command_line *cmd;
int tpnum;
struct tracepoint *tp;
struct action_line *al;
Tcl_Obj *list, *action_list;
+ char *filename, *funcname;
char tmp[19];
if (objc != 2)
@@ -2391,13 +2391,15 @@ gdb_get_tracepoint_info (clientData, interp, objc, objv)
error ("Tracepoint #%d does not exist", tpnum);
list = Tcl_NewListObj (0, NULL);
- if (tp->source_file != NULL)
- Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj (tp->source_file, -1));
- else
- Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj ("N/A", -1));
- Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->line_number));
- /* the function part is not currently used by the frontend */
- Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj ("function", -1));
+ sal = find_pc_line (tp->address, 0);
+ filename = symtab_to_filename (sal.symtab);
+ if (filename == NULL)
+ filename = "N/A";
+ Tcl_ListObjAppendElement (interp, list,
+ Tcl_NewStringObj (filename, -1));
+ Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (sal.line));
+ find_pc_partial_function (tp->address, &funcname, NULL, NULL);
+ Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj (funcname, -1));
sprintf (tmp, "0x%08x", tp->address);
Tcl_ListObjAppendElement (interp, list, Tcl_NewStringObj (tmp, -1));
Tcl_ListObjAppendElement (interp, list, Tcl_NewIntObj (tp->enabled));
@@ -2439,17 +2441,19 @@ tracepoint_notify(tp, action)
const char *action;
{
char buf[256];
- char *source;
int v;
+ struct symtab_and_line sal;
+ char *filename;
/* We ensure that ACTION contains no special Tcl characters, so we
can do this. */
- if (tp->source_file != NULL)
- source = tp->source_file;
- else
- source = "N/A";
+ sal = find_pc_line (tp->address, 0);
+
+ filename = symtab_to_filename (sal.symtab);
+ if (filename == NULL)
+ filename = "N/A";
sprintf (buf, "gdbtk_tcl_tracepoint %s %d 0x%lx %d {%s}", action, tp->number,
- (long)tp->address, tp->line_number, source);
+ (long)tp->address, sal.line, filename);
v = Tcl_Eval (interp, buf);