From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6577 invoked by alias); 8 Mar 2005 10:06:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6230 invoked from network); 8 Mar 2005 10:05:49 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 8 Mar 2005 10:05:49 -0000 Received: (qmail 4649 invoked from network); 8 Mar 2005 10:05:48 -0000 Received: from localhost (HELO ?192.168.189.167?) (nathan@127.0.0.1) by mail.codesourcery.com with SMTP; 8 Mar 2005 10:05:48 -0000 Message-ID: <422D78F4.9050303@codesourcery.com> Date: Tue, 08 Mar 2005 10:06:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913 MIME-Version: 1.0 To: Daniel Jacobowitz CC: gdb-patches@sources.redhat.com, Michael Snyder Subject: Re: [PATCH] Some tracepoint fixes References: <4209D595.7010602@codesourcery.com> <20050227002309.GA19138@nevyn.them.org> In-Reply-To: <20050227002309.GA19138@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------050606050209080306030604" X-SW-Source: 2005-03/txt/msg00116.txt.bz2 This is a multi-part message in MIME format. --------------050606050209080306030604 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1390 Daniel Jacobowitz wrote: > On Wed, Feb 09, 2005 at 09:19:17AM +0000, Nathan Sidwell wrote: > >>In porting gdb to a new architecture, I came across a number of core gdb >>bugs. Here is the first set of them and addresses the following issues, >> >>1) we did not allow 'extended-remote' targets to use tracepoints. >> >>2) We could only trace architectures with 64 registers, not 256 like >>a comment suggested. >> >>3) There was an erroneous comment about tracing memory ranges >> >>4) If a ^D was entered when entering the 'actions' list, we'd create >>a NULL action, which would cause a segfault when tracing started. > Some bits of this are OK, some aren't (and I'd want Michael's opinion > on them). In particular, the tracepoint remote protocol packets don't > appear to be documented; so I'm not sure about the strtol change. Your > change is definitely wrong one way or another, because it depends on > the size of "long" on the host. You're passing a long* to sscanf where > it expects an unsigned long*. If we expect a hex-encoded 32-bit > result, then let's parse it that way explicitly. ok. I've installed the attached patch, which are the uncontraversial bits. I'll address the strtol one separately. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk --------------050606050209080306030604 Content-Type: text/plain; name="tracepoint1a.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tracepoint1a.patch" Content-length: 2388 2005-03-08 Nathan Sidwell * tracepoint.c (target_is_remote): Allow extended-remote. (struct collection_list): Allow 256 registers, like the comment said. (add_memrange): Fix comment. (read_actions): Turn EOF into 'end'. Index: tracepoint.c =================================================================== RCS file: /cvs/src/src/gdb/tracepoint.c,v retrieving revision 1.68 diff -c -3 -p -r1.68 tracepoint.c *** tracepoint.c 2 Feb 2005 00:20:05 -0000 1.68 --- tracepoint.c 8 Feb 2005 11:31:20 -0000 *************** static int *** 164,170 **** target_is_remote (void) { if (current_target.to_shortname && ! strcmp (current_target.to_shortname, "remote") == 0) return 1; else return 0; --- 164,171 ---- target_is_remote (void) { if (current_target.to_shortname && ! (strcmp (current_target.to_shortname, "remote") == 0 ! || strcmp (current_target.to_shortname, "extended-remote") == 0)) return 1; else return 0; *************** read_actions (struct tracepoint *t) *** 860,865 **** --- 861,869 ---- else line = gdb_readline (0); + if (!line) + line = "end"; + linetype = validate_actionline (&line, t); if (linetype == BADLINE) continue; /* already warned -- collect another line */ *************** struct memrange *** 1074,1080 **** struct collection_list { ! unsigned char regs_mask[8]; /* room for up to 256 regs */ long listsize; long next_memrange; struct memrange *list; --- 1078,1084 ---- struct collection_list { ! unsigned char regs_mask[32]; /* room for up to 256 regs */ long listsize; long next_memrange; struct memrange *list; *************** add_memrange (struct collection_list *me *** 1171,1177 **** printf_filtered (",%ld)\n", len); } ! /* type: 0 == memory, n == basereg */ memranges->list[memranges->next_memrange].type = type; /* base: addr if memory, offset if reg relative. */ memranges->list[memranges->next_memrange].start = base; --- 1175,1181 ---- printf_filtered (",%ld)\n", len); } ! /* type: -1 == memory, n == basereg */ memranges->list[memranges->next_memrange].type = type; /* base: addr if memory, offset if reg relative. */ memranges->list[memranges->next_memrange].start = base; --------------050606050209080306030604--