Trouble with Cortex-M "Hello World"
Johannes Pfau via Digitalmars-d
digitalmars-d at puremagic.com
Thu Apr 2 02:28:45 PDT 2015
Am Thu, 02 Apr 2015 05:55:48 +0000
schrieb "Jens Bauer" <doctor at who.no>:
>
> So are there any suggestions on enabling debug-code, which might
> give hints on what is going wrong ?
I'm not sure if there's any debug code, but here's what I would do:
/opt/gdc/bin/gdc test.d -c -wrapper gdb,--args
break expression.c:11707
break expression.c:11570
break init.c:1015
run
Breakpoint 2, AssignExp::semantic (this=0x7ffff656fad0,
sc=0x7ffff656f440)
at ../../gcc-5-20150201/gcc/d/dfrontend/expression.c:11570
* bt (not that useful in this case)
* maybe print the dim1/2 values in gdb.
* Look at code: we're interested in TypeSArray
* grep TypeSArray parse.c
break parse.c:3104
break parse.c:2969
break parse.c:7666
run
Breakpoint 2, Parser::parseBasicType2 (this=0x7fffffffdc70,
t=0x7ffff64de350)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:2969
2969 t = new TypeSArray(t,e);
print *e
print e->toChars()
print *(IntegerExp*)e
break expression.c:2620
run (y)
print loc
cont (wrong integerexp)
print loc
cont (wrong integerexp)
IntegerExp::IntegerExp (this=0x7ffff64e1ff0, loc=..., value=0,
type=0x7ffff64de2c0)
at ../../gcc-5-20150201/gcc/d/dfrontend/expression.c:2620
2620 IntegerExp::IntegerExp(Loc loc, dinteger_t value, Type
*type)
(gdb) print loc
$3 = {filename = 0x1d6db30 "test.d", linnum = 9, charnum = 10}
(gdb) bt
#0 IntegerExp::IntegerExp (this=0x7ffff64e1ff0, loc=..., value=0,
type=0x7ffff64de2c0)
at ../../gcc-5-20150201/gcc/d/dfrontend/expression.c:2620
#1 0x000000000070bd57 in Parser::parsePrimaryExp (
this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:6893
#2 0x00000000007075b9 in Parser::parseUnaryExp (
this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7247
#3 0x0000000000707d52 in Parser::parseMulExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7270
#4 0x0000000000707ea2 in Parser::parseAddExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7293
#5 0x0000000000707ff2 in Parser::parseShiftExp (
this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7316
#6 0x0000000000708141 in Parser::parseCmpExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7340
#7 0x00000000007083a1 in Parser::parseAndExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7413
#8 0x0000000000708462 in Parser::parseXorExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7430
#9 0x0000000000708532 in Parser::parseOrExp
(this=this at entry=0x7fffffffdc70)
---Type <return> to continue, or q <return> to quit---
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7446
#10 0x0000000000708602 in Parser::parseAndAndExp (
this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7464
#11 0x00000000007086a2 in Parser::parseOrOrExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7480
#12 0x0000000000708742 in Parser::parseCondExp
(this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7497
#13 0x00000000007087e6 in Parser::parseAssignExp (
this=this at entry=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:7515
#14 0x000000000070b54b in Parser::parseBasicType2 (this=0x7fffffffdc70,
t=0x7ffff64de350)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:2961
#15 0x0000000000703e84 in Parser::parseDeclarations
(this=0x7fffffffdc70,
autodecl=48, pAttrs=0xa00000009, comment=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:3516
#16 0x00000000007010de in Parser::parseStatement (this=0x7fffffffdc70,
flags=9, endPtr=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:4413
#17 0x00000000007013fb in Parser::parseStatement (this=0x7fffffffdc70,
flags=2, endPtr=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:4498
#18 0x000000000070210c in Parser::parseStatement (this=0x7fffffffdc70,
flags=-162652272, endPtr=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:4518
---Type <return> to continue, or q <return> to quit---
#19 0x00000000007013fb in Parser::parseStatement (this=0x7fffffffdc70,
flags=1, endPtr=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:4498
#20 0x0000000000703b2d in Parser::parseContracts (this=0x7fffffffdc70,
f=
0x7ffff64e1d40) at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:3874
#21 0x00000000007044da in Parser::parseDeclarations
(this=0x7fffffffdc70,
autodecl=48, autodecl at entry=false, pAttrs=0xa00000009,
pAttrs at entry=0x7fffffffdb80, comment=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:3688
#22 0x0000000000705601 in Parser::parseDeclDefs (
this=this at entry=0x7fffffffdc70, once=once at entry=0,
pLastDecl=0x7fffffffdb18, pLastDecl at entry=0x0,
pAttrs=0x7fffffffdb80,
pAttrs at entry=0x0)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:337
#23 0x0000000000709a3b in Parser::parseModule (this=0x7fffffffdc70)
at ../../gcc-5-20150201/gcc/d/dfrontend/parse.c:187
#24 0x00000000006f3ec5 in Module::parse (this=0x7ffff64e1810)
at ../../gcc-5-20150201/gcc/d/dfrontend/module.c:519
#25 0x0000000000748e19 in d_parse_file ()
at ../../gcc-5-20150201/gcc/d/d-lang.cc:962
#26 0x0000000000bc2402 in compile_file ()
at ../../gcc-5-20150201/gcc/toplev.c:594
#27 0x0000000000616b9c in do_compile ()
at ../../gcc-5-20150201/gcc/toplev.c:2063
#28 toplev::main (this=this at entry=0x7fffffffdeb0, argc=argc at entry=11,
---Type <return> to continue, or q <return> to quit---
argv=argv at entry=0x7fffffffdfb8)
at ../../gcc-5-20150201/gcc/toplev.c:2161
#29 0x000000000061754a in main (argc=11, argv=0x7fffffffdfb8)
at ../../gcc-5-20150201/gcc/main.c:39
It could be quite some more work to find where exactly things go wrong,
but this should give an idea about one way to debug this.
More information about the Digitalmars-d
mailing list