[DynInst_API:] [dyninst/dyninst] f4ad9e: Clean up BPatch::createEnum


Date: Fri, 26 Nov 2021 19:00:54 -0800
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] f4ad9e: Clean up BPatch::createEnum
  Branch: refs/heads/thaines/improve_dwarf_enum_handling
  Home:   https://github.com/dyninst/dyninst
  Commit: f4ad9e82649ba3ffe2d3d12846ae3bae1d60d16b
      https://github.com/dyninst/dyninst/commit/f4ad9e82649ba3ffe2d3d12846ae3bae1d60d16b
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-26 (Fri, 26 Nov 2021)

  Changed paths:
    M dyninstAPI/src/BPatch.C
    M symtabAPI/h/Type.h
    M symtabAPI/src/Type.C

  Log Message:
  -----------
  Clean up BPatch::createEnum

This removes the unnecessary construction of a separate (thread-safe!)
container of pairs and the associated memory leaks. It also explicitly
makes the enum's underlying type a four-byte signed int. Redundant code
from the overload which computes the enum values was replaced by using
std::iota and calling the three-argument createEnum.


  Commit: eb4d867dc6b7c28542f673c27ffdb5c378bae300
      https://github.com/dyninst/dyninst/commit/eb4d867dc6b7c28542f673c27ffdb5c378bae300
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-26 (Fri, 26 Nov 2021)

  Changed paths:
    M symtabAPI/h/Type.h
    M symtabAPI/src/Type.C

  Log Message:
  -----------
  Remove factory functions

Adding overloads for these would add more clutter than utility. We
should remove these from all of the types as the constructors should
always be used to ensure class invariants.


  Commit: 13cd85c10ca0b4da38d727c25e02f6e18f0cc904
      https://github.com/dyninst/dyninst/commit/13cd85c10ca0b4da38d727c25e02f6e18f0cc904
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-26 (Fri, 26 Nov 2021)

  Changed paths:
    M symtabAPI/h/Type.h
    M symtabAPI/src/Type.C

  Log Message:
  -----------
  Remove non-portable constructors

Since we're breaking ABI here, these constructors need to go. Manually
setting the size to `sizeof(int)` is non-portable as the
BPatch::createEnum may be used to modify a binary that doesn't have the
same `int` representation as the host on which Dyninst was compiled.


Compare: https://github.com/dyninst/dyninst/compare/bf7f9700804e...13cd85c10ca0
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] f4ad9e: Clean up BPatch::createEnum, Tim Haines <=