From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23146 invoked by alias); 24 Mar 2010 20:21:06 -0000 Received: (qmail 23138 invoked by uid 22791); 24 Mar 2010 20:21:05 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Mar 2010 20:20:58 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2OKKv7E029731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 24 Mar 2010 16:20:57 -0400 Received: from [IPv6:::1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2OKKrS7012102 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 24 Mar 2010 16:20:55 -0400 Message-ID: <4BAA7424.60500@redhat.com> Date: Thu, 25 Mar 2010 07:07:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc11 Lightning/1.0b1 Thunderbird/3.0.3 MIME-Version: 1.0 To: insight Subject: [PATCH] Update recent breakpoint build failures Content-Type: multipart/mixed; boundary="------------060105090803020003010001" X-IsSubscribed: yes Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2010-q1/txt/msg00046.txt.bz2 This is a multi-part message in MIME format. --------------060105090803020003010001 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 736 Hi, I've committed the attached patch which fixes several new build failures that have cropped up in the last week or two due to some API shifts inside GDB. I have not tested the tracepoint stuff at all, so there might be issues. In any case, if there are any further issues, please let me know. Keith ChangeLog 2010-03-24 Keith Seitz * generic/gdbtk-bp.c (gdb_set_bp): set_breakpoint is no more. Use create_breakpoint. (gdbtk_obj_array, gdbtk_obj_array_ptr, gdbtk_obj_array_cnt): New globals. (gdbtk_read_next_line): New function. (gdb_actions_command): Rewrite using new command_line infrastructure. (gdb_get_tracepoint_info): Actions are now stored in the breakpoint struct's commands element. --------------060105090803020003010001 Content-Type: text/plain; name="gdbtk-bp-update.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdbtk-bp-update.patch" Content-length: 4700 Index: generic/gdbtk-bp.c =================================================================== RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-bp.c,v retrieving revision 1.33 diff -u -p -r1.33 gdbtk-bp.c --- generic/gdbtk-bp.c 15 Jan 2010 22:37:18 -0000 1.33 +++ generic/gdbtk-bp.c 24 Mar 2010 20:17:48 -0000 @@ -1,5 +1,5 @@ /* Tcl/Tk command definitions for Insight - Breakpoints. - Copyright (C) 2001, 2002, 2008, 2009 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GDB. @@ -33,6 +33,11 @@ #include "arch-utils.h" #include "exceptions.h" +/* Globals to support action and breakpoint commands. */ +static Tcl_Obj **gdbtk_obj_array; +static int gdbtk_obj_array_cnt; +static int gdbtk_obj_array_ptr; + /* From breakpoint.c */ extern struct breakpoint *breakpoint_chain; @@ -156,6 +161,17 @@ Gdbtk_Breakpoint_Init (Tcl_Interp *inter return TCL_OK; } + +/* A line buffer for breakpoint commands and tracepoint actions + input validation. */ +static char * +gdbtk_read_next_line (void) +{ + if (gdbtk_obj_array_ptr == gdbtk_obj_array_cnt) + return NULL; + + return Tcl_GetStringFromObj (gdbtk_obj_array[gdbtk_obj_array_ptr++], NULL); +} /* * This section contains commands for manipulation of breakpoints. @@ -530,9 +546,16 @@ gdb_set_bp (ClientData clientData, Tcl_I TRY_CATCH (e, RETURN_MASK_ALL) { - set_breakpoint (get_current_arch (), address, condition, - 0 /* hardwareflag */, temp, thread, ignore_count, - pending, enabled); + create_breakpoint (get_current_arch (), address, condition, thread, + 0 /* condition and thread are valid */, + temp, + 0 /* hardware flag */, + 0 /* trace flag */, + ignore_count, + (pending ? AUTO_BOOLEAN_TRUE : AUTO_BOOLEAN_FALSE), + NULL /* breakpoint ops */, + 0 /* from_tty */, + enabled); } if (e.reason < 0) @@ -642,13 +665,9 @@ static int gdb_actions_command (ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + char *number; struct breakpoint *tp; - Tcl_Obj **actions; - int nactions, i, len; - char *number, *args, *action; - long step_count; - struct action_line *next = NULL, *temp; - enum actionline_type linetype; + struct command_line *commands; if (objc != 3) { @@ -656,8 +675,8 @@ gdb_actions_command (ClientData clientDa return TCL_ERROR; } - args = number = Tcl_GetStringFromObj (objv[1], NULL); - tp = get_tracepoint_by_number (&args, 0, 0); + number = Tcl_GetStringFromObj (objv[1], NULL); + tp = get_tracepoint_by_number (&number, 0, 0); if (tp == NULL) { Tcl_AppendStringsToObj (result_ptr->obj_ptr, "Tracepoint \"", @@ -665,42 +684,17 @@ gdb_actions_command (ClientData clientDa return TCL_ERROR; } - /* Free any existing actions */ - if (tp->actions != NULL) - free_actions (tp); - - step_count = 0; - - Tcl_ListObjGetElements (interp, objv[2], &nactions, &actions); - - /* Add the actions to the tracepoint */ - for (i = 0; i < nactions; i++) - { - temp = xmalloc (sizeof (struct action_line)); - temp->next = NULL; - action = Tcl_GetStringFromObj (actions[i], &len); - temp->action = savestring (action, len); - - linetype = validate_actionline (&(temp->action), tp); + /* Free any existing actions. */ + free_command_lines (&tp->commands); - if (linetype == BADLINE) - { - free (temp); - continue; - } - - if (next == NULL) - { - tp->actions = temp; - next = temp; - } - else - { - next->next = temp; - next = temp; - } - } + /* Validate and set new tracepoint actions. */ + Tcl_ListObjGetElements (interp, objv[2], &gdbtk_obj_array_cnt, + &gdbtk_obj_array); + gdbtk_obj_array_ptr = 1; + commands = read_command_lines_1 (gdbtk_read_next_line, 1, + check_tracepoint_command, tp); + breakpoint_set_commands (tp, commands); return TCL_OK; } @@ -726,7 +720,7 @@ gdb_get_tracepoint_info (ClientData clie struct symtab_and_line sal; int tpnum; struct breakpoint *tp; - struct action_line *al; + struct command_line *cl; Tcl_Obj *action_list; char *filename, *funcname; @@ -779,10 +773,10 @@ gdb_get_tracepoint_info (ClientData clie /* Append a list of actions */ action_list = Tcl_NewObj (); - for (al = tp->actions; al != NULL; al = al->next) + for (cl = tp->commands; cl != NULL; cl = cl->next) { Tcl_ListObjAppendElement (interp, action_list, - Tcl_NewStringObj (al->action, -1)); + Tcl_NewStringObj (cl->line, -1)); } Tcl_ListObjAppendElement (interp, result_ptr->obj_ptr, action_list); --------------060105090803020003010001--