[all-commits] [llvm/llvm-project] ae58cf: [lldb] Fix that LLDB doesn't print NaN's sign on D...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Tue May 25 04:34:06 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ae58cf5f45a9c159afbf86e93c0c257a22c4ee02
      https://github.com/llvm/llvm-project/commit/ae58cf5f45a9c159afbf86e93c0c257a22c4ee02
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2021-05-25 (Tue, 25 May 2021)

  Changed paths:
    M lldb/source/Core/DumpDataExtractor.cpp
    M lldb/unittests/Core/DumpDataExtractorTest.cpp

  Log Message:
  -----------
  [lldb] Fix that LLDB doesn't print NaN's sign on Darwin

It seems std::ostringstream ignores NaN signs on Darwin while it prints them on
Linux. This causes that LLDB behaves differently on those platforms which is
both confusing for users and it also means we have to deal with that in our
tests.

This patch manually implements the NaN/Inf printing (which are apparently
implementation defined) to make LLDB print the same thing on all platforms. The
only output difference in practice seems to be that we now print negative NaNs
as `-nan`, but this potentially also changes the output on other systems I
haven't tested this on.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D102845




More information about the All-commits mailing list