Skip to content

Commit 830f234

Browse files
committed
Merge branch 'test/remote-application-refactor' of https://github.com/newrelic/newrelic-dotnet-agent into test/remote-application-refactor
2 parents 951746a + c38e328 commit 830f234

6 files changed

Lines changed: 29 additions & 17 deletions

File tree

src/Agent/NewRelic/Profiler/MethodRewriter/InstrumentFunctionManipulator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ namespace NewRelic { namespace Profiler { namespace MethodRewriter
3232

3333
private:
3434
InstrumentationSettingsPtr _instrumentationSettings;
35-
uint16_t _tracerLocalIndex;
36-
uint16_t _resultLocalIndex;
37-
uint16_t _userExceptionLocalIndex;
35+
uint16_t _tracerLocalIndex = 0;
36+
uint16_t _resultLocalIndex = 0;
37+
uint16_t _userExceptionLocalIndex = 0;
3838

3939
void BuildDefaultInstructions(Configuration::InstrumentationPointPtr instrumentationPoint)
4040
{
@@ -228,4 +228,4 @@ namespace NewRelic { namespace Profiler { namespace MethodRewriter
228228
_resultLocalIndex = AppendReturnTypeLocal(_newLocalVariablesSignature, _methodSignature);
229229
}
230230
};
231-
}}}
231+
}}}

src/Agent/NewRelic/Profiler/MethodRewriter/Instrumentors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ namespace NewRelic { namespace Profiler { namespace MethodRewriter
116116
// An instrumentor for the methods we inject into mscorlib
117117
struct HelperInstrumentor : public IInstrumentor
118118
{
119-
bool Instrument(IFunctionPtr function, InstrumentationSettingsPtr instrumentationSettings) override
119+
bool Instrument(IFunctionPtr function, InstrumentationSettingsPtr) override
120120
{
121121
if (!Strings::EndsWith(function->GetModuleName(), _X("mscorlib.dll")))
122122
return false;

src/Agent/NewRelic/Profiler/Profiler/Function.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ namespace NewRelic { namespace Profiler
246246
const FunctionID functionId,
247247
CComPtr<IMetaDataImport2> metaDataImport,
248248
CComPtr<IMetaDataAssemblyImport> metaDataAssemblyImport,
249-
std::shared_ptr<MethodRewriter::MethodRewriter> methodRewriter,
249+
std::shared_ptr<MethodRewriter::MethodRewriter>,
250250
AppDomainID appDomainId,
251251
ULONG signatureSize,
252252
const uint8_t* signature,

src/Agent/NewRelic/Profiler/Profiler/FunctionPreprocessor.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ namespace NewRelic {
9999
return xstring_t((_valid ? _X("[") : _X("*["))) + to_hex_string(_offset) + _X("] : ") + _opcode->name;
100100
}
101101

102-
virtual void ResolveTargets(ByteVectorPtr methodBody, std::shared_ptr<std::map<unsigned, std::shared_ptr<Instruction>>> instructions)
102+
virtual void ResolveTargets(ByteVectorPtr, std::shared_ptr<std::map<unsigned, std::shared_ptr<Instruction>>>)
103103
{
104104
}
105105

106-
virtual void WriteBranches(ByteVectorPtr instructions, std::shared_ptr<std::map<unsigned, std::shared_ptr<Instruction>>> instructionMap)
106+
virtual void WriteBranches(ByteVectorPtr, std::shared_ptr<std::map<unsigned, std::shared_ptr<Instruction>>>)
107107
{
108108
}
109109

110-
virtual void OnInstructionChange(std::shared_ptr<Instruction> oldInstruction, std::shared_ptr<Instruction> newInstruction)
110+
virtual void OnInstructionChange(std::shared_ptr<Instruction>, std::shared_ptr<Instruction>)
111111
{
112112
}
113113

@@ -171,7 +171,7 @@ namespace NewRelic {
171171
_targets = std::make_shared<std::list<InstructionPtr>>();
172172
}
173173

174-
virtual void WriteBranches(ByteVectorPtr instructions, OffsetToInstructionMapPtr instructionMap) override
174+
virtual void WriteBranches(ByteVectorPtr instructions, OffsetToInstructionMapPtr) override
175175
{
176176
if (_valid)
177177
{
@@ -254,7 +254,7 @@ namespace NewRelic {
254254
}
255255
}
256256

257-
virtual void WriteBranches(ByteVectorPtr instructions, OffsetToInstructionMapPtr instructionMap) override
257+
virtual void WriteBranches(ByteVectorPtr instructions, OffsetToInstructionMapPtr) override
258258
{
259259
if (_valid)
260260
{
@@ -498,7 +498,7 @@ namespace NewRelic {
498498
return true;
499499
}
500500

501-
static bool PassesCheck(ByteVectorPtr functionBytes, OffsetToInstructionMapPtr firstPassInstructions)
501+
static bool PassesCheck(ByteVectorPtr functionBytes, OffsetToInstructionMapPtr)
502502
{
503503
const unsigned headerSize = sizeof(COR_ILMETHOD_FAT);
504504
COR_ILMETHOD_FAT* header = (COR_ILMETHOD_FAT*)functionBytes->data();
@@ -524,15 +524,20 @@ namespace NewRelic {
524524
return true;
525525
}
526526

527+
#ifdef DEBUG
527528
static void PrintInstructions(OffsetToInstructionMapPtr instructions)
528529
{
529-
#ifdef DEBUG
530530
for (auto iter : *instructions.get())
531531
{
532532
LogInfo(iter.second->ToString());
533533
}
534-
#endif
535534
}
535+
#else
536+
static void PrintInstructions(OffsetToInstructionMapPtr)
537+
{
538+
539+
}
540+
#endif
536541

537542
bool WriteSEH(ByteVectorPtr newByteCode, OffsetToInstructionMapPtr instructions) {
538543
if (_headerInfo->HasSEH()) {

src/Agent/NewRelic/Profiler/RapidXML/rapidxml.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ namespace rapidxml
658658
: m_name(0)
659659
, m_value(0)
660660
, m_parent(0)
661+
, m_name_size(0)
662+
, m_value_size(0)
661663
{
662664
}
663665

@@ -808,6 +810,8 @@ namespace rapidxml
808810
//! Constructs an empty attribute with the specified type.
809811
//! Consider using memory_pool of appropriate xml_document if allocating attributes manually.
810812
xml_attribute()
813+
: m_next_attribute(nullptr)
814+
, m_prev_attribute(nullptr)
811815
{
812816
}
813817

@@ -902,6 +906,9 @@ namespace rapidxml
902906
: m_type(type)
903907
, m_first_node(0)
904908
, m_first_attribute(0)
909+
, m_last_node(nullptr)
910+
, m_next_sibling(nullptr)
911+
, m_prev_sibling(nullptr)
905912
{
906913
}
907914

src/Agent/NewRelic/Profiler/SignatureParser/Types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ namespace NewRelic { namespace Profiler { namespace SignatureParser
510510

511511
MvarType(uint32_t number) : Type(Kind::MVAR), _number(number) {}
512512

513-
virtual xstring_t ToString(ITokenResolverPtr tokenResolver) const override
513+
virtual xstring_t ToString(ITokenResolverPtr) const override
514514
{
515515
return _X("!!") + to_xstring(_number);
516516
}
@@ -531,7 +531,7 @@ namespace NewRelic { namespace Profiler { namespace SignatureParser
531531

532532
VarType(uint32_t number) : Type(Kind::VAR), _number(number) {}
533533

534-
virtual xstring_t ToString(ITokenResolverPtr tokenResolver) const override
534+
virtual xstring_t ToString(ITokenResolverPtr) const override
535535
{
536536
return _X("!") + to_xstring(_number);
537537
}
@@ -573,7 +573,7 @@ namespace NewRelic { namespace Profiler { namespace SignatureParser
573573
{
574574
VoidPointerType() : Type(Kind::VOIDPOINTER) {}
575575

576-
virtual xstring_t ToString(ITokenResolverPtr tokenResolver) const override
576+
virtual xstring_t ToString(ITokenResolverPtr) const override
577577
{
578578
return _X("void*");
579579
}

0 commit comments

Comments
 (0)