[DynInst_API:] [dyninst/dyninst] f3a01e: Fix several bugs in common/src/pathName.C


Date: Tue, 05 Feb 2019 11:31:11 -0800
From: Tim Haines <noreply@xxxxxxxxxx>
Subject: [DynInst_API:] [dyninst/dyninst] f3a01e: Fix several bugs in common/src/pathName.C
  Branch: refs/heads/master
  Home:   https://github.com/dyninst/dyninst
  Commit: f3a01e30833221d1fe39026bb478e535131a3620
      https://github.com/dyninst/dyninst/commit/f3a01e30833221d1fe39026bb478e535131a3620
  Author: Tim Haines <thaines.astro@xxxxxxxxx>
  Date:   2019-02-05 (Tue, 05 Feb 2019)

  Changed paths:
    M common/src/addrtranslate-linux.C
    M common/src/addrtranslate-sysv.C
    M common/src/pathName.C
    M common/src/pathName.h
    M common/src/serialize-bin.C
    M dyninstAPI/src/freebsd.C
    M proccontrol/src/linux.C
    M proccontrol/src/loadLibrary/codegen-freebsd.C

  Log Message:
  -----------
  Fix several bugs in common/src/pathName.C

FIXED:
1. Tilde expansion is done _before_ the existence check.
	Since `stat` does not do shell expansions, resolve_file_path("~")
    always returned an empty string instead of the expanded path.

2. Tilde detection logic was inverted

3. Remove possible buffer overflow when making path relative to CWD

ADDED features:

1. Removes leading and trailing whitespace

2. Add basic support for Windows file system by using Boost::filesystem
	Expansion of Windows-specific shell variables, e.g. %HOME%, is _not_
    supported.

3. Leverage move semantics to reduce copying
	This reduces the maximum number of string copies from 5 to 3. When
	resolve_file_path is invoked with an r-value, there are only two
    copies.


[← Prev in Thread] Current Thread [Next in Thread→]
  • [DynInst_API:] [dyninst/dyninst] f3a01e: Fix several bugs in common/src/pathName.C, Tim Haines <=