Opened 6 years ago
Last modified 6 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@… | 
Description
Hello,
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
  attributes:
      address: heap* 1f78a5dd 0+0
      size:    16
      pc:      code* 80001 0
      location: test4.c:4
      symbol:  main
  .a:
      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 6 years ago by
comment:2 Changed 6 years ago by
| Owner: | changed from mornfall to Vladimír Štill | 
|---|---|
| Status: | new → accepted | 
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.
  
Sorry, there's a typo in the description. Of course I meant plain
showinstead ofshow .x.