Ticket #440: pbc_info_remove.diff

File pbc_info_remove.diff, 19.6 KB (added by jkeenan, 5 years ago)

diff between trunk and pbc_info_remove branch

  • DEPRECATED.pod

     
    264264 
    265265* = item may be kept but reimplemented. 
    266266 
     267=item functions in src/pbc_info.c [eligible in 1.5] 
     268 
     269L<https://trac.parrot.org/parrot/ticket/440> 
     270To be moved to F<examples/c/pbc_info.c>.  Will no longer be built by F<make>. 
     271 
    267272=back 
    268273 
    269274=head1 Compiler tools 
  • src/pbc_info.c

     
    1 /* 
    2 Copyright (C) 2001-2003, Parrot Foundation. 
    3 $Id$ 
    4  
    5 =head1 NAME 
    6  
    7 pbc_info - PackFile demo 
    8  
    9 =head1 SYNOPSIS 
    10  
    11  pbc_info file.pbc 
    12  
    13 =head1 DESCRIPTION 
    14  
    15 Sample program for dumping PackFile segment names by iterating 
    16 over the main directory. 
    17  
    18 =head2 Functions 
    19  
    20 =over 4 
    21  
    22 =cut 
    23  
    24 */ 
    25  
    26 #include "parrot/parrot.h" 
    27 #include "parrot/embed.h" 
    28  
    29 /* 
    30  
    31 =item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void 
    32  *user_data)> 
    33  
    34 This function is passed the callback to PackFile_map_segments() to print out 
    35 the name of each segment in the directory. 
    36  
    37 =cut 
    38  
    39 */ 
    40  
    41 static INTVAL 
    42 iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data) 
    43 { 
    44     long ident = (long)user_data; 
    45     int length = ident; 
    46     printf("%*.0s%s\n", length, "", seg->name); 
    47     if (seg->type == PF_DIR_SEG) 
    48         PackFile_map_segments(interp, (PackFile_Directory*)seg, 
    49                 iter, (void*)(ident+2)); 
    50     return 0; 
    51 } 
    52  
    53 /* 
    54  
    55 =item C<int main(int argc, char *argv[])> 
    56  
    57 Reads the PBC from argv[1], adds a few extra sections, and then iterates over 
    58 the directory using PackFile_map_segments() and iter(). 
    59  
    60 =cut 
    61  
    62 */ 
    63  
    64 int 
    65 main(SHIM(int argc), char *argv[]) 
    66 { 
    67     PackFile *pf; 
    68     Interp *interp; 
    69     PackFile_Segment *seg; 
    70  
    71     interp = Parrot_new(NULL); 
    72  
    73     pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS); 
    74  
    75     /* 
    76      * add some more segments 
    77      */ 
    78     seg = PackFile_Segment_new_seg(interp, 
    79                     &pf->directory, PF_DIR_SEG, "dir2", 1); 
    80     seg = PackFile_Segment_new_seg(interp, 
    81                     (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1); 
    82     seg = PackFile_Segment_new_seg(interp, 
    83                     &pf->directory, PF_DIR_SEG, "dir3", 1); 
    84  
    85     /* 
    86      * show these 
    87      */ 
    88     printf("%s\n", pf->directory.base.name); 
    89     PackFile_map_segments(interp, &pf->directory, iter, (void*)2); 
    90  
    91     Parrot_exit(interp, 0); 
    92 } 
    93  
    94 /* 
    95  
    96 =back 
    97  
    98 =head1 SEE ALSO 
    99  
    100 F<src/packfile.c>, F<include/parrot/packfile.h>. 
    101  
    102 =cut 
    103  
    104 */ 
    105  
    106  
    107 /* 
    108  * Local variables: 
    109  *   c-file-style: "parrot" 
    110  * End: 
    111  * vim: expandtab shiftwidth=4: 
    112  */ 
    113  
  • docs/dev/fhs.pod

     
    5555=head3 /usr/bin 
    5656 
    5757This is the primary directory of executable commands on the system. All 
    58 executables that are intended to be called directly by the user (i.e. 
    59 parrot, parrot_debugger, pbc_disassemble, pbc_dump, pbc_info, pbg_merge, ...) 
    60 should go here. The current version number should be appended to the 
    61 binaries itself and a symlink needs to be created that points from the 
    62 binary with version number to the normal name of the file without a 
    63 version. That makes installing more than one version possible. 
     58executables that are intended to be called directly by the user (i.e.  parrot, 
     59parrot_debugger, pbc_disassemble, pbc_dump, pbg_merge, ...) should go here. 
     60The current version number should be appended to the binaries itself and a 
     61symlink needs to be created that points from the binary with version number to 
     62the normal name of the file without a version. That makes installing more than 
     63one version possible. 
    6464 
    6565Executables that are for internal use only are stored elsewhere. 
    6666 
  • tools/dev/pbc_header.pl

     
    9999    return; 
    100100} 
    101101 
    102 sub pbc_info { 
    103     for my $f (@ARGV) { 
    104         open my $F, "<", "$f" or die "Can't open $f: $!"; 
    105         binmode $F; 
    106         print "$f\n"; 
    107  
    108         show_pbc_file_info($F); 
    109     } 
    110  
    111     return; 
    112 } 
    113  
    114102my @pbc_header_type_names; 
    115103BEGIN { 
    116104    @pbc_header_type_names = qw( directory default fixup constant 
  • MANIFEST

     
    11# ex: set ro: 
    22# $Id$ 
    33# 
    4 # generated by tools/dev/mk_manifest_and_skip.pl Sun May 24 16:30:09 2009 UT 
     4# generated by tools/dev/mk_manifest_and_skip.pl Tue May 26 23:30:19 2009 UT 
    55# 
    66# See tools/dev/install_files.pl for documentation on the 
    77# format of this file. 
     
    631631examples/benchmarks/vpm.py                                  [examples] 
    632632examples/benchmarks/vpm.rb                                  [examples] 
    633633examples/c/nanoparrot.c                                     [examples] 
     634examples/c/pbc_info.c                                       [examples] 
    634635examples/c/test_main.c                                      [examples] 
    635636examples/compilers/Makefile                                 [examples] 
    636637examples/compilers/japhc.c                                  [examples] 
     
    13611362src/parrot_debugger.c                                       [] 
    13621363src/pbc_disassemble.c                                       [] 
    13631364src/pbc_dump.c                                              [] 
    1364 src/pbc_info.c                                              [] 
    13651365src/pbc_merge.c                                             [] 
    13661366src/pic.c                                                   [] 
    13671367src/pic_jit.c                                               [] 
     
    20262026t/tools/install/testlib/parrot.pc                           [test] 
    20272027t/tools/install/testlib/phony                               [test] 
    20282028t/tools/install/testlib/phony.exe                           [test] 
     2029t/tools/install/testlib/runtime/parrot/include/sockets.pasm [test] 
    20292030t/tools/install/testlib/runtime/parrot/library/TGE.pbc      [test] 
    20302031t/tools/install/testlib/src/ops/ops.num                     [test] 
    20312032t/tools/install/testlib/src/pmc/pmc_object.h                [test] 
  • ports/suse/parrot.spec.suse

     
    134134%{_bindir}/parrot_config 
    135135%{_bindir}/parrot_debugger 
    136136%{_bindir}/pbc_disassemble 
    137 %{_bindir}/pbc_info 
    138137%{_bindir}/pbc_merge 
    139138%{_bindir}/pbc_to_exe 
    140139%{_bindir}/pbc_dump 
  • ports/fedora/parrot.spec.fedora

     
    235235%{_bindir}/parrot_config 
    236236%{_bindir}/parrot_debugger 
    237237%{_bindir}/pbc_disassemble 
    238 %{_bindir}/pbc_info 
    239238%{_bindir}/pbc_merge 
    240239%{_bindir}/pbc_to_exe 
    241240%{_bindir}/pbc_dump 
  • ports/mandriva/parrot.spec.mandriva

     
    158158%{_bindir}/parrot_config 
    159159%{_bindir}/parrot_debugger 
    160160%{_bindir}/pbc_disassemble 
    161 %{_bindir}/pbc_info 
    162161%{_bindir}/pbc_merge 
    163162%{_bindir}/pbc_to_exe 
    164163%{_bindir}/pbc_dump 
  • ports/debian/rules

     
    4444        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_dump.c debian/pbc_dump.1 
    4545        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_disassemble.c debian/pbc_disassemble.1 
    4646        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/parrot_debugger.c debian/parrot_debugger.1 
    47         pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_info.c debian/pbc_info.1 
    4847        pod2man --section=1 --release="Debian Project" --center="Debian GNU/Linux manual" src/pbc_merge.c debian/pbc_merge.1 
    4948        touch build-stamp 
    5049 
    5150clean: debian-control-stamp 
    5251        dh_testdir 
    5352        dh_testroot 
    54         rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_info.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo 
     53        rm -f build-stamp configure-stamp debian-control-stamp debian/parrot.1 debian/parrot_config.1 debian/pbc_dump.1 debian/pbc_disassemble.1 debian/parrot-debugger.1 debian/pbc_merge.1 debian/libparrot$(SOVERSION).install src/main.o installable_pbc_to_exe ext/Parrot-Embed/Makefile.PL test.c test.ldo 
    5554        [ ! -f Makefile ] || $(MAKE) distclean 
    5655        dh_clean  
    5756 
     
    8988        dh_testroot -a 
    9089        dh_installchangelogs -a ChangeLog 
    9190        dh_installman -pparrot-minimal debian/parrot.1 
    92         dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_info.1 debian/pbc_merge.1 debian/parrot_config.1 
     91        dh_installman -pparrot-devel debian/parrot_debugger.1 debian/pbc_disassemble.1 debian/pbc_dump.1 debian/pbc_merge.1 debian/parrot_config.1 
    9392        dh_installdocs -a 
    9493        dh_strip -a 
    9594        dh_compress -a 
  • ports/debian/parrot-devel.install.in

     
    11usr/bin/parrot_debugger 
    22usr/bin/pbc_disassemble 
    33usr/bin/pbc_dump 
    4 usr/bin/pbc_info 
    54usr/bin/pbc_merge 
    65usr/bin/parrot_config 
    76usr/lib/parrot/@VERSION@/tools/* 
  • ports/macports/Portfile

     
    5555 
    5656        set executables { 
    5757            parrot parrot_config parrot_debugger 
    58             pbc_disassemble pbc_info pbc_merge pbc_to_exe pbc_dump 
     58            pbc_disassemble pbc_merge pbc_to_exe pbc_dump 
    5959        } 
    6060 
    6161        foreach exe $executables {  
  • MANIFEST.SKIP

     
    11# ex: set ro: 
    22# $Id$ 
    3 # generated by tools/dev/mk_manifest_and_skip.pl Fri May 15 17:05:40 2009 UT 
     3# generated by tools/dev/mk_manifest_and_skip.pl Wed May 27 02:14:55 2009 UT 
    44# 
    55# This file should contain a transcript of the svn:ignore properties 
    66# of the directories in the Parrot subversion repository. (Needed for 
  • include/parrot/packfile.h

     
    5555/* 
    5656** Parrot_pbc_read() options: 
    5757**   parrot, pbc_merge, parrot_debugger use 0 
    58 **   pbc_dump, pbc_disassemble, pbc_info use 1 to skip the version check 
     58**   pbc_dump, pbc_disassemble use 1 to skip the version check 
    5959**   pbc_dump -h requires 2 
    6060**   The rest is for TRACE_PACKFILE debugging with switch -D in pbc_dump 
    6161*/ 
  • t/codingstd/c_function_docs.t

     
    134134src/jit/ppc/exec_dep.c 
    135135src/nci_test.c 
    136136src/pbc_dump.c 
    137 src/pbc_info.c 
    138137src/pic.c 
    139138src/pic_jit.c 
    140139src/string/charset/ascii.c 
  • MANIFEST.generated

     
    5757installable_pbc_disassemble                       [main]bin 
    5858installable_pbc_dump.exe                          [main]bin 
    5959installable_pbc_dump                              [main]bin 
    60 installable_pbc_info.exe                          [main]bin 
    61 installable_pbc_info                              [main]bin 
    6260installable_pbc_merge.exe                         [main]bin 
    6361installable_pbc_merge                             [main]bin 
    6462installable_pbc_to_exe.exe                        [main]bin 
  • config/gen/makefiles/root.in

     
    483483MINIPARROT          := $(CUR_DIR)/miniparrot$(EXE) 
    484484DIS                 := $(CUR_DIR)/pbc_disassemble$(EXE) 
    485485PDUMP               := $(CUR_DIR)/pbc_dump$(EXE) 
    486 PINFO               := $(CUR_DIR)/pbc_info$(EXE) 
    487486PBCMERGE            := $(CUR_DIR)/pbc_merge$(EXE) 
    488487PDB                 := $(CUR_DIR)/parrot_debugger$(EXE) 
    489488PBC_TO_EXE          := $(CUR_DIR)/pbc_to_exe$(EXE) 
     
    494493INSTALLABLEPARROT   := $(CUR_DIR)/installable_parrot$(EXE) 
    495494INSTALLABLEDIS      := $(CUR_DIR)/installable_pbc_disassemble$(EXE) 
    496495INSTALLABLEPDUMP    := $(CUR_DIR)/installable_pbc_dump$(EXE) 
    497 INSTALLABLEPINFO    := $(CUR_DIR)/installable_pbc_info$(EXE) 
    498496INSTALLABLEPBCMERGE := $(CUR_DIR)/installable_pbc_merge$(EXE) 
    499497INSTALLABLEPBCTOEXE := $(CUR_DIR)/installable_pbc_to_exe$(EXE) 
    500498INSTALLABLEPDB      := $(CUR_DIR)/installable_parrot_debugger$(EXE) 
     
    585583    $(PBCMERGE) \ 
    586584    $(PDB) \ 
    587585    $(PDUMP) \ 
    588     $(PINFO) \ 
    589586 
    590587$(GEN_LIBRARY) : $(PARROT) 
    591588 
     
    655652        @echo "  world:             'all' and 'parrot_utils'." 
    656653        @echo "  installable:       same as 'world', but targets for installation" 
    657654        @echo "" 
    658         @echo "  parrot_utils:      $(PDUMP), $(DIS), $(PINFO), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)" 
     655        @echo "  parrot_utils:      $(PDUMP), $(DIS), $(PDB), $(PBCMERGE) and $(PBC_TO_EXE) $(PARROT_CONFIG)" 
    659656        @echo " $(PDUMP):" 
    660657        @echo "                     Parrot Dumper" 
    661658        @echo " $(DIS):" 
    662659        @echo "                     Parrot Disassembler" 
    663         @echo " $(PINFO):" 
    664         @echo "                     Information about Parrot Byte Code" 
    665660        @echo " $(PDB):" 
    666661        @echo "                     Parrot Debugger" 
    667662        @echo " $(PBCMERGE):" 
     
    759754 
    760755world : all parrot_utils 
    761756 
    762 parrot_utils : $(PDUMP) $(DIS) $(PINFO) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) 
     757parrot_utils : $(PDUMP) $(DIS) $(PDB) $(PBCMERGE) $(PBC_TO_EXE) $(PARROT_CONFIG) 
    763758 
    764 installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPINFO) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) 
     759installable: all $(INSTALLABLEPARROT) $(INSTALLABLEPDUMP) $(INSTALLABLEDIS) $(INSTALLABLEPDB) $(INSTALLABLEPBCMERGE) $(INSTALLABLEPBCTOEXE) $(INSTALLABLECONFIG) 
    765760 
    766761 
    767762flags_dummy : 
     
    958953#IF(win32):     if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 
    959954 
    960955 
    961 # pbc_info 
    962 $(PINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT) 
    963         $(LINK) @ld_out@$@ \ 
    964     $(SRC_DIR)/pbc_info$(O) \ 
    965     @rpath_blib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) 
    966 #IF(win32):     if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 
    967956 
    968 $(SRC_DIR)/pbc_info$(O) : $(INC_DIR)/parrot.h $(GEN_HEADERS) 
    969  
    970 $(INSTALLABLEPINFO) : $(SRC_DIR)/pbc_info$(O) $(LIBPARROT) 
    971         $(LINK) @ld_out@$@ \ 
    972     $(SRC_DIR)/pbc_info$(O) \ 
    973     @rpath_lib@ $(ALL_PARROT_LIBS) $(LINKFLAGS) 
    974 #IF(win32):     if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1 
    975  
    976957# 
    977958# Parrot Bytecode File Merger 
    978959# 
     
    16671648    $(INSTALLABLEPARROT) \ 
    16681649    $(INSTALLABLEDIS) \ 
    16691650    $(INSTALLABLEPDUMP) \ 
    1670     $(INSTALLABLEPINFO) \ 
    16711651    $(INSTALLABLEPBCMERGE) \ 
    16721652    $(INSTALLABLEPBCTOEXE) \ 
    16731653    $(INSTALLABLEPDB) \ 
     
    16761656    parrot_config$(EXE) parrot_config.c parrot_config$(O) parrot_config.pbc \ 
    16771657    $(IMCC_DIR)/main$(O) \ 
    16781658    $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ 
    1679     $(SRC_DIR)/pbc_info$(O) $(PINFO) \ 
    16801659    $(PDB) $(SRC_DIR)/parrot_debugger$(O) \ 
    16811660    $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \ 
    16821661    $(DIS) $(SRC_DIR)/pbc_disassemble$(O) 
     
    17071686    $(INSTALLABLEPARROT) \ 
    17081687    $(INSTALLABLEDIS) \ 
    17091688    $(INSTALLABLEPDUMP) \ 
    1710     $(INSTALLABLEPINFO) \ 
    17111689    $(INSTALLABLEPBCMERGE) \ 
    17121690    $(INSTALLABLEPDB) \ 
    17131691    $(INSTALLABLECONFIG) \ 
    17141692    $(IMCC_DIR)/main$(O) \ 
    17151693    $(PDUMP) $(SRC_DIR)/pbc_dump$(O) $(SRC_DIR)/packdump$(O) \ 
    1716     $(PINFO) $(SRC_DIR)/pbc_info$(O) \ 
    17171694    $(PDB) $(SRC_DIR)/parrot_debugger$(O) \ 
    17181695    $(PBCMERGE) $(SRC_DIR)/pbc_merge$(O) \ 
    17191696    $(DIS) $(SRC_DIR)/pbc_disassemble$(O) \ 
  • examples/c/pbc_info.c

     
     1/* 
     2Copyright (C) 2001-2003, Parrot Foundation. 
     3$Id$ 
     4 
     5=head1 NAME 
     6 
     7pbc_info - PackFile demo 
     8 
     9=head1 SYNOPSIS 
     10 
     11 pbc_info file.pbc 
     12 
     13=head1 DESCRIPTION 
     14 
     15Sample program for dumping PackFile segment names by iterating 
     16over the main directory. 
     17 
     18=head2 Functions 
     19 
     20=over 4 
     21 
     22=cut 
     23 
     24*/ 
     25 
     26#include "parrot/parrot.h" 
     27#include "parrot/embed.h" 
     28 
     29/* 
     30 
     31=item C<static INTVAL iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data)> 
     32 
     33This function is passed the callback to PackFile_map_segments() to print out 
     34the name of each segment in the directory. 
     35 
     36=cut 
     37 
     38*/ 
     39 
     40static INTVAL 
     41iter(PARROT_INTERP, PackFile_Segment *seg, void *user_data) 
     42{ 
     43    long ident = (long)user_data; 
     44    int length = ident; 
     45    printf("%*.0s%s\n", length, "", seg->name); 
     46    if (seg->type == PF_DIR_SEG) 
     47        PackFile_map_segments(interp, (PackFile_Directory*)seg, 
     48                iter, (void*)(ident+2)); 
     49    return 0; 
     50} 
     51 
     52/* 
     53 
     54=item C<int main(int argc, char *argv[])> 
     55 
     56Reads the PBC from argv[1], adds a few extra sections, and then iterates over 
     57the directory using PackFile_map_segments() and iter(). 
     58 
     59=cut 
     60 
     61*/ 
     62 
     63int 
     64main(SHIM(int argc), char *argv[]) 
     65{ 
     66    PackFile *pf; 
     67    Interp *interp; 
     68    PackFile_Segment *seg; 
     69 
     70    interp = Parrot_new(NULL); 
     71 
     72    pf = Parrot_pbc_read(interp, argv[1], PFOPT_UTILS); 
     73 
     74    /* 
     75     * add some more segments 
     76     */ 
     77    seg = PackFile_Segment_new_seg(interp, 
     78                    &pf->directory, PF_DIR_SEG, "dir2", 1); 
     79    seg = PackFile_Segment_new_seg(interp, 
     80                    (PackFile_Directory*)seg, PF_BYTEC_SEG, "code", 1); 
     81    seg = PackFile_Segment_new_seg(interp, 
     82                    &pf->directory, PF_DIR_SEG, "dir3", 1); 
     83 
     84    /* 
     85     * show these 
     86     */ 
     87    printf("%s\n", pf->directory.base.name); 
     88    PackFile_map_segments(interp, &pf->directory, iter, (void*)2); 
     89 
     90    Parrot_exit(interp, 0); 
     91} 
     92 
     93/* 
     94 
     95=back 
     96 
     97=head1 SEE ALSO 
     98 
     99F<src/packfile.c>, F<include/parrot/packfile.h>. 
     100 
     101=cut 
     102 
     103*/ 
     104 
     105 
     106/* 
     107 * Local variables: 
     108 *   c-file-style: "parrot" 
     109 * End: 
     110 * vim: expandtab shiftwidth=4: 
     111 */ 
     112