Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-16 Thread Michael Bruck
On Mon, Nov 16, 2009 at 08:34, David Brownell wrote: >> I guess we have very different approaches to looking at new software. >> Since the structures (classes) are the skeleton > > There's a book titled something like "structs + methods = programs".  :) > > When I'm analysing code to see how it wo

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread David Brownell
> I guess we have very different approaches to looking at new software. > Since the structures (classes) are the skeleton There's a book titled something like "structs + methods = programs". :) When I'm analysing code to see how it works inside, I consider it a flaw if I can't look through the

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 23:00, David Brownell wrote: > [ offtopic threads #2, #3, ... ] > >> The reason why I did not plug arm11 into the existing arm >> infrastructure and why we implemented etm as a tcl script > > "We" didn't see any such Tcl scripts posted though. Yes, they are tailored to our

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 22:16, David Brownell wrote: > [ Offtopic thread #1:  "struct typedefs considered harmful" ] > >> struct foo >> >> and >> >> foo_t >> >> are both universally understood. > > I can't know what a "foo_t" is without looking it up, > so it's not "universal" in any meaningful se

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread David Brownell
[ Offtopic thread #1: "struct typedefs considered harmful" ] > struct foo > > and > > foo_t > > are both universally understood. I can't know what a "foo_t" is without looking it up, so it's not "universal" in any meaningful sense. > "struct foo" however clutters the > code, especially in

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread David Brownell
[ offtopic threads #2, #3, ... ] > The reason why I did not plug arm11 into the existing arm > infrastructure and why we implemented etm as a tcl script "We" didn't see any such Tcl scripts posted though. "We" want to see ETM support that doesn't need to be rewritten from scratch for each new co

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread David Brownell
[ *ON* topic thread ] > Your patch is purely about enforcing arbitrary syntax rules and in the > process adding redundant code that obscures what is going on. For > example consider: > > ... > ARM11_HANDLER(bar), > GENERIC_ARM_HANDLER(dog), > ARM11_HANDLER(moo), > ... See, I count those *_HANDLE

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Øyvind Harboe
> Take for example: > > fields[0].tap = etm_reg->jtag_info->tap; > fields[0].num_bits = 32; > fields[0].out_value = reg->value; > fields[0].in_value = NULL; > fields[0].check_value = NULL; > fields[0].check_mask = NULL; > > fields[1].tap = etm_reg->jtag_info->tap; > fields[1].num_bits = 7; > fields

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 19:13, David Brownell wrote: > On Sunday 15 November 2009, Michael Bruck wrote: >> >>> The macro is right above the table. > > Yep.  At least, *now* it's right above. This is the original commit: http://openocd.git.sourceforge.net/git/gitweb.cgi?p=openocd/openocd;a=blob;f

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread David Brownell
On Sunday 15 November 2009, Michael Bruck wrote: > >>> The macro is right above the table. Yep. At least, *now* it's right above. > >> The problem with this sort of macros is that ... it doesn't really add anything. Even though it *is* right above that table, you still have to think more abou

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 16:49, Michael Bruck wrote: > On Sun, Nov 15, 2009 at 16:39, Øyvind Harboe wrote: >> On Sun, Nov 15, 2009 at 4:26 PM, Michael Bruck wrote: >>> On Sun, Nov 15, 2009 at 10:08, Øyvind Harboe >>> wrote: On Sun, Nov 15, 2009 at 3:48 AM, David Brownell wrote:

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 16:39, Øyvind Harboe wrote: > On Sun, Nov 15, 2009 at 4:26 PM, Michael Bruck wrote: >> On Sun, Nov 15, 2009 at 10:08, Øyvind Harboe wrote: >>> On Sun, Nov 15, 2009 at 3:48 AM, David Brownell wrote: Three changes:  remove ARM11_HANDLER() in favor of normal structure

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Øyvind Harboe
On Sun, Nov 15, 2009 at 4:26 PM, Michael Bruck wrote: > On Sun, Nov 15, 2009 at 10:08, Øyvind Harboe wrote: >> On Sun, Nov 15, 2009 at 3:48 AM, David Brownell wrote: >>> Three changes:  remove ARM11_HANDLER() in favor of normal structure >> >> I like this cleanup. It makes it possible to read co

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Michael Bruck
On Sun, Nov 15, 2009 at 10:08, Øyvind Harboe wrote: > On Sun, Nov 15, 2009 at 3:48 AM, David Brownell wrote: >> Three changes:  remove ARM11_HANDLER() in favor of normal structure > > I like this cleanup. It makes it possible to read code without > special knowledge about ARM11 helper macros... >

Re: [Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-15 Thread Øyvind Harboe
On Sun, Nov 15, 2009 at 3:48 AM, David Brownell wrote: > Three changes:  remove ARM11_HANDLER() in favor of normal structure I like this cleanup. It makes it possible to read code without special knowledge about ARM11 helper macros... -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9

[Openocd-development] [patch 3/4] ARM11: fixup method table

2009-11-14 Thread David Brownell
Three changes: remove ARM11_HANDLER() in favor of normal structure initialization syntax; fix goofy indentation in that structure; and don't needlessly export arm11_register_commands(), it's only called through that method table. --- src/target/arm11.c | 88 -