Opened 9 years ago

Closed 9 years ago

#12411 closed bug (fixed)

Debugger fails to build with APPS_DEBUGGER_TRACE_STACK_FRAME_LOCALS defined

Reported by: simonsouth Owned by: anevilyak
Priority: low Milestone: Unscheduled
Component: Applications/Debugger Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Enabling APPS_DEBUGGER_TRACE_STACK_FRAME_LOCALS in build/user_config_headers/apps_debugger_config.h and building the debugger fails with

In file included from src/apps/debugger/value/ValueWriter.cpp:16:0:
src/apps/debugger/value/ValueWriter.cpp: In member function 'status_t ValueWriter::WriteValue(ValueLocation*, BVariant&)':
src/apps/debugger/value/ValueWriter.cpp:95:47: error: 'bitSize' was not declared in this scope
      ", bits: %" B_PRIu32 "\n", i, piece.reg, bitSize);
                                               ^
src/apps/debugger/Tracing.h:67:36: note: in definition of macro 'TRACE_LOCALS'
 # define TRACE_LOCALS(x...) printf(x)
                                    ^

After fixing this (the last argument should pretty obviously be piece.bitSize) the build fails again with

In file included from src/apps/debugger/value/ValueWriter.cpp:16:0:
src/apps/debugger/value/ValueWriter.cpp: In member function 'status_t ValueWriter::WriteValue(ValueLocation*, BVariant&)':
src/apps/debugger/Tracing.h:67:37: error: format '%u' expects argument of type 'unsigned int', but argument 4 has type 'uint64 {aka long unsigned int}' [-Werror=format=]
 # define TRACE_LOCALS(x...) printf(x)
                                     ^
src/apps/debugger/value/ValueWriter.cpp:94:5: note: in expansion of macro 'TRACE_LOCALS'
     TRACE_LOCALS("  piece %" B_PRId32 ": register: %" B_PRIu32

which makes sense because piece.bitSize is in fact a uint64.

Attachments (1)

0001-Debugger-Fix-TRACE_LOCALS-statement.patch (1.0 KB ) - added by simonsouth 9 years ago.
Update TRACE_LOCALS statement to resolve build failure

Download all attachments as: .zip

Change History (6)

by simonsouth, 9 years ago

Update TRACE_LOCALS statement to resolve build failure

comment:1 by simonsouth, 9 years ago

patch: 01

comment:2 by simonsouth, 9 years ago

I've attached a patch that fixes the issue and allows the build to complete.

Also, I realize now the affected component should probably be "Applications", not "Build System".

comment:3 by bonefish, 9 years ago

Component: Build SystemApplications/Debugger
Owner: changed from bonefish to anevilyak

comment:4 by anevilyak, 9 years ago

Thanks for the patch! Looks good to me in any case (was a simple copy/paste error when adding variable edit support), but I probably won't be able to apply it until the weekend, so if someone else wants to beat me to it, feel free.

comment:5 by anevilyak, 9 years ago

Resolution: fixed
Status: newclosed

Patch applied in hrev49671. Thanks!

Note: See TracTickets for help on using tickets.