low-level debugging help

Discuss the Firewing development environment

low-level debugging help

Postby Jerry Messina » Sat Aug 03, 2013 3:04 pm

I'm having a hard time relating the source code in the .bas file to the compiler end result.

I've enabled the compiler IDE option to 'keep all working files' so I can look at the .c, .s, and .lst files.

I see lots of asm comment labels inserted into the .c file, but I guess my problem is that I can't (easily) relate the .bas to the resulting .c file, so the other files don't help much.

Is there any way of getting a "mixed bas src + asm listing" file, similar to what you can get out of pic30-objdump when your using C?

I can get some of the info if I use MPLAB's disassembly view window, but that has a lot of the symbolic info removed (plus it's hard to work with on a large scale). Not really what I'm looking for.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: low-level debugging help

Postby David John Barker » Sat Aug 03, 2013 5:38 pm

Hi Jerry

Two things that may help. At the top of your program, add
Code: Select all
#option _showcomments = true
#option _showvar = true

This will (1) place comments in the intermediate (*.c) file and (2) adds the original name to a name mangled variable in the intermediate file. Let me know if this helps or not.
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: low-level debugging help

Postby Jerry Messina » Sun Aug 04, 2013 12:44 pm

Thanks. That definitely helps, at least going from the .bas to the .c file. Since they're a C comment though, they don't make it much past that.

I notice that there are tons of asm labels created in the .c file, along the lines of
Code: Select all
    // fa = 1.4
   asm volatile("; RD_I000009_F000_000029_P000118");
   fa_F30_F32.val = 1.4;
I suppose they serve a purpose of some sort, but can these be suppressed? They tend to make the C file harder to read.

Or better yet ,can they be replaced with a comment that shows the .bas source line instead? Something like
Code: Select all
   asm volatile("; // fa = 1.4");
   fa_F30_F32.val = 1.4;

That way, the original source line would appear in the asm output.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: low-level debugging help

Postby David John Barker » Sun Aug 04, 2013 12:56 pm

> asm volatile("; RD_I000009_F000_000029_P000118");

That's used to generate debugging information. Disable COFF to block. Alternatively, use
Code: Select all
#option _build = edit

rather than
Code: Select all
#option _showcomments = true
#option _showvar = true

this will _showcomments and _showvar, but will suppress debugging information. I'm not sure why you would want to go as deep and seeing the source line within the ASM?
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: low-level debugging help

Postby Jerry Messina » Sun Aug 04, 2013 1:20 pm

>#option _build = edit

That produces a nice, easy to read C file, but I didn't really want to disable COFF.

>I'm not sure why you would want to go as deep and seeing the source line within the ASM?

Currently with SF I do this for two reasons:
1). It makes it easy to optimize routines if I can relate the asm output to the source code
and
2). It's easier to trace through and find out why things aren't working as expected (whatever the reason).

Maybe with having the C file in between this isn't as easy anymore. I suppose I can always use the asm "RD_I000019_F000_000043_P000118" marker to relate the C to asm files, but this definitely is more work.
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am

Re: low-level debugging help

Postby David John Barker » Sun Aug 04, 2013 3:47 pm

OK, so something like '_showasmcomments'?
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: low-level debugging help

Postby David John Barker » Sun Aug 04, 2013 5:27 pm

I've created a new BETA build, which you can download from here:

http://www.firewing.info/pmwiki.php?n=Firewing.Download

you can add source lines to the asm file by using the following:
Code: Select all
#option _showasmcomments = true
User avatar
David John Barker
 
Posts: 491
Joined: Thu Nov 08, 2012 12:21 pm

Re: low-level debugging help

Postby Jerry Messina » Mon Aug 05, 2013 10:29 am

Gee, I take a break to do some yard work and voila!

That works out nicer than GCC's implementation... don't even have to use objdump to get a mixed source/asm output.

Thanks!
Jerry Messina
 
Posts: 280
Joined: Thu Feb 14, 2013 10:16 am


Return to Development Environment

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x