[svn:parrot] r40449 - in branches/auto_attrs: . config/auto/sizes docs docs/book/draft docs/dev docs/pdds docs/project examples/embed examples/languages/abc examples/languages/squaak examples/pge include/parrot ports/cpan ports/cygwin ports/debian ports/fedora ports/mandriva ports/suse runtime/parrot/languages runtime/parrot/library/Math src src/call src/gc src/interp src/runcore t/compilers/tge t/examples t/oo t/src t/tools tools/dev tools/util
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat Aug 8 11:59:05 UTC 2009
Author: NotFound
Date: Sat Aug 8 11:59:02 2009
New Revision: 40449
URL: https://trac.parrot.org/parrot/changeset/40449
Log:
merge from trunk r40448
Modified:
branches/auto_attrs/ (props changed)
branches/auto_attrs/DEPRECATED.pod
branches/auto_attrs/config/auto/sizes/intval_maxmin_c.in (props changed)
branches/auto_attrs/docs/book/draft/README (props changed)
branches/auto_attrs/docs/book/draft/appa_glossary.pod (props changed)
branches/auto_attrs/docs/book/draft/appb_patch_submission.pod (props changed)
branches/auto_attrs/docs/book/draft/appc_command_line_options.pod (props changed)
branches/auto_attrs/docs/book/draft/appd_build_options.pod (props changed)
branches/auto_attrs/docs/book/draft/appe_source_code.pod (props changed)
branches/auto_attrs/docs/book/draft/ch01_introduction.pod (props changed)
branches/auto_attrs/docs/book/draft/ch02_getting_started.pod (props changed)
branches/auto_attrs/docs/book/draft/ch04_compiler_tools.pod (props changed)
branches/auto_attrs/docs/book/draft/ch05_pge.pod (props changed)
branches/auto_attrs/docs/book/draft/ch06_nqp.pod (props changed)
branches/auto_attrs/docs/book/draft/ch07_dynpmcs.pod (props changed)
branches/auto_attrs/docs/book/draft/ch08_dynops.pod (props changed)
branches/auto_attrs/docs/book/draft/ch10_opcode_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/ch11_directive_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/ch12_operator_reference.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_hlls.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_library.pod (props changed)
branches/auto_attrs/docs/book/draft/chXX_testing_and_debugging.pod (props changed)
branches/auto_attrs/docs/debugger.pod
branches/auto_attrs/docs/dev/c_functions.pod (props changed)
branches/auto_attrs/docs/embed.pod
branches/auto_attrs/docs/pdds/pdd30_install.pod (props changed)
branches/auto_attrs/docs/project/debian_packaging_guide.pod
branches/auto_attrs/docs/project/ubuntu_packaging_guide.pod
branches/auto_attrs/examples/embed/cotorra.c (props changed)
branches/auto_attrs/examples/languages/abc/ (props changed)
branches/auto_attrs/examples/languages/squaak/ (props changed)
branches/auto_attrs/examples/pge/demo.pir (props changed)
branches/auto_attrs/include/parrot/call.h (props changed)
branches/auto_attrs/include/parrot/debugger.h
branches/auto_attrs/include/parrot/gc_api.h (props changed)
branches/auto_attrs/include/parrot/runcore_api.h (props changed)
branches/auto_attrs/include/parrot/runcore_trace.h (props changed)
branches/auto_attrs/ports/cpan/pause_guide.pod (props changed)
branches/auto_attrs/ports/cygwin/parrot-1.0.0-1.cygport (props changed)
branches/auto_attrs/ports/debian/libparrot-dev.install.in (props changed)
branches/auto_attrs/ports/debian/libparrot.install.in (props changed)
branches/auto_attrs/ports/debian/parrot-doc.install.in (props changed)
branches/auto_attrs/ports/debian/parrot.install.in (props changed)
branches/auto_attrs/ports/fedora/parrot.spec.fedora (props changed)
branches/auto_attrs/ports/mandriva/parrot.spec.mandriva (props changed)
branches/auto_attrs/ports/suse/parrot.spec.suse (props changed)
branches/auto_attrs/runtime/parrot/languages/ (props changed)
branches/auto_attrs/runtime/parrot/library/Math/Rand.pir (props changed)
branches/auto_attrs/src/call/ops.c (props changed)
branches/auto_attrs/src/call/pcc.c (props changed)
branches/auto_attrs/src/debug.c
branches/auto_attrs/src/gc/alloc_memory.c (props changed)
branches/auto_attrs/src/gc/alloc_register.c (props changed)
branches/auto_attrs/src/gc/alloc_resources.c (props changed)
branches/auto_attrs/src/gc/api.c (props changed)
branches/auto_attrs/src/gc/generational_ms.c (props changed)
branches/auto_attrs/src/gc/incremental_ms.c (props changed)
branches/auto_attrs/src/gc/malloc.c (props changed)
branches/auto_attrs/src/gc/malloc_trace.c (props changed)
branches/auto_attrs/src/gc/mark_sweep.c (props changed)
branches/auto_attrs/src/gc/system.c (props changed)
branches/auto_attrs/src/interp/inter_cb.c (props changed)
branches/auto_attrs/src/interp/inter_create.c (props changed)
branches/auto_attrs/src/interp/inter_misc.c (props changed)
branches/auto_attrs/src/library.c
branches/auto_attrs/src/runcore/cores.c (props changed)
branches/auto_attrs/src/runcore/main.c (props changed)
branches/auto_attrs/src/runcore/trace.c (props changed)
branches/auto_attrs/t/compilers/tge/NoneGrammar.tg (props changed)
branches/auto_attrs/t/examples/pir.t
branches/auto_attrs/t/oo/root_new.t (props changed)
branches/auto_attrs/t/src/embed.t (props changed)
branches/auto_attrs/t/tools/parrot_debugger.t
branches/auto_attrs/tools/dev/fetch_languages.pl (props changed)
branches/auto_attrs/tools/dev/mk_gitignore.pl (props changed)
branches/auto_attrs/tools/util/perlcritic-cage.conf (props changed)
Modified: branches/auto_attrs/DEPRECATED.pod
==============================================================================
--- branches/auto_attrs/DEPRECATED.pod Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/DEPRECATED.pod Sat Aug 8 11:59:02 2009 (r40449)
@@ -33,12 +33,6 @@
.include 'warnings.pasm'
warningson .PARROT_WARNINGS_DEPRECATED_FLAG
-=head1 Configuration
-
-=over 4
-
-=back
-
=head1 PMCS
=over 4
@@ -96,6 +90,8 @@
for Sub, Exception, and related PMC types will instead be handled by
get_label and set_label.
+=back
+
=head1 Bytecode
=over 4
@@ -118,27 +114,17 @@
[Nothing at this time.]
+=head1 Debugger
+
+Assigning to registers [experimental]
+
=head1 PIR syntax
=over 4
=item Assignment syntax with opcodes [eligible in 1.1]
-When the first argument of an opcode is C<OUT>, then
-the assignment syntax will be allowed, as it is today.
-
-In any other case (i.e. C<INOUT>, C<IN>), this will become
-a syntax error. For example:
-
- $S0 = print
- $P0 = substr 1, 2, "x"
-
-Will have to be:
-
- print $S0
- substr $P0, 1, 2, "x"
-
-L<http://rt.perl.org/rt3/Ticket/Display.html?id=36283>
+L<https://trac.parrot.org/parrot/ticket/906>
=item named class/pmc lookup in pir syntax such as new, isa, subclass,
get_class, etc [eligible in 1.1]
@@ -310,12 +296,8 @@
L<https://trac.parrot.org/parrot/ticket/842>
-=cut
-
=back
-=cut
-
=head1 build tools
=over 4
Modified: branches/auto_attrs/docs/debugger.pod
==============================================================================
--- branches/auto_attrs/docs/debugger.pod Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/docs/debugger.pod Sat Aug 8 11:59:02 2009 (r40449)
@@ -381,10 +381,10 @@
=over 4
-=item src/pdb.c
+=item src/parrot_debugger.c
-This is the file that will produce the executable. Nothing fancy here, only
-the C<main> function.
+This is the file that will produce the executable. Nothing fancy here, it
+mostly consists of the C<main> function.
=item src/debug.c
@@ -395,7 +395,7 @@
C<Parrot_debug>, the function which launches the debugger, is implemented here.
-=item include/parrot/debug.h
+=item include/parrot/debugger.h
This defines all the PDB structures, which hold data used by the debugger.
Modified: branches/auto_attrs/docs/embed.pod
==============================================================================
--- branches/auto_attrs/docs/embed.pod Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/docs/embed.pod Sat Aug 8 11:59:02 2009 (r40449)
@@ -276,7 +276,7 @@
Returns the internal type number corresponding to C<type>. Useful for
instantiating various Parrot data types.
-=item C<char *Parrot_str_to_cstring(PARROT_INTERP)>
+=item C<char *Parrot_str_to_cstring(PARROT_INTERP, const STRING *s)>
XXX needs to be a formal Parrot_* API.
Returns the C string representation of a Parrot string.
Modified: branches/auto_attrs/docs/project/debian_packaging_guide.pod
==============================================================================
--- branches/auto_attrs/docs/project/debian_packaging_guide.pod Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/docs/project/debian_packaging_guide.pod Sat Aug 8 11:59:02 2009 (r40449)
@@ -45,11 +45,6 @@
=item 3.
-Update the debian/parrot-doc.docs file by running the script
-tools/dev/debian_docs.sh in the Parrot repository.
-
-=item 4.
-
Update the debian/changelog file in ~/deb/parrot/parrot-<version>/. The format
of the changelog file is strict (automatically parsed). The first line of the
log entry gives the package version and categorization. For a new version
@@ -73,50 +68,50 @@
-- Your Name <you at example.org> Sun, 30 Dec 2007 17:21:45 +0000
-=item 5.
+=item 4.
Update the debian/control.in file in ~/deb/parrot/parrot-<version>/. Make sure
you are listed in "Uploaders". The "Maintainer" will always be "Debian
Parrot Maintainers <pkg-parrot-devel at lists.alioth.debian.org>".
-=item 6.
+=item 5.
Update the debian/copyright file in ~/deb/parrot/parrot-<version>/. Check for
any removed files that no longer need copyright notices. Update the years in
the Parrot Foundation copyright line if needed.
-=item 7.
+=item 6.
Regenerate the debian/control file. From the
~/deb/parrot/parrot-<version>/ directory, run:
$ debian/rules debian-control-stamp
-=item 8.
+=item 7.
Install all dependencies:
$ sudo /usr/lib/pbuilder/pbuilder-satisfydepends
-=item 9.
+=item 8.
Build the packages. From ~/deb/parrot/parrot_<version>/, run:
$ export DEBSIGN_KEYID="<gpg key id>"
$ debuild
-=item 10.
+=item 9.
Check the package for errors. From ~/deb/parrot, run:
$ lintian -i parrot_<version>.changes
-=item 11.
+=item 10.
Commit all changes made to the files in the debian/ directory to the Parrot
repository.
-=item 12.
+=item 11.
Upload the packages to http://alioth.debian.org. (If you don't have admin
privileges, ask someone who does.) From any of the project pages, click on the
Modified: branches/auto_attrs/docs/project/ubuntu_packaging_guide.pod
==============================================================================
--- branches/auto_attrs/docs/project/ubuntu_packaging_guide.pod Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/docs/project/ubuntu_packaging_guide.pod Sat Aug 8 11:59:02 2009 (r40449)
@@ -67,7 +67,7 @@
The changelog entry for the Ubuntu release is generally:
- * Resynchronize with Debian unstable.
+ * Synchronize with Debian unstable.
Add any custom changes for Ubuntu packaging (rare). The final line gives the
maintainer's name, email address, and the date. The date must be in RFC822
Modified: branches/auto_attrs/include/parrot/debugger.h
==============================================================================
--- branches/auto_attrs/include/parrot/debugger.h Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/include/parrot/debugger.h Sat Aug 8 11:59:02 2009 (r40449)
@@ -1,9 +1,9 @@
/*
- * Copyright (C) 2002-2008, Parrot Foundation.
+ * Copyright (C) 2002-2009, Parrot Foundation.
*/
/*
- * debug.h
+ * debugger.h
*
* SVN Info
* $Id$
@@ -222,6 +222,10 @@
__attribute__nonnull__(2)
FUNC_MODIFIES(*file);
+void PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
void PDB_backtrace(PARROT_INTERP)
__attribute__nonnull__(1);
@@ -377,6 +381,9 @@
#define ASSERT_ARGS_PDB_add_label __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(file) \
|| PARROT_ASSERT_ARG(cur_opcode)
+#define ASSERT_ARGS_PDB_assign __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(command)
#define ASSERT_ARGS_PDB_backtrace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_PDB_break __attribute__unused__ int _ASSERT_ARGS_CHECK = \
Modified: branches/auto_attrs/src/debug.c
==============================================================================
--- branches/auto_attrs/src/debug.c Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/src/debug.c Sat Aug 8 11:59:02 2009 (r40449)
@@ -48,6 +48,11 @@
/* Length of command line buffers */
#define DEBUG_CMD_BUFFER_LENGTH 255
+/* Easier register access */
+#define IREG(i) REG_INT(interp, (i))
+#define NREG(i) REG_NUM(interp, (i))
+#define SREG(i) REG_STR(interp, (i))
+#define PREG(i) REG_PMC(interp, (i))
typedef struct DebuggerCmd DebuggerCmd;
typedef struct DebuggerCmdList DebuggerCmdList;
@@ -207,6 +212,13 @@
}
}
+static void dbg_assign(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
+{
+ TRACEDEB_MSG("dbg_assign");
+
+ PDB_assign(pdb->debugee, cmd);
+}
+
static void dbg_break(PDB_t * pdb, const char * cmd) /* HEADERIZER SKIP */
{
TRACEDEB_MSG("dbg_break");
@@ -395,6 +407,14 @@
};
static const DebuggerCmd
+ cmd_assign = {
+ & dbg_assign,
+ "assign to a register",
+"Assign a value to a register. For example:\n\
+ a I0 42\n\
+ a N1 3.14\n\
+The first command sets I0 to 42 and the second sets N1 to 3.14."
+ },
cmd_break = {
& dbg_break,
"add a breakpoint",
@@ -549,6 +569,7 @@
};
DebuggerCmdList DebCmdList [] = {
+ { "assign", 'a', &cmd_assign },
{ "break", '\0', &cmd_break },
{ "continue", '\0', &cmd_continue },
{ "delete", 'd', &cmd_delete },
@@ -3162,6 +3183,59 @@
/*
+=item C<void PDB_assign(PARROT_INTERP, const char *command)>
+
+Assign to registers.
+
+=cut
+
+*/
+
+void
+PDB_assign(PARROT_INTERP, ARGIN(const char *command))
+{
+ ASSERT_ARGS(PDB_assign)
+ unsigned long register_num;
+ char reg_type;
+ char *string;
+ int t;
+
+ /* smallest valid commad length is 4, i.e. "I0 1" */
+ if (strlen(command) < 4) {
+ fprintf(stderr, "Must give a register number and value to assign\n");
+ return;
+ }
+ reg_type = (char) command[0];
+ command++;
+ register_num = get_ulong(&command, 0);
+
+ switch (reg_type) {
+ case 'I':
+ t = REGNO_INT;
+ IREG(register_num) = get_ulong(&command, 0);
+ break;
+ case 'N':
+ t = REGNO_NUM;
+ NREG(register_num) = atof(command);
+ break;
+ case 'S':
+ t = REGNO_STR;
+ SREG(register_num) = Parrot_str_new(interp, command, strlen(command));
+ break;
+ case 'P':
+ t = REGNO_PMC;
+ fprintf(stderr, "Assigning to PMCs is not currently supported\n");
+ return;
+ default:
+ fprintf(stderr, "Invalid register type %c\n", reg_type);
+ return;
+ }
+ Parrot_io_eprintf(interp, "\n %c%u = ", reg_type, register_num);
+ Parrot_io_eprintf(interp, "%s\n", GDB_print_reg(interp, t, register_num));
+}
+
+/*
+
=item C<void PDB_list(PARROT_INTERP, const char *command)>
Show lines from the source code file.
@@ -3321,6 +3395,8 @@
{
ASSERT_ARGS(PDB_print)
const char * const s = GDB_P(interp->pdb->debugee, command);
+
+ TRACEDEB_MSG("PDB_print");
Parrot_io_eprintf(interp, "%s\n", s);
}
@@ -3554,24 +3630,32 @@
GDB_print_reg(PARROT_INTERP, int t, int n)
{
ASSERT_ARGS(GDB_print_reg)
+ char * string;
if (n >= 0 && n < CONTEXT(interp)->n_regs_used[t]) {
switch (t) {
case REGNO_INT:
- return Parrot_str_from_int(interp, REG_INT(interp, n))->strstart;
+ return Parrot_str_from_int(interp, IREG(n))->strstart;
case REGNO_NUM:
- return Parrot_str_from_num(interp, REG_NUM(interp, n))->strstart;
+ return Parrot_str_from_num(interp, NREG(n))->strstart;
case REGNO_STR:
- return REG_STR(interp, n)->strstart;
+ /* This hack is needed because we occasionally are told
+ that we have string registers when we actually don't */
+ string = (char *) SREG(n);
+
+ if (string == '\0')
+ return "";
+ else
+ return SREG(n)->strstart;
case REGNO_PMC:
/* prints directly */
- trace_pmc_dump(interp, REG_PMC(interp, n));
+ trace_pmc_dump(interp, PREG(n));
return "";
default:
break;
}
}
- return "no such reg";
+ return "no such register";
}
/*
@@ -3597,11 +3681,13 @@
int t;
char reg_type;
+ TRACEDEB_MSG("GDB_P");
/* Skip leading whitespace. */
while (isspace((unsigned char)*s))
s++;
reg_type = (unsigned char) toupper((unsigned char)*s);
+
switch (reg_type) {
case 'I': t = REGNO_INT; break;
case 'N': t = REGNO_NUM; break;
@@ -3626,7 +3712,7 @@
return GDB_print_reg(interp, t, n);
}
else
- return "no such reg";
+ return "no such register";
}
Modified: branches/auto_attrs/src/library.c
==============================================================================
--- branches/auto_attrs/src/library.c Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/src/library.c Sat Aug 8 11:59:02 2009 (r40449)
@@ -180,8 +180,6 @@
PARROT_LIB_PATH_INCLUDE, paths);
entry = CONST_STRING(interp, "runtime/parrot/include/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "runtime/parrot/");
- VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
if (VTABLE_elements(interp, config_hash)) {
@@ -201,8 +199,6 @@
PARROT_LIB_PATH_LIBRARY, paths);
entry = CONST_STRING(interp, "runtime/parrot/library/");
VTABLE_push_string(interp, paths, entry);
- entry = CONST_STRING(interp, "runtime/parrot/");
- VTABLE_push_string(interp, paths, entry);
entry = CONST_STRING(interp, "./");
VTABLE_push_string(interp, paths, entry);
if (!STRING_IS_NULL(versionlib)) {
Modified: branches/auto_attrs/t/examples/pir.t
==============================================================================
--- branches/auto_attrs/t/examples/pir.t Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/t/examples/pir.t Sat Aug 8 11:59:02 2009 (r40449)
@@ -1,5 +1,5 @@
#!perl
-# Copyright (C) 2005-2006, Parrot Foundation.
+# Copyright (C) 2005-2009, Parrot Foundation.
# $Id$
use strict;
@@ -266,7 +266,7 @@
## Added test this way, so we can have more interesting tests.
pir_output_is( <<'CODE', <<OUTPUT, "Test Levenshtein example" );
-.include "../../examples/pir/levenshtein.pir"
+.include "examples/pir/levenshtein.pir"
.sub main :main
$S1 = "purl"
$S2 = "perl"
Modified: branches/auto_attrs/t/tools/parrot_debugger.t
==============================================================================
--- branches/auto_attrs/t/tools/parrot_debugger.t Sat Aug 8 08:16:40 2009 (r40448)
+++ branches/auto_attrs/t/tools/parrot_debugger.t Sat Aug 8 11:59:02 2009 (r40449)
@@ -234,7 +234,43 @@
}
-BEGIN { $tests += 35 }
+pdb_output_like( <<PIR, "pir", "t\na I0 17", qr/I0 = 17/, 'assign to an integer register');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a Z0 42", qr/Invalid register type Z/, 'assign to an invalid register');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "a foo", qr/Must give a register number and value to assign/, 'invalid assignment command');
+.sub main :main
+ \$I0 = 242
+.end
+PIR
+
+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
+
+pdb_output_like( <<PIR, "pir", "t\np S", qr/S0 = foobar/, 'print string registers');
+.sub main :main
+ \$S0 = "foobar"
+.end
+PIR
+
+pdb_output_like( <<PIR, "pir", "t\na S0 foobar", qr/S0 = no such register/, 'print string registers when none exist');
+.sub main :main
+ new \$P0, 'ResizableIntegerArray'
+.end
+PIR
+
+BEGIN { $tests += 41 }
BEGIN { plan tests => $tests; }
More information about the parrot-commits
mailing list