Does anybody know (and cares to explain) what is the difference between F7 (Trace into) and Shift-F7 (Trace to next source line) in the Delphi debugger? As far as I can tell, they behave just the same in all situations.

Comments

  1. on a function call, F7 traces into the function's code (if available) and Shift-F7 traces after this call.

    BTW I miss a trace into the function without tracing parameter evaluation :)

    ReplyDelete
  2. Paul TOTH I agree, this kind of trace would be very useful!

    ReplyDelete
  3. Paul TOTH Shift-F7 goes into the function as well? Or did I not understand your explanation?

    ReplyDelete
  4. Step into enters to the function body while step over skip the function and breaks on the next instruction after the call.
    //--------------------------------------------
    procedure dox;
    var
    Dummy: Integer;
    begin
    Dummy := 1;
    end;

    procedure TForm1.FormCreate(Sender: TObject);
    var
    Foo:Integer;
    begin
    dox;
    Foo:=1;
    end;
    //--------------------------------------------------
    If you made trace into on the above example (dox) you will end up in "Dummy := 1;". However if you made trace over you will end up in "Foo:=1;"

    ReplyDelete
  5. Mahdi Safsafi Yes, but "Step Over" is F8, which is not what is being discussed here.

    ReplyDelete
  6. Ah sorry man I didn't understand your question. Anyway, when Delphi compile your application with debug mode it generates source info for address (line number) but not for all address ! When tracing with F7 you will trace all address but if you use F7-Shift you will only trace address that have line number information.

    ReplyDelete
  7. Mahdi Safsafi Ah, so it doesn't go into disassembler view if debug info is missing, makes sense. Cheers.

    ReplyDelete
  8. To make it clear for you, open View->Debug Windows-> CPU-> Entire CPU. and do your trace. Shift-F7 will stop when there is a line number associated with address. and F7 stops when executing single instruction.

    ReplyDelete
  9. Asbjørn Heid oups my mistake :) you're right, I've made a confusion between Shift+F7 and F8...I never use Shift+F7 but Shift + F8 :D F7/Shift+F7 is about dissassembler

    ReplyDelete
  10. +Mahdi Safsafi. Ahh, great explanation, thanks!

    ReplyDelete

Post a Comment