Page MenuHomeFreeBSD

Sync libcxxrt demangler with libelftc plus fixes
Needs ReviewPublic

Authored by dim on Nov 2 2020, 6:30 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 12 2023, 6:55 PM
Unknown Object (File)
Nov 6 2023, 4:09 AM
Unknown Object (File)
Nov 4 2023, 6:35 PM
Unknown Object (File)
Oct 9 2023, 5:57 PM
Unknown Object (File)
Oct 5 2023, 3:06 AM
Unknown Object (File)
Oct 3 2023, 6:32 PM
Unknown Object (File)
Sep 25 2023, 2:18 AM
Unknown Object (File)
Sep 11 2023, 1:22 PM
Subscribers

Details

Reviewers
emaste
yuri
Summary

This updates the private copy of libelftc_dem_gnu3.c in libcxxrt with
the most recent version from upstream r3806. I also added all the fixes
from D27058.

We should really have some way of either automatically updating this
file from libelftc, or make it use the libelftc .c files directly, but
for now this will do.

Test Plan

Same as for D27058, but using this small test program:

#include <cxxabi.h>
#include <stdio.h>
#include <stdlib.h>

static void demangle(const char *mangled_name)
{
  int status;
  char *demangled_name = abi::__cxa_demangle(mangled_name, NULL, NULL, &status);
  switch (status) {
  case 0:
    printf("%s -> %s\n", mangled_name, demangled_name);
    break;
  case -1:
    printf("error: memory allocation failure while demangling %s\n", mangled_name);
    break;
  case -2:
    printf("error: %s is not a valid C++ mangled name\n", mangled_name);
    break;
  case -3:
    printf("error: invalid argument(s) while demangling %s\n", mangled_name);
    break;
  default:
    printf("error: unknown status %d while demangling %s\n", status, mangled_name);
    break;
  }
  free(demangled_name);
}

int main(int argc, char *argv[])
{
  if (argc <= 1) {
    printf("Usage: %s mangled_name ...\n", argv[0]);
    return 1;
  }
  for (int i = 1; i < argc; ++i) {
    demangle(argv[i]);
  }
  return 0;
}

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 34571
Build 31663: arc lint + arc unit