6.1 - Base Class watch capabilty has gone again!

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have just found that my base classes can no longer be watched in 6.1.

I tried applying the 6.1beta patch and the base class name is now visible but cannot be expanded.

more details when I get a chance.

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just did another test with a base class with virtual functions and a derived class. All works fine.
my test yesterday also had templates. Will look at it tomorrow.

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

hmmm... I wrote a small test program and can watch base classes of a derived class. I then tried a template with a base class. this was OK as well.

for some reason I cannot watch the base class in the code below

class timerBase
{
	public:
		unsigned char prescale;
		unsigned char size;
		unsigned char max;
		
		timerBase(void){};
		void _tick(typeTimer * timer, tSignal signal);
		virtual bool tick(void);
		typeTimer * get(typeTimer * timer, unsigned char qSize, unsigned char resetType);
		void stop(typeTimer * timer,  unsigned char pid);
};

template  class Timer : public timerBase
{
	private:

	public:
		volatile unsigned char busy;
		
		typeTimer buf[qSize];
		
		Timer(void)
		{
			prescale = _prescale;
		};
		
		bool tick(void);
		void start(unsigned char ticks, unsigned char pid);
		void stop(unsigned char pid);
};

attempting to watch the variable below

extern timerBase * const timers[];

gives the message

Quote:
"An invalid DIE offset was passed to getDieFromId"

any ideas?

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

anyone from atmel able to comment? particularly on

Quote:
"An invalid DIE offset was passed to getDieFromId"

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gregd99 wrote:
anyone from atmel able to comment?

Hi Greg
I'm afraid I need more details. I tried your code sample and could watch the base class (at -O0):

-		t	{class Timer2<10u, 4u, 1, 3u>@0x0f98 (FP-104)}	class Timer2<10u, 4u, 1, 3u>@0x0f98 (FP-104)
-		class_timerBase	{class timerBase@0x0f98}	class timerBase@0x0f98
+		_vptr_timerBase	0x80000614	function **@0x0f98
		prescale	4	unsigned char@0x0f9c
		size	25	unsigned char@0x0f9d
		max	107	unsigned char@0x0f9e
		busy	62	unsigned char@0x0f9f
+		buf	{typeTimer[10]@0x0fa0}	typeTimer[10]@0x0fa0

with :

typedef void*typeTimer;
typedef int tSignal;
volatile Timer2<10,4,1,3> t;

Regards,
Dan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dan,
Thanks for trying.

I am not able to compile at -O0 as I run out of flash. Would you be able to check at -OS?

I tried changing fomratmega16 to atmega328 to get some more flash.... but have a whole set of registers that need to change name.

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Greg,

I was trying on the simulator, with uc3, hence the avr32 toolchain. Will give it a try on mega, which uses the (different) avr8 toolchain.
What are your template instance parameters ?

Edit: I tried the same code on mega328, simulator, and could still see the base class members.

Is there any chance you could send me the ELF file + the name of the global variable you are trying to watch ?

Dan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dan,
the variables are timer10, timer1000 and timers. the latter gives the error above. the others have base classes that cannot be watched.

elf file attached.

Attachment(s): 

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What's the point of the elf without the source? You do realise that elf does not contain source annotation don't you? All it has if references to filenames and line numbers. Those .c and .h are read separately.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

just doing as I was asked.....

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Greg

Sorry for the long delay, we've had a very long weekend in Norway. Now, back to work :(
The elf file you've sent has relatively little debug info (or maybe it's hidden in the .debug_abbrev ELF section, which I don't know much about).

Comparing it to my test file, the types are hardly described at all.

What are your compile and link options ? Can you try increasing debug info (e.g. -g2 or -g3), and check that the linker options are similar to default (-Wl,-Map="$(OutputFileName).map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mmcu=atmega328)
?
Thanks,
Dan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dan,
the linker optiosn are

Quote:
-Wl,-Map="trainIOcpp.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -Wl,-section-start=.eeprom=0x810002 -mmcu=atmega16
and compiling with g2 or g3 makes no difference.

I have changed my approach not to use virtual functions which seems somehow to be the trigger for the issue I saw.

regards
Greg

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After some discussions with Dan offline the issue was that a virtual function in a base class was declared but not defined (I hope I have got those words right).

in the base class I had

virtual void f(void);

but never defined the body of the function. A bit embarrassing....

Changing to

virtual void f(void){};

solved the problem with all members able to be watched.

There was no error from the compiler or linker. :(

Dan has raised a fault ticket.

regards
Greg