hrev45189 adds 2 changesets to branch 'master' old head: e449bae89186bea95f123280559c5195be5017e7 new head: 900ce215d30e09071a970eded2a8d15e87e3f29e overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=900ce21+%5Ee449bae ---------------------------------------------------------------------------- b68166e: Restrict the address range dumped in crash reports. 900ce21: Add support for template type/value parameter packs. - Implements support for two proposed but not yet formalized additions to the DWARF spec with regards to variadic template parameters. These are nevertheless already being generated by gcc under some user extension tags when C++0x is specified. Fixes #9398. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- 5 files changed, 170 insertions(+), 10 deletions(-) .../controllers/DebugReportGenerator.cpp | 29 ++++-- .../debugger/controllers/DebugReportGenerator.h | 4 +- src/apps/debugger/dwarf/DebugInfoEntries.cpp | 98 +++++++++++++++++++- src/apps/debugger/dwarf/DebugInfoEntries.h | 45 +++++++++ src/apps/debugger/dwarf/Dwarf.h | 4 + ############################################################################ Commit: b68166e1da1264adf24918acb94d9162e685afba URL: http://cgit.haiku-os.org/haiku/commit/?id=b68166e Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Wed Jan 23 01:09:47 2013 UTC Restrict the address range dumped in crash reports. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index 4041bfe..e5aa62d 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -341,8 +341,11 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, if (frame->CountParameters() == 0 && frame->CountLocalVariables() == 0) { // only dump the topmost frame - if (i == 0) - _DumpStackFrameMemory(_output, thread->GetCpuState()); + if (i == 0) { + _DumpStackFrameMemory(_output, thread->GetCpuState(), + frame->FrameAddress(), thread->GetTeam()->GetArchitecture() + ->StackGrowthDirection()); + } continue; } @@ -384,19 +387,29 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, void DebugReportGenerator::_DumpStackFrameMemory(BString& _output, - CpuState* state) + CpuState* state, target_addr_t framePointer, uint8 stackDirection) { - target_addr_t address = state->StackPointer(); - if (fCurrentBlock == NULL || !fCurrentBlock->Contains(address)) { - fListener->InspectRequested(address, this); + target_addr_t startAddress; + target_addr_t endAddress; + if (stackDirection == STACK_GROWTH_DIRECTION_POSITIVE) { + startAddress = framePointer; + endAddress = state->StackPointer(); + } else { + startAddress = state->StackPointer(); + endAddress = framePointer; + } + + if (fCurrentBlock == NULL || !fCurrentBlock->Contains(startAddress)) { + fListener->InspectRequested(startAddress, this); status_t result = B_OK; do { result = acquire_sem(fTeamDataSem); } while (result == B_INTERRUPTED); } + _output << "\t\t\tFrame memory:\n"; - UiUtils::DumpMemory(_output, 3, fCurrentBlock, address, 1, 16, - fCurrentBlock->BaseAddress() + fCurrentBlock->Size() - address); + UiUtils::DumpMemory(_output, 3, fCurrentBlock, startAddress, 1, 16, + endAddress - startAddress); } diff --git a/src/apps/debugger/controllers/DebugReportGenerator.h b/src/apps/debugger/controllers/DebugReportGenerator.h index 56bf8a4..5ff78b4 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.h +++ b/src/apps/debugger/controllers/DebugReportGenerator.h @@ -60,7 +60,9 @@ private: status_t _DumpDebuggedThreadInfo(BString& _output, ::Thread* thread); void _DumpStackFrameMemory(BString& _output, - CpuState* state); + CpuState* state, + target_addr_t framePointer, + uint8 stackDirection); status_t _ResolveValueIfNeeded(ValueNode* node, StackFrame* frame, int32 maxDepth); ############################################################################ Revision: hrev45189 Commit: 900ce215d30e09071a970eded2a8d15e87e3f29e URL: http://cgit.haiku-os.org/haiku/commit/?id=900ce21 Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Wed Jan 23 01:10:45 2013 UTC Ticket: https://dev.haiku-os.org/ticket/9398 Add support for template type/value parameter packs. - Implements support for two proposed but not yet formalized additions to the DWARF spec with regards to variadic template parameters. These are nevertheless already being generated by gcc under some user extension tags when C++0x is specified. Fixes #9398. ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.cpp b/src/apps/debugger/dwarf/DebugInfoEntries.cpp index d4643a4..be38f23 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.cpp +++ b/src/apps/debugger/dwarf/DebugInfoEntries.cpp @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx. - * Copyright 2011, Rene Gollent, rene@xxxxxxxxxxx. + * Copyright 2011-2013, Rene Gollent, rene@xxxxxxxxxxx. * Distributed under the terms of the MIT License. */ @@ -2514,6 +2514,96 @@ DIESharedType::AddAttribute_decl_column(uint16 attributeName, } +// #pragma mark - DIETemplateTypeParameterPack + + +DIETemplateTypeParameterPack::DIETemplateTypeParameterPack() + : + fName(NULL) +{ +} + + +uint16 +DIETemplateTypeParameterPack::Tag() const +{ + return DW_TAG_GNU_template_parameter_pack; +} + + +const char* +DIETemplateTypeParameterPack::Name() const +{ + return fName; +} + + +status_t +DIETemplateTypeParameterPack::AddAttribute_name(uint16 attributeName, + const AttributeValue& value) +{ + fName = value.string; + return B_OK; +} + + +status_t +DIETemplateTypeParameterPack::AddChild(DebugInfoEntry* child) +{ + if (child->Tag() == DW_TAG_template_type_parameter) { + fChildren.Add(child); + return B_OK; + } + + return DIEDeclaredBase::AddChild(child); +} + + +// #pragma mark - DIETemplateValueParameterPack + + +DIETemplateValueParameterPack::DIETemplateValueParameterPack() + : + fName(NULL) +{ +} + + +uint16 +DIETemplateValueParameterPack::Tag() const +{ + return DW_TAG_GNU_formal_parameter_pack; +} + + +const char* +DIETemplateValueParameterPack::Name() const +{ + return fName; +} + + +status_t +DIETemplateValueParameterPack::AddAttribute_name(uint16 attributeName, + const AttributeValue& value) +{ + fName = value.string; + return B_OK; +} + + +status_t +DIETemplateValueParameterPack::AddChild(DebugInfoEntry* child) +{ + if (child->Tag() == DW_TAG_formal_parameter) { + fChildren.Add(child); + return B_OK; + } + + return DIEDeclaredBase::AddChild(child); +} + + // #pragma mark - DebugInfoEntryFactory @@ -2699,6 +2789,12 @@ DebugInfoEntryFactory::CreateDebugInfoEntry(uint16 tag, DebugInfoEntry*& _entry) case DW_TAG_shared_type: entry = new(std::nothrow) DIESharedType; break; + case DW_TAG_GNU_template_parameter_pack: + entry = new(std::nothrow) DIETemplateTypeParameterPack; + break; + case DW_TAG_GNU_formal_parameter_pack: + entry = new(std::nothrow) DIETemplateValueParameterPack; + break; default: return B_ENTRY_NOT_FOUND; break; diff --git a/src/apps/debugger/dwarf/DebugInfoEntries.h b/src/apps/debugger/dwarf/DebugInfoEntries.h index 757007f..a4a5c01 100644 --- a/src/apps/debugger/dwarf/DebugInfoEntries.h +++ b/src/apps/debugger/dwarf/DebugInfoEntries.h @@ -1,5 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@xxxxxx. + * Copyright 2013, Rene Gollent, rene@xxxxxxxxxxx. * Distributed under the terms of the MIT License. */ #ifndef DEBUG_INFO_ENTRIES_H @@ -1596,6 +1597,50 @@ private: }; +class DIETemplateTypeParameterPack : public DIEDeclaredBase { +public: + DIETemplateTypeParameterPack(); + + virtual uint16 Tag() const; + + virtual const char* Name() const; + + virtual status_t AddAttribute_name(uint16 attributeName, + const AttributeValue& value); + + const DebugInfoEntryList& Children() const + { return fChildren; } + + virtual status_t AddChild(DebugInfoEntry* child); + +private: + const char* fName; + DebugInfoEntryList fChildren; +}; + + +class DIETemplateValueParameterPack : public DIEDeclaredBase { +public: + DIETemplateValueParameterPack(); + + virtual uint16 Tag() const; + + virtual const char* Name() const; + + virtual status_t AddAttribute_name(uint16 attributeName, + const AttributeValue& value); + + const DebugInfoEntryList& Children() const + { return fChildren; } + + virtual status_t AddChild(DebugInfoEntry* child); + +private: + const char* fName; + DebugInfoEntryList fChildren; +}; + + // #pragma mark - DebugInfoEntryFactory diff --git a/src/apps/debugger/dwarf/Dwarf.h b/src/apps/debugger/dwarf/Dwarf.h index 1d83cba..1e9c99b 100644 --- a/src/apps/debugger/dwarf/Dwarf.h +++ b/src/apps/debugger/dwarf/Dwarf.h @@ -65,6 +65,10 @@ enum { DW_TAG_condition = 0x3f, DW_TAG_shared_type = 0x40, DW_TAG_lo_user = 0x4080, + DW_TAG_GNU_template_parameter_pack + = 0x4107, + DW_TAG_GNU_formal_parameter_pack + = 0x4108, DW_TAG_hi_user = 0xffff };