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


Date: Wed, 24 Nov 2021 09:04:02 -0800
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] cf56fe: Clean up BPatch::createEnum
  Branch: refs/heads/thaines/improve_dwarf_enum_handling
  Home:   https://github.com/dyninst/dyninst
  Commit: cf56fefe7d540f2709a0a36f4801f03501c9c0d0
      https://github.com/dyninst/dyninst/commit/cf56fefe7d540f2709a0a36f4801f03501c9c0d0
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-24 (Wed, 24 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: 345c96c2ed32c7c309df9f9b59a6ad44cbf010b8
      https://github.com/dyninst/dyninst/commit/345c96c2ed32c7c309df9f9b59a6ad44cbf010b8
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-24 (Wed, 24 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: 6bcd69af73f5df896b6beea44c0d99d7d1beed12
      https://github.com/dyninst/dyninst/commit/6bcd69af73f5df896b6beea44c0d99d7d1beed12
  Author: Tim Haines <thaines@xxxxxxxxxxx>
  Date:   2021-11-24 (Wed, 24 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/414ef7541b5c...6bcd69af73f5
[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] cf56fe: Clean up BPatch::createEnum, Tim Haines <=