From: Martin Hunt Date: Mon, 1 Feb 1999 20:06:38 +0000 (+0000) Subject: 1999-02-01 Martin Hunt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3267b2900954c55dbe32ed688ae7e013e98ec59b;p=binutils-gdb.git 1999-02-01 Martin Hunt * gdbtk-cmds.c: (gdb_set_bp): Change the "type" argument to be ASCII instead of an integer. Currently accepts "temp" or "normal". Fixed error messages. (gdb_set_bp_addr): Ditto. --- diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk index d3de7207abc..30e3cfc74b3 100644 --- a/gdb/ChangeLog-gdbtk +++ b/gdb/ChangeLog-gdbtk @@ -1,3 +1,10 @@ +1999-02-01 Martin Hunt + + * gdbtk-cmds.c: (gdb_set_bp): Change the "type" argument + to be ASCII instead of an integer. Currently accepts "temp" + or "normal". Fixed error messages. + (gdb_set_bp_addr): Ditto. + 1999-01-29 James Ingham * gdbtk.c (gdbtk_init): Set the fputs_unfiltered_hook to diff --git a/gdb/gdbtk-cmds.c b/gdb/gdbtk-cmds.c index 40fc50a95f1..9a4040a8500 100644 --- a/gdb/gdbtk-cmds.c +++ b/gdb/gdbtk-cmds.c @@ -135,12 +135,15 @@ static char old_regs[REGISTER_BYTES]; of the breakpoint structure (respectively) into something gdbtk understands. They are also used in gdbtk-hooks.c */ -char *bptypes[] = {"breakpoint", "hardware breakpoint", "until", - "finish", "watchpoint", "hardware watchpoint", - "read watchpoint", "access watchpoint", - "longjmp", "longjmp resume", "step resume", - "through sigtramp", "watchpoint scope", - "call dummy" }; +char *bptypes[] = {"none", "breakpoint", "hw breakpoint", "until", + "finish", "watchpoint", "hw watchpoint", + "read watchpoint", "acc watchpoint", + "longjmp", "longjmp resume", "step resume", + "sigtramp", "watchpoint scope", + "call dummy", "shlib events", "catch load", + "catch unload", "catch fork", "catch vfork", + "catch exec", "catch catch", "catch throw" +}; char *bpdisp[] = {"delete", "delstop", "disable", "donttouch"}; /* @@ -2896,36 +2899,47 @@ gdb_set_bp (clientData, interp, objc, objv) Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; - { struct symtab_and_line sal; - int line, flags, ret, thread = -1; + int line, ret, thread = -1; struct breakpoint *b; - char buf[64]; + char buf[64], *typestr; Tcl_DString cmd; + enum bpdisp disp; if (objc != 4 && objc != 5) { - Tcl_WrongNumArgs(interp, 1, objv, "filename line type [thread]"); + Tcl_SetStringObj (result_ptr->obj_ptr, + "wrong number of args, should be \"filename line type [thread]\"", -1); return TCL_ERROR; } sal.symtab = full_lookup_symtab (Tcl_GetStringFromObj( objv[1], NULL)); if (sal.symtab == NULL) return TCL_ERROR; - + if (Tcl_GetIntFromObj( interp, objv[2], &line) == TCL_ERROR) { result_ptr->flags = GDBTK_IN_TCL_RESULT; return TCL_ERROR; } - - if (Tcl_GetIntFromObj( interp, objv[3], &flags) == TCL_ERROR) + + typestr = Tcl_GetStringFromObj( objv[3], NULL); + if (typestr == NULL) { result_ptr->flags = GDBTK_IN_TCL_RESULT; return TCL_ERROR; } - + if (strncmp( typestr, "temp", 4 ) == 0) + disp = del; + else if (strncmp( typestr, "normal", 6 ) == 0) + disp = donttouch; + else + { + Tcl_SetStringObj (result_ptr->obj_ptr, "type must be \"temp\" or \"normal\"", -1); + return TCL_ERROR; + } + if (objc == 5) { if (Tcl_GetIntFromObj( interp, objv[4], &thread) == TCL_ERROR) @@ -2943,8 +2957,8 @@ gdb_set_bp (clientData, interp, objc, objv) b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; - b->type = flags >> 2; - b->disposition = flags & 3; + b->type = bp_breakpoint; + b->disposition = disp; b->thread = thread; /* FIXME: this won't work for duplicate basenames! */ @@ -2996,15 +3010,17 @@ gdb_set_bp_addr (clientData, interp, objc, objv) { struct symtab_and_line sal; - int line, flags, ret, thread = -1; + int line, ret, thread = -1; long addr; struct breakpoint *b; - char *filename, buf[64]; + char *filename, *typestr, buf[64]; Tcl_DString cmd; + enum bpdisp disp; if (objc != 4 && objc != 3) { - Tcl_WrongNumArgs(interp, 1, objv, "addr type ?thread?"); + Tcl_SetStringObj (result_ptr->obj_ptr, + "wrong number of args, should be \"address type [thread]\"", -1); return TCL_ERROR; } @@ -3013,13 +3029,23 @@ gdb_set_bp_addr (clientData, interp, objc, objv) result_ptr->flags = GDBTK_IN_TCL_RESULT; return TCL_ERROR; } - - if (Tcl_GetIntFromObj( interp, objv[2], &flags) == TCL_ERROR) + + typestr = Tcl_GetStringFromObj( objv[2], NULL); + if (typestr == NULL) { result_ptr->flags = GDBTK_IN_TCL_RESULT; return TCL_ERROR; } - + if (strncmp( typestr, "temp", 4 ) == 0) + disp = del; + else if (strncmp( typestr, "normal", 6 ) == 0) + disp = donttouch; + else + { + Tcl_SetStringObj (result_ptr->obj_ptr, "type must be \"temp\" or \"normal\"", -1); + return TCL_ERROR; + } + if (objc == 4) { if (Tcl_GetIntFromObj( interp, objv[3], &thread) == TCL_ERROR) @@ -3034,8 +3060,8 @@ gdb_set_bp_addr (clientData, interp, objc, objv) b = set_raw_breakpoint (sal); set_breakpoint_count (breakpoint_count + 1); b->number = breakpoint_count; - b->type = flags >> 2; - b->disposition = flags & 3; + b->type = bp_breakpoint; + b->disposition = disp; b->thread = thread; sprintf (buf, "*(0x%lx)",addr);