diff --git a/groups/bsl/bsls/bsls_stackaddressutil.cpp b/groups/bsl/bsls/bsls_stackaddressutil.cpp index adcc49c4b8..427361cf9c 100644 --- a/groups/bsl/bsls/bsls_stackaddressutil.cpp +++ b/groups/bsl/bsls/bsls_stackaddressutil.cpp @@ -6,7 +6,6 @@ BSLS_IDENT("$Id$ $CSID$") #include #include -#include #include #include #include @@ -267,78 +266,6 @@ uintptr_t getStackOffset() } // close unnamed namespace -namespace { - -const char *getPwhatVar(const char *const tag) - // Return the 'pwhat' variable with the specified 'tag'. The behavior is - // undefined unless 'tag' is a non-empty null-terminated string. Return - // '0' if the 'plink_timestamp___' global variable does not contain the - // 'tag' or is not well formed. -{ - // This is a modified version of 'sysutil_pwhat_getvar', adjusted to not - // use additional static data and to be more resilient if - // 'plink_timestamp___' is not formed as expected. - - assert(0 != tag); - - size_t taglength = strlen(tag); - assert(taglength > 0); - - // Assume that 'plink_timestamp___' is a '0'-terminated list of - // '0'-terminated strings. Each string should roughly match the regular - // expression '[^]]*] (?[A-Z]+) *: (?.*)'. - - for (int i = 0; 0 != plink_timestamp___[i]; ++i) { - - // search through '[^]]*]' - const char *p = strchr(plink_timestamp___[i], ']'); - if (0 == p) { - continue; - } - ++p; - - // make sure the next character is ' ' - if (' ' != *p) { - continue; - } - ++p; - - // see if the desired 'tag' is next - if (0 != strncmp(p,tag,taglength)) { - continue; - } - p += taglength; - - // identify if ' *:' is next and advance past the ':' - switch (*p) { - case ' ': { - p = strchr(p,':'); - } break; - case ':': { - } break; - default: { - // this is an invalid line or a tag that has the requested tag as a - // prefix. - continue; - } break; - } - ++p; - - // make sure the next character is ' ' (again) - if (' ' != *p) { - continue; - } - ++p; - - // the remaining part of this string is the value for the requested - // 'tag' - return p; // RETURN - } - - return 0; -} - -} // close unnamed namespace namespace BloombergLP { @@ -678,16 +605,6 @@ void StackAddressUtil::formatCheapStack(char *output, return; // RETURN } - const char *guid = getPwhatVar("GUID"); - if (0 != guid && 0 != *guid) { - printed = snprintf(out, rem, "-g %s ", guid); - out += printed; - rem -= printed; - if (printed < 0 || rem <= 0) { - return; // RETURN - } - } - #if defined(BSLS_PLATFORM_OS_AIX) // On AIX cheapstack expects the stack addresses to be offset based on // where the text segment was actually loaded - see DRQS 19990260, DRQS diff --git a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.cpp b/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.cpp deleted file mode 100644 index afd3c0bbee..0000000000 --- a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// bsls_stackaddressutil_plinktimestamp.cpp -*-C++-*- -#include - -#include -BSLS_IDENT("$Id$ $CSID$") - -#include - -// BDE_VERIFY pragma: -AQb01 -// BDE_VERIFY pragma: -TR04 - -// plink_timestamp___ : -const char *plink_timestamp___[]={0}; - -#if defined(BSLS_PLATFORM_OS_AIX) || \ - defined(BSLS_PLATFORM_CMP_GNU) || \ - defined(BSLS_PLATFORM_CMP_SUN) - -#pragma weak plink_timestamp___ - -#endif - -// ---------------------------------------------------------------------------- -// Copyright 2018 Bloomberg Finance L.P. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ----------------------------- END-OF-FILE ---------------------------------- diff --git a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.h b/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.h deleted file mode 100644 index d25635bfef..0000000000 --- a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.h +++ /dev/null @@ -1,42 +0,0 @@ -// bsls_stackaddressutil_plinktimestamp.h -*-C++-*- -#ifndef INCLUDED_BSLS_STACKADDRESSUTIL_PLINKTIMESTAMP -#define INCLUDED_BSLS_STACKADDRESSUTIL_PLINKTIMESTAMP - -#include -BSLS_IDENT("$Id: $") - -//@PURPOSE: Declare and weakly define a 'plink_timestamp___' global variable. -// -//@DESCRIPTION: This component provides a weak definition of the Bloomberg -// standard 'plink_timestamp__' variable, which is normally generated by any -// program that is built with the Bloomberg 'plink' build system. This array -// of null-terminated strings, ending in a '0', normally contains data useful -// in identifying when and how a particular task was built. -// -// The definition provided by this component is an array containing a single -// '0' value with 'weak' linkage, which should cause it to be only linked into -// an application in build systems that don't generate a definition for this -// variable themselves. Note that "dummy" definitions of this symbol -// occasional use an array of empty strings, but that that would crash -// 'sysutil_pwhat_getvar' if it ended up actually linking together and being -// called. - -extern "C" const char *plink_timestamp___[]; - -#endif - -// ---------------------------------------------------------------------------- -// Copyright 2018 Bloomberg Finance L.P. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ----------------------------- END-OF-FILE ---------------------------------- diff --git a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.t.cpp b/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.t.cpp deleted file mode 100644 index c479014a51..0000000000 --- a/groups/bsl/bsls/bsls_stackaddressutil_plinktimestamp.t.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// bsls_stackaddressutil_plinktimestamp.t.cpp -*-C++-*- - -#include - -#include -#include // 'fprintf' -#include // 'atoi' - -using namespace BloombergLP; -using namespace std; - -//============================================================================= -// TEST PLAN -//----------------------------------------------------------------------------- -// Overview -// -------- -// This component will verify that the 'plink_timestamp___' defined by this -// component is an array containing a single 0 value. Note that this is only -// testing the fallback case of a task linked without "pwhat strings." Tests -// for the interesting case have build dependencies which cannot be satisfied -// in this repo. -//----------------------------------------------------------------------------- -// [1] plink_timestamp___ -//----------------------------------------------------------------------------- - -// ============================================================================ -// STANDARD BSL ASSERT TEST FUNCTION -// ---------------------------------------------------------------------------- - -namespace { - -int testStatus = 0; - -void aSsErT(bool condition, const char *message, int line) -{ - if (condition) { - printf("Error " __FILE__ "(%d): %s (failed)\n", line, message); - - if (0 <= testStatus && testStatus <= 100) { - ++testStatus; - } - } -} - -} // close unnamed namespace - -// ============================================================================ -// STANDARD BSL TEST DRIVER MACRO ABBREVIATIONS -// ---------------------------------------------------------------------------- - -#define ASSERT BSLS_BSLTESTUTIL_ASSERT -#define ASSERTV BSLS_BSLTESTUTIL_ASSERTV - -#define LOOP_ASSERT BSLS_BSLTESTUTIL_LOOP_ASSERT -#define LOOP0_ASSERT BSLS_BSLTESTUTIL_LOOP0_ASSERT -#define LOOP1_ASSERT BSLS_BSLTESTUTIL_LOOP1_ASSERT -#define LOOP2_ASSERT BSLS_BSLTESTUTIL_LOOP2_ASSERT -#define LOOP3_ASSERT BSLS_BSLTESTUTIL_LOOP3_ASSERT -#define LOOP4_ASSERT BSLS_BSLTESTUTIL_LOOP4_ASSERT -#define LOOP5_ASSERT BSLS_BSLTESTUTIL_LOOP5_ASSERT -#define LOOP6_ASSERT BSLS_BSLTESTUTIL_LOOP6_ASSERT - -#define Q BSLS_BSLTESTUTIL_Q // Quote identifier literally. -#define P BSLS_BSLTESTUTIL_P // Print identifier and value. -#define P_ BSLS_BSLTESTUTIL_P_ // P(X) without '\n'. -#define T_ BSLS_BSLTESTUTIL_T_ // Print a tab (w/o newline). -#define L_ BSLS_BSLTESTUTIL_L_ // current Line number - -//============================================================================= -// GLOBAL CONSTANTS FOR TESTING -//----------------------------------------------------------------------------- - -bool globalVerbose = false; -bool globalVeryVerbose = false; -bool globalVeryVeryVerbose = false; - -int main(int argc, char *argv[]) -{ - int test = argc > 1 ? atoi(argv[1]) : 0; - int verbose = argc > 2; - int veryVerbose = argc > 3; - int veryVeryVerbose = argc > 4; - - globalVerbose = verbose; - globalVeryVerbose = veryVerbose; - globalVeryVeryVerbose = veryVeryVerbose; - - printf( "TEST %s CASE %d\n", __FILE__, test); - - switch (test) { case 0: // zero is always the leading case - case 1: { - // -------------------------------------------------------------------- - // PLINK_TIMESTAMP CONTENTS - // - // Concerns: - //: 1 The global variable 'plink_timestamp___' should start with a '0' - //: value. - // - // Plan: - //: 1 Check the value of 'plink_timestamp___'. - // - // Testing: - // plink_timestamp___ - // -------------------------------------------------------------------- - - if (verbose) printf( "\nPLINK_TIMESTAMP CONTENTS" - "\n========================\n" ); - - ASSERT(0 == plink_timestamp___[0]); - } break; - default: { - fprintf( stderr, "WARNING: CASE `%d` NOT FOUND.\n" , test); - testStatus = -1; - } - } - - if (testStatus > 0) { - fprintf( stderr, "Error, non-zero test status = %d.\n", testStatus ); - } - - return testStatus; -} - -// ---------------------------------------------------------------------------- -// Copyright 2018 Bloomberg Finance L.P. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// ----------------------------- END-OF-FILE ---------------------------------- diff --git a/groups/bsl/bsls/package/bsls.mem b/groups/bsl/bsls/package/bsls.mem index 2fbb64166d..49d048fb72 100644 --- a/groups/bsl/bsls/package/bsls.mem +++ b/groups/bsl/bsls/package/bsls.mem @@ -73,7 +73,6 @@ bsls_review bsls_review_macroreset bsls_spinlock bsls_stackaddressutil -bsls_stackaddressutil_plinktimestamp bsls_stopwatch bsls_systemclocktype bsls_systemtime