Skip to content

Commit

Permalink
[debugger] Add support for assigning to numeric registers
Browse files Browse the repository at this point in the history
  • Loading branch information
leto committed Aug 6, 2009
1 parent d034a01 commit 357c45f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/debug.c
Expand Up @@ -3203,6 +3203,8 @@ PDB_assign(PARROT_INTERP, ARGIN(const char *command))
// TODO check validity of these
register_num = get_ulong(&command, 0);

// Currently we can only assign to registers that already have
// been brought into existence by the debuggee, why?
switch (reg_type) {
case 'I':
t = REGNO_INT;
Expand All @@ -3212,6 +3214,7 @@ PDB_assign(PARROT_INTERP, ARGIN(const char *command))
break;
case 'N':
t = REGNO_NUM;
value_float = atof(command);
REG_NUM(interp,register_num) = value_float;
break;
case 'S':
Expand Down
8 changes: 7 additions & 1 deletion t/tools/parrot_debugger.t
Expand Up @@ -240,7 +240,13 @@ pdb_output_like( <<PIR, "pir", "a foo", qr/Must give a register number and value
.end
PIR

BEGIN { $tests += 37 }
pdb_output_like( <<PIR, "pir", "t\na N0 3.14", qr/N0 = 3.14/, 'assign to a numeric register');
.sub main :main
\$N0 = 9.99
.end
PIR

BEGIN { $tests += 38 }

BEGIN { plan tests => $tests; }

Expand Down

0 comments on commit 357c45f

Please sign in to comment.