Index: src/action_helper.c =================================================================== --- src/action_helper.c (revision 2389) +++ src/action_helper.c (revision 2390) @@ -1058,6 +1058,7 @@ /* both are almost the same */ case COPY_MODE: case MOVE_MODE: +pcb_trace("Move/copy: mode=%d state=%d {\n", conf_core.editor.mode, Crosshair.AttachedObject.State); switch (Crosshair.AttachedObject.State) { /* first notify, lookup object */ case STATE_FIRST: @@ -1101,6 +1102,7 @@ Crosshair.AttachedObject.State = STATE_FIRST; break; } + pcb_trace("}\n"); break; /* insert a point into a polygon/line/... */ Index: src/draw.c =================================================================== --- src/draw.c (revision 2389) +++ src/draw.c (revision 2390) @@ -1540,13 +1540,16 @@ */ void EraseElement(ElementTypePtr Element) { + pcb_trace("EraseElement() enter %p {\n", Element); ELEMENTLINE_LOOP(Element); { + pcb_trace("line\n"); EraseLine(line); } END_LOOP; ARC_LOOP(Element); { + pcb_trace("arc\n"); EraseArc(arc); } END_LOOP; @@ -1553,6 +1556,7 @@ EraseElementName(Element); EraseElementPinsAndPads(Element); EraseFlags(&Element->Flags); + pcb_trace("}\n"); } /* --------------------------------------------------------------------------- @@ -1577,9 +1581,13 @@ */ void EraseElementName(ElementTypePtr Element) { - if (TEST_FLAG(HIDENAMEFLAG, Element)) + pcb_trace("EraseElementName enter %p {\n", Element); + if (TEST_FLAG(HIDENAMEFLAG, Element)) { + pcb_trace("EE nope\n}\n", Element); return; + } DrawText(NULL, &ELEMENT_TEXT(PCB, Element)); + pcb_trace("}\n", Element); } Index: src/error.c =================================================================== --- src/error.c (revision 2389) +++ src/error.c (revision 2390) @@ -98,7 +98,17 @@ #endif } +void pcb_trace(const char *Format, ...) +{ +#ifndef NDEBUG + va_list args; + va_start(args, Format); + vfprintf(stderr, Format, args); + va_end(args); +#endif +} + /* --------------------------------------------------------------------------- * print standard 'open error' */ Index: src/error.h =================================================================== --- src/error.h (revision 2389) +++ src/error.h (revision 2390) @@ -43,5 +43,6 @@ void OpendirErrorMessage(const char *); void ChdirErrorMessage(const char *); void CatchSignal(int); +void pcb_trace(const char *Format, ...); #endif Index: src/move.c =================================================================== --- src/move.c (revision 2389) +++ src/move.c (revision 2390) @@ -99,6 +99,7 @@ */ void MoveElementLowLevel(DataTypePtr Data, ElementTypePtr Element, Coord DX, Coord DY) { + pcb_trace("MoveElementLowLevel() %p {\n", Element); if (Data) r_delete_entry(Data->element_tree, (BoxType *) Element); ELEMENTLINE_LOOP(Element); @@ -151,6 +152,7 @@ MOVE(Element->MarkX, Element->MarkY, DX, DY); if (Data) r_insert_entry(Data->element_tree, (BoxType *) Element, 0); + pcb_trace("}\n", Element); } /* ---------------------------------------------------------------------- @@ -193,7 +195,10 @@ { bool didDraw = false; + pcb_trace("MoveElement() enter %p {\n", Element); + if (PCB->ElementOn && (FRONT(Element) || PCB->InvisibleObjectsOn)) { + pcb_trace(" ME b1\n"); EraseElement(Element); MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY); DrawElementName(Element); @@ -201,16 +206,19 @@ didDraw = true; } else { + pcb_trace(" ME b2\n"); if (PCB->PinOn) EraseElementPinsAndPads(Element); MoveElementLowLevel(PCB->Data, Element, DeltaX, DeltaY); } if (PCB->PinOn) { + pcb_trace(" ME b3\n"); DrawElementPinsAndPads(Element); didDraw = true; } if (didDraw) Draw(); + pcb_trace(" ME end %p\n}\n", Element); return (Element); }