Fix all our unused parameter warnings so we let GCC report them.
There were a couple of genuine bugs here (fixed), plus there's a missing
feature in trace.cc that I've just added a TODO for.
Also note that I haven't touched the compilers; this warning is still
explicitly disabled for that code. I'll do that when there's less going
on in those directories.
Change-Id: Ic3570bf82411a07c7530bfaf1995ac995b9fc00f
diff --git a/src/debugger.cc b/src/debugger.cc
index 84dd055..78acf31 100644
--- a/src/debugger.cc
+++ b/src/debugger.cc
@@ -1262,8 +1262,10 @@
if (IsPrimitiveTag(tag)) {
if (tag == JDWP::JT_DOUBLE || tag == JDWP::JT_LONG) {
+ CHECK_EQ(width, 8);
f->Set64(o, value);
} else {
+ CHECK_LE(width, 4);
f->Set32(o, value);
}
} else {
@@ -1571,7 +1573,7 @@
*pThisId = gRegistry->Add(o);
}
-void Dbg::GetLocalValue(JDWP::ObjectId threadId, JDWP::FrameId frameId, int slot, JDWP::JdwpTag tag, uint8_t* buf, size_t width) {
+void Dbg::GetLocalValue(JDWP::ObjectId /*threadId*/, JDWP::FrameId frameId, int slot, JDWP::JdwpTag tag, uint8_t* buf, size_t width) {
Method** sp = reinterpret_cast<Method**>(frameId);
Frame f(sp);
Method* m = f.GetMethod();
@@ -1668,7 +1670,7 @@
JDWP::Set1(buf, tag);
}
-void Dbg::SetLocalValue(JDWP::ObjectId threadId, JDWP::FrameId frameId, int slot, JDWP::JdwpTag tag, uint64_t value, size_t width) {
+void Dbg::SetLocalValue(JDWP::ObjectId /*threadId*/, JDWP::FrameId frameId, int slot, JDWP::JdwpTag tag, uint64_t value, size_t width) {
Method** sp = reinterpret_cast<Method**>(frameId);
Frame f(sp);
Method* m = f.GetMethod();
@@ -2033,7 +2035,7 @@
return JDWP::ERR_NONE;
}
-void Dbg::UnconfigureStep(JDWP::ObjectId threadId) {
+void Dbg::UnconfigureStep(JDWP::ObjectId /*threadId*/) {
gSingleStepControl.is_active = false;
gSingleStepControl.thread = NULL;
gSingleStepControl.dex_pcs.clear();
@@ -2668,7 +2670,7 @@
pieceLenField_ = NULL;
}
- void HeapChunkCallback(void* start, void* end, size_t used_bytes) {
+ void HeapChunkCallback(void* start, void* /*end*/, size_t used_bytes) {
// Note: heap call backs cannot manipulate the heap upon which they are crawling, care is taken
// in the following code not to allocate memory, by ensuring buf_ is of the correct size