Next phase of the move, reformat use C++ features.
Use the libbacktrace C++ interface instead of the C interface in debuggerd.
Reformat the debuggerd code to be closer to Google C++ style.
Fix all debuggerd casts to be C++ casts.
Add a frame number to the frame data structure for ease of formatting and
add another FormatFrameData function.
Change the format_test to use the new FormatFrameData function.
Modify all of the backtrace_test to use the C++ interface.
Change-Id: I10e1610861acf7f4a3ad53276b74971cfbfda464
diff --git a/libbacktrace/Corkscrew.cpp b/libbacktrace/Corkscrew.cpp
index eae13c6..63b8c7c 100644
--- a/libbacktrace/Corkscrew.cpp
+++ b/libbacktrace/Corkscrew.cpp
@@ -45,6 +45,7 @@
data->num_frames = num_frames;
for (size_t i = 0; i < data->num_frames; i++) {
backtrace_frame_data_t* frame = &data->frames[i];
+ frame->num = i;
frame->pc = cork_frames[i].absolute_pc;
frame->sp = cork_frames[i].stack_top;
frame->stack_size = cork_frames[i].stack_size;
@@ -146,6 +147,7 @@
data->num_frames = num_frames;
for (size_t i = 0; i < data->num_frames; i++) {
backtrace_frame_data_t* frame = &data->frames[i];
+ frame->num = i;
frame->pc = frames[i].absolute_pc;
frame->sp = frames[i].stack_top;
frame->stack_size = frames[i].stack_size;