hrev44873 adds 1 changeset to branch 'master' old head: 19ea0235be12d9cc271e29832a8a00abe56a89fe new head: 2bf866783ca42ba86a7acde1445d3d2a8f9b1dd6 overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=2bf8667+%5E19ea023 ---------------------------------------------------------------------------- 2bf8667: Cleanups. [ Rene Gollent <anevilyak@xxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev44873 Commit: 2bf866783ca42ba86a7acde1445d3d2a8f9b1dd6 URL: http://cgit.haiku-os.org/haiku/commit/?id=2bf8667 Author: Rene Gollent <anevilyak@xxxxxxxxx> Date: Thu Nov 22 16:44:20 2012 UTC ---------------------------------------------------------------------------- 2 files changed, 8 insertions(+), 23 deletions(-) .../controllers/DebugReportGenerator.cpp | 6 ++--- .../user_interface/cli/CliStackTraceCommand.cpp | 25 ++++---------------- ---------------------------------------------------------------------------- diff --git a/src/apps/debugger/controllers/DebugReportGenerator.cpp b/src/apps/debugger/controllers/DebugReportGenerator.cpp index ab29467..254f0b8 100644 --- a/src/apps/debugger/controllers/DebugReportGenerator.cpp +++ b/src/apps/debugger/controllers/DebugReportGenerator.cpp @@ -120,8 +120,8 @@ DebugReportGenerator::_DumpLoadedImages(BString& _output) target_addr_t dataBase = info.DataBase(); data.SetToFormat("\t%s (%" B_PRId32 ", %s) " - "Text: 0x%08" B_PRIx64 " - 0x%08" B_PRIx64 ", Data: 0x%08" - B_PRIx64 " - 0x%08" B_PRIx64 "\n", info.Name().String(), + "Text: %#08" B_PRIx64 " - %#08" B_PRIx64 ", Data: %#08" + B_PRIx64 " - %#08" B_PRIx64 "\n", info.Name().String(), info.ImageID(), UiUtils::ImageTypeToString(info.Type(), buffer, sizeof(buffer)), textBase, textBase + info.TextSize(), dataBase, @@ -183,7 +183,7 @@ DebugReportGenerator::_DumpDebuggedThreadInfo(BString& _output, Thread* thread) BString data; for (int32 i = 0; StackFrame* frame = trace->FrameAt(i); i++) { char functionName[512]; - data.SetToFormat("\t\t0x%08" B_PRIx64 "\t0x%08" B_PRIx64 "\t%s\n", + data.SetToFormat("\t\t%#08" B_PRIx64 "\t%#08" B_PRIx64 "\t%s\n", frame->FrameAddress(), frame->InstructionPointer(), UiUtils::FunctionNameForFrame(frame, functionName, sizeof(functionName))); diff --git a/src/apps/debugger/user_interface/cli/CliStackTraceCommand.cpp b/src/apps/debugger/user_interface/cli/CliStackTraceCommand.cpp index 5b5b2e1..9e7f033 100644 --- a/src/apps/debugger/user_interface/cli/CliStackTraceCommand.cpp +++ b/src/apps/debugger/user_interface/cli/CliStackTraceCommand.cpp @@ -11,9 +11,9 @@ #include <AutoLocker.h> #include "CliContext.h" -#include "FunctionInstance.h" #include "StackTrace.h" #include "Team.h" +#include "UiUtils.h" CliStackTraceCommand::CliStackTraceCommand() @@ -63,24 +63,9 @@ CliStackTraceCommand::Execute(int argc, const char* const* argv, printf("%3" B_PRId32 " %#" B_PRIx64 " %#" B_PRIx64, i, (uint64)frame->FrameAddress(), (uint64)frame->InstructionPointer()); - Image* image = frame->GetImage(); - FunctionInstance* function = frame->Function(); - if (image == NULL && function == NULL) { - printf(" ???\n"); - continue; - } - - BString name; - target_addr_t baseAddress; - if (function != NULL) { - name = function->PrettyName(); - baseAddress = function->Address(); - } else { - name = image->Name(); - baseAddress = image->Info().TextBase(); - } - - printf(" %s + %#" B_PRIx64 "\n", name.String(), - uint64(frame->InstructionPointer() - baseAddress)); + char functionName[512]; + UiUtils::FunctionNameForFrame(frame, functionName, + sizeof(functionName)); + printf(" %s\n", functionName); } }