Trouble with Cortex-M "Hello World"

Jens Bauer via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 2 05:51:41 PDT 2015


I got a little further, and will continue to look into the issue.
Currently, this is what I've gotten so far...

arm-none-eabi-gdc start.d -c -wrapper gdb,--args

break expression.c:11707
break expression.c:11570
break init.c:1015
break init.c:557
run

...

Breakpoint 1, AssignExp::semantic (this=0x4170b9f0, 
sc=0x4170b860) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/expression.c:11707
11707	                error("mismatched array lengths, %d and 
%d", (int)dim1, (int)dim2);


(gdb) print dim1
$1 = 0

(gdb) print dim2
$2 = 3

... dim1 is the one which is incorrect.
dim1 comes from tsa1; tsa1 comes from se1, se1 comes from e1.


(gdb) print *e1
$3 = {
   <RootObject> = {
     _vptr$RootObject = 0xf07570
   },
   members of Expression:
   loc = {
     filename = 0x41605be0 "start.d",
     linnum = 46,
     charnum = 13
   },
   op = TOKvar,
   type = 0x41709040,
   size = 36 '$',
   parens = 0 '\0'
}

(gdb) print e1->toChars()
$4 = 0x41611a74 "message"

(gdb) print e1->isLvalue()
$5 = 1

(gdb) print e1->type->ty
$6 = 1 '\001'


(gdb) bt
#0  AssignExp::semantic (this=0x4170b9f0, sc=0x4170b860) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/expression.c:11707
#1  0x0003e230 in _ZN10Expression8optimizeEib [inlined] () at 
expression.h:1409
#2  VarDeclaration::semantic (this=0x417093c0, sc=0x4170b860) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/declaration.c:1411
#3  0x00059204 in DeclarationExp::semantic (this=0x417094a0, 
sc=0x4170b750) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/expression.c:5958
#4  0x000fed38 in ExpStatement::semantic (this=0x41709480, 
sc=0x4170b750) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/statement.c:835
#5  0x00105a64 in CompoundStatement::semantic (this=0x4170b7f0, 
sc=0x4170b750) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/statement.c:1044
#6  0x00104838 in ScopeStatement::semantic (this=0x41709600, 
sc=0x4170b750) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/statement.c:1336
#7  0x0010a890 in ForStatement::semantic (this=0x4170b680, 
sc=0x4170aee0) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/statement.c:1546
#8  0x00105a64 in CompoundStatement::semantic (this=0x41709640, 
sc=0x4170ae40) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/statement.c:1044
#9  0x0007f2ec in FuncDeclaration::semantic3 (this=0x41708e70, 
sc=0x4170aa00) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/func.c:1622
#10 0x000d6f18 in Module::semantic3 (this=0x41707a90) at 
/Users/jens/toolchain/Source/gcc/gcc/d/dfrontend/module.c:787
#11 0x0012c38c in d_parse_file () at 
/Users/jens/toolchain/Source/gcc/gcc/d/d-lang.cc:1064
#12 0x00773ca8 in timevar_pop [inlined] () at timevar.h:548
#13 0x00773ca8 in compile_file () at 
/Users/jens/toolchain/Source/gcc/gcc/toplev.c:550
#14 0x00774c2c in do_compile () at 
/Users/jens/toolchain/Source/gcc/gcc/toplev.c:1926
#15 0x0077519c in toplev_main (argc=11, argv=0xbffff148) at 
/Users/jens/toolchain/Source/gcc/gcc/toplev.c:2002
#16 0x00002404 in start ()


More information about the Digitalmars-d mailing list