Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-23 Thread Øyvind Harboe
On Mon, Nov 23, 2009 at 10:57 PM, Zach Welch wrote: > On Mon, 2009-11-23 at 22:22 +0100, Andreas Fritiofson wrote: >> On Sun, Nov 22, 2009 at 12:42 PM, Øyvind Harboe >> wrote: >> > On Sun, Nov 22, 2009 at 11:04 AM, Andreas Fritiofson >> > wrote: >> >> On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Har

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-23 Thread Zach Welch
On Mon, 2009-11-23 at 22:22 +0100, Andreas Fritiofson wrote: > On Sun, Nov 22, 2009 at 12:42 PM, Øyvind Harboe > wrote: > > On Sun, Nov 22, 2009 at 11:04 AM, Andreas Fritiofson > > wrote: > >> On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Harboe > >> wrote: > >>> Do not use variable length arrays. U

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-23 Thread Øyvind Harboe
Thanks for following up on this. The style guide needs updating w.r.t. embedded considerations(I was going to work on the style guide the other day, but docs didn't build at the time and then I forgot about it...) > However, alloc_vprintf() seems to have a rather cumbersome > implementation. Is t

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-23 Thread Andreas Fritiofson
On Sun, Nov 22, 2009 at 12:42 PM, Øyvind Harboe wrote: > On Sun, Nov 22, 2009 at 11:04 AM, Andreas Fritiofson > wrote: >> On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Harboe >> wrote: >>> Do not use variable length arrays. Use malloc(). >>> >>> If you use variable length arrays on the stack that mes

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-22 Thread Øyvind Harboe
On Sun, Nov 22, 2009 at 11:04 AM, Andreas Fritiofson wrote: > On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Harboe > wrote: >> Do not use variable length arrays. Use malloc(). >> >> If you use variable length arrays on the stack that messes with embedded >> / uCLinux hosts. >> > > Only if the embedded

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-22 Thread Andreas Fritiofson
On Sun, Nov 22, 2009 at 9:51 AM, Øyvind Harboe wrote: > Do not use variable length arrays. Use malloc(). > > If you use variable length arrays on the stack that messes with embedded > / uCLinux hosts. > Only if the embedded host uses a home directory path longer than what will fit on the stack. I

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-22 Thread Øyvind Harboe
On Sun, Nov 22, 2009 at 1:56 AM, Andreas Fritiofson wrote: > On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch wrote: >> Checkout your branch and run 'git rebase master'.  That will update your >> branch against the current master.  Then, do the same thing with '-i'. >> Select the patches to change and

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sun, Nov 22, 2009 at 2:05 AM, Zach Welch wrote: > On Sun, 2009-11-22 at 01:56 +0100, Andreas Fritiofson wrote: >> On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch wrote: >> > Checkout your branch and run 'git rebase master'.  That will update your >> > branch against the current master.  Then, do t

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Zach Welch
On Sun, 2009-11-22 at 01:56 +0100, Andreas Fritiofson wrote: > On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch wrote: > > Checkout your branch and run 'git rebase master'. That will update your > > branch against the current master. Then, do the same thing with '-i'. > > Select the patches to change

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sun, Nov 22, 2009 at 1:13 AM, Zach Welch wrote: > Checkout your branch and run 'git rebase master'.  That will update your > branch against the current master.  Then, do the same thing with '-i'. > Select the patches to change and mark them with 'e', change the files, > add them and --amend the

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Zach Welch
On Sun, 2009-11-22 at 00:52 +0100, Andreas Fritiofson wrote: > On Sat, Nov 21, 2009 at 9:31 PM, Øyvind Harboe > wrote: > > On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch wrote: > >> > >> PATH_MAX should be defined and available (in ). Use it. > > > > Why not just allocate dynamically and avoid the

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sat, Nov 21, 2009 at 9:31 PM, Øyvind Harboe wrote: > On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch wrote: >> >> PATH_MAX should be defined and available (in ).  Use it. > > Why not just allocate dynamically and avoid the problem at the root? > That sounds like the best solution, I'll prepare an

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Øyvind Harboe
On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch wrote: > On Sat, 2009-11-21 at 16:53 +0100, Andreas Fritiofson wrote: >> Add $HOME/.openocd as the first default script search directory, allowing >> the user to override the standard scripts. > > Comments are in-line and at the end. > >> Signed-off-by:

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
On Sat, Nov 21, 2009 at 7:14 PM, Zach Welch wrote: > On Sat, 2009-11-21 at 16:53 +0100, Andreas Fritiofson wrote: >> Add $HOME/.openocd as the first default script search directory, allowing >> the user to override the standard scripts. > > Comments are in-line and at the end. > >> Signed-off-by:

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Zach Welch
On Sat, 2009-11-21 at 16:53 +0100, Andreas Fritiofson wrote: > Add $HOME/.openocd as the first default script search directory, allowing > the user to override the standard scripts. Comments are in-line and at the end. > Signed-off-by: Andreas Fritiofson > --- > src/helper/options.c | 16

Re: [Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Øyvind Harboe
How about using a dynamic allocation and not worrying about max size at all? These changes seem reasonably to me, but without documentation to go with it, I fear nobody would use it. Could you add some? -- Øyvind Harboe http://www.zylin.com/zy1000.html ARM7 ARM9 ARM11 XScale Cortex JTAG debugger

[Openocd-development] [PATCH 3/3] support for scripts in $HOME/.openocd

2009-11-21 Thread Andreas Fritiofson
Add $HOME/.openocd as the first default script search directory, allowing the user to override the standard scripts. Signed-off-by: Andreas Fritiofson --- src/helper/options.c | 16 +++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/helper/options.c b/src/help