[Lldb-commits] [PATCH] D134493: [lldb][TypeSystemClang] Deduce lldb::eEncodingUint for unsigned enum types

Andy Yankovsky via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 23 04:57:01 PDT 2022


werat added a comment.

On a somewhat related note, is it expected that `GetValueAsUnsigned()` performs an overflow as `int32` if the type is smaller that `int64`?

  ❯ cat overflow.cc 
  #include <stdint.h>
  int main() {
    int8_t i8 = -1;
    int32_t i32 = -1;
    int64_t i64 = -1;
    return 0;
  }
  
  (lldb) script
  
  >>> lldb.frame.FindVariable("i8").GetValueAsUnsigned()
  4294967295
  >>> lldb.frame.FindVariable("i32").GetValueAsUnsigned()
  4294967295
  >>> lldb.frame.FindVariable("i64").GetValueAsUnsigned()
  18446744073709551615
  >>>




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134493/new/

https://reviews.llvm.org/D134493



More information about the lldb-commits mailing list