#1269 Incorrect register specifications emitted in CDB file

closed-fixed
None
5
2013-05-25
2007-01-04
sandra-l
No

I'm seeing incorrect information for block-scope variables in CDB files. The attached file was compiled with --debug. Procedure main contains four local variables; the .asm file says this about their assigned locations:

;------------------------------------------------------------
;Allocation info for local variables in function 'main'
;------------------------------------------------------------
;i Allocated to registers r2 r3 r4
;j Allocated with name '_main_j_1_1'
;k Allocated to registers r0 r1 r5
;l Allocated with name '_main_l_1_1'
;------------------------------------------------------------

But the CDB file contains this information about them:

S:Lmain$i$1$1({3}DG,SI:S),R,0,0,[r2,r3,r4]
S:Lmain$j$1$1({3}DG,SI:U),R,0,0,[r5,r6,r7]
S:Lmain$k$1$1({3}DG,SI:S),R,0,0,[r0,r1,r5]
S:Lmain$l$1$1({3}DG,SI:U),R,0,0,[]
L:Lmain$j$1$1:1C
L:Lmain$l$1$1:1F

E.g., the symbol records include bogus register specifications for j and l instead of identifying their true address space.

If I compile with --stack-auto, the CDB file still incorrectly identifies the variables as being in registers while the ASM file says they're stack-allocated instead.

Discussion

  • sandra-l

    sandra-l - 2007-01-04

    bar.c

     
  • sandra-l

    sandra-l - 2007-01-04

    Logged In: YES
    user_id=1683485
    Originator: YES

    Following up to my own bug report:

    I believe the attached patch to cdbFile.c fixes the problem. It copies the logic used in printing the location to the .asm file.

    File Added: cdb.patch

     
  • sandra-l

    sandra-l - 2007-01-04

    patch to cdbFile.c

     
  • Maarten Brock

    Maarten Brock - 2011-03-18

    Sorry for not applying this before. Your patch is now applied to SDCC 3.0.2 #6312. I've added your nickname in the Changelog, if you prefer your full name please add it here or email me.

     
  • Maarten Brock

    Maarten Brock - 2011-03-18
    • labels: 101552 -->
    • milestone: 100454 --> fixed
    • assigned_to: nobody --> maartenbrock
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks