Re: [AVaRICE-user] Debug trace the next

2013-01-11 Thread Joerg Wunsch
As Andreas Løhre wrote:

 I have attached an strace for 4.6.3 (same behaviour as 4.7.2), but I won't
 be able to do the one for 4.7/4.4/4.5 before tomorrow.

Thanks to all who helped narrowing this down.

I could eventually reproduce it myself with a GCC 4.7, and then find
and fix it.

It's been a pointer aliasing problem.  The device parameter field was
filled in like:

  uchar *param, paramsize;

  ...
  {
jtag3_device_desc_type d3;

param = (uchar *)d3;
paramsize = sizeof d3;
memset((void *)d3, 0, sizeof d3);

// fill in params here:
d3.flash_size ...
d3.flash_page_size

...
  }

  setJtagParameter(SCOPE_AVR, 2, PARM3_DEVICEDESC, param, paramsize);

GCC 4.7 decided that every assignment to d3 after the initial
memset() would result in values that are not used, as d3 was out
of scope at that point.  Thus, a null parameter block has been
sent.

Moving the definition of d3 to the next outer scope helped.

OK, I'd like to hear about any other issues people have with it ...
In case it dies after some debugging actions, it would be interesting
to see the -d trace of the actions taken.
-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

--
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


Re: [AVaRICE-user] Debug trace the next

2013-01-10 Thread Andreas Løhre
I tried it briefly yesterday, and by using the latest SVN I was able to do
a debug session on the ATmega2560. I was still not able to start a session
on the 1284P. I will try some more on the different computers I have and
send the logs tonight.


On Wed, Jan 9, 2013 at 8:24 AM, Andreas Løhre alo...@gmail.com wrote:




 On Tue, Jan 8, 2013 at 9:31 PM, Joerg Wunsch j...@uriah.heep.sax.de wrote:

 As Andreas Løhre wrote:

  I have attached a couple of the failing runs on my Atmega2560. The
 device
  is running at 8MHz and no clkdiv8.

 Please try the current SVN again.  I've committed a number of small
 changes.  Among them is that the CMD3_START_DEBUG command (which was
 failing on you) is no longer attempted except for debugWIRE targets.
 All other targets don't appear to need this command.


 I will try again tonight and report how it works.



 Also, I implemented something which I've always intended: the GDB
 load command now works again.  Prerequisite is you need a
 sufficiently recent GDB (version 7+), since these versions now can
 automatically detect whether they operate on flash memory, issue a
 FlashErase first (alas, I couldn't get page erases to work, so it's
 still a chip erase for AVRs), then download all the data, and finally
 emit a FlashEnd command so AVaRICE knows there are no more data to
 expect, and everything can be committed to flash in terms of page
 writes.


 That is really nice! Looking forward to testing this.



 This should be a much more versatile replacement for the deprecated
 flash download functionality from the commandline.  In particular, you
 can now stay within one GDB (and AVaRICE) session even if you
 recompiled your target binary: GDB automatically detects if the ELF
 file has changed, and reloads it, so all you need then is to re-issue
 another load command.

 I also implemented a monitor backend command, but there's not much
 more in it than help and version (so, that's monitor version
 from within GDB).  AVaRICE specific backend hacks might be added in
 future, like direct support for ICE commands (in hex form).

 The only thing which is currently on my wishlist and not yet done is
 to add Xmega watchpoint support (data breakpoints).  megaAVR
 watchpoints are supposed to work again though (so we are better than
 Atmel Studio 6, hi :).
 --
 cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

 http://www.sax.de/~joerg/NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)


 --
 Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
 and more. Get SQL Server skills now (including 2012) with LearnDevNow -
 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
 SALE $99.99 this month only - learn more at:
 http://p.sf.net/sfu/learnmore_122512
 ___
 avarice-user mailing list
 avarice-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/avarice-user




 --
 Mvh. Andreas Løhre




-- 
Mvh. Andreas Løhre
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


Re: [AVaRICE-user] Debug trace the next

2013-01-10 Thread Joerg Wunsch
As Andreas Løhre wrote:

 I was still not able to start a session
 on the 1284P.

OK, I'm interested in seeing the debug traces for that.
-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


Re: [AVaRICE-user] Debug trace the next

2013-01-10 Thread Joerg Wunsch
As Andreas Løhre wrote:

 The full output is:

An interesting list, thanks!

 [jtag2rw.cc:180]: (error) Memory leak: response
 [jtag3rw.cc:182]: (error) Memory leak: response

Both these are actually the same (with the jtag3 code being cloned
from the jtag2 implementation).  All this looks confusing, and I have
to think about it again (there's a usage of resp versus response
inside these functions).

 [jtag2usb.cc:422]: (error) Mismatching allocation and deallocation:
 devnamecopy

Created as an array, but deleted as a non-array.  Fixed.

 [jtag2usb.cc:302]: (error) Memory leak: devnamecopy

Yes, in cas of an error; fixed.

 [jtag3io.cc:495]: (error) Array 'cmd[4]' accessed at index 4, which is out
 of bounds

As you've guessed, 0, 1, 2, 3 is the correct sequence.  Besides
accessing the array out of bounds, the bug lead to the request for
applying an external reset (throgh nSRST) not being obeyed at all.
Fixed.

I'm afraid the next step would be to strace both invocations, and see
what is done differently in the version as compiled by GCC 4.7.
-- 
cheers, Jorg   .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user


Re: [AVaRICE-user] Debug trace the next

2013-01-07 Thread Andreas Løhre
It was using JTAG. I haven't tried PDI yet as I don't have the connector
available.

Andreas


On Mon, Jan 7, 2013 at 8:28 PM, Knut Schwichtenberg ksc...@web.de wrote:

  Hi Andreas,

 which debug IF did you use: PDI or JTAG for the XMega?

 Cheers,
 Knut

 At 07.01.2013 20:24, wrote Andreas Løhre:

 Same errors as the m2560 with the 1284P - no luck.

  XMEGA128A1 works perfectly, as far as I have tested, with some stepping
 and a breakpoint inserted.


 On Mon, Jan 7, 2013 at 7:44 PM, Andreas Løhre alo...@gmail.com wrote:

 I have attached a couple of the failing runs on my Atmega2560. The device
 is running at 8MHz and no clkdiv8.

  I'll try with the 1284P next.


  Andreas





-- 
Mvh. Andreas Løhre
Tlf: 936 50 366
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412___
avarice-user mailing list
avarice-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/avarice-user