NAME ^

pdb - The Parrot debugger

SYNOPSIS ^

 pdb programfile

DESCRIPTION ^

Commands ^

disassemble

Disassemble the bytecode.

Use this if you have a PBC file but not the PASM.

load

Load a source code file.

list or l

List the source code file.

run or r

Run the program.

break or b

Add a breakpoint.

watch or w

Add a watchpoint.

delete or d

Delete a breakpoint.

disable

Disable a breakpoint.

enable

Reenable a disabled breakpoint.

continue or c

Continue the program execution.

next or n

Run the next instruction

eval or e

Run an instruction.

trace or t

Trace the next instruction.

print or p

Print the interpreter registers.

stack or s

Examine the stack.

info

Print interpreter information.

quit or q

Exit the debugger.

help or h

Print the help.

Debug Ops ^

You can also debug Parrot code by using the debug_init, debug_load and debug_break ops in ops/debug.ops.

int main(int argc, char *argv[])

Reads the PASM or PBC file from argv[1], loads it, and then calls Parrot_debug().

static void PDB_add_exception_handler(Parrot_Interp)

Adds a default exception handler to PDB.

*/

static void PDB_run_code(Parrot_Interp interp, int argc, const char *argv[]) { Parrot_exception exp;

    if (setjmp(exp.destination)) {
        char *msg = string_to_cstring(interp, interp->exceptions->msg);
        fprintf(stderr, "Caught exception: %s\n", msg);
        string_cstring_free(msg);
        return;
    }

    push_new_c_exception_handler(interp, &exp);

    Parrot_runcode(interp, argc - 1, argv + 1);
}
/*

static void PDB_printwelcome(void)

Prints out the welcome string.

SEE ALSO ^

src/debug.c, include/parrot/debug.h.

HISTORY ^

TODO ^


parrot