Opened 5 years ago

Last modified 4 years ago

#94 accepted defect

sim: Signed integer value is shown as unsigned.

Reported by: Lukáš Zaoral Owned by: Vladimír Štill
Priority: major Milestone: 4.4
Component: sim Keywords:
Cc: kdudka@…, jamartis@…, lzaoral@…


if I run the following code in the divine sim (occurs also on next builds):

  int main(void)
      int a = -1;
      return 0;

the show .x command outputs:

  # executing main at test4.c:4
  > show
      address: heap* 1f78a5dd 0+0
      size:    16
      pc:      code* 80001 0
      location: test4.c:4
      symbol:  main
      type:    int
      value:   [i32 4294967295 d]
      scope:   main
  related:     [ caller ]

where the a value should be interpreted as signed, i.e. -1, instead. Thanks!

Change History (2)

comment:1 Changed 5 years ago by Lukáš Zaoral

Sorry, there's a typo in the description. Of course I meant plain show instead of show .x.

comment:2 Changed 4 years ago by Vladimír Štill

Owner: changed from mornfall to Vladimír Štill
Status: newaccepted

This is because LLVM does not distinguish between signed and unsigned numbers. However, as we already have the type from debug info it should be possible to output it as signed based on the type.

Note: See TracTickets for help on using tickets.