From: Keith Seitz Date: Tue, 9 Dec 1997 00:25:07 +0000 (+0000) Subject: * gdbtk.c (gdb_get_tracepoint_info): use info in struct X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=09e4fde23070f6bb86237a4170bec3ea4a486561;p=binutils-gdb.git * 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 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b80a3657ff1..066b65195ad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +Mon Dec 8 15:51:45 1997 Keith Seitz + + * 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 + Mon Dec 8 14:28:49 1997 Michael Snyder (msnyder@cleaver.cygnus.com) * tracepoint.c (memrange_sortmerge): allow for memranges diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 2a29a7476f3..ab356cd2890 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);