Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
132 user(s) are online (105 user(s) are browsing Forums)

Members: 0
Guests: 132

more...

Headlines

 
  Register To Post  

« 1 (2)
Re: C tool to obtain functions-tree, function adresses & sizes ??
Just can't stay away
Just can't stay away


See User information
@JosDuchIt

Quote:
I feel surprised there is no such tool known/readily available.
Of course there are such tools as well, if you only want a static call graph use something like
http://os4depot.net/index.php?functio ... ent/misc/cprofilerppc.lha
http://aminet.net/package/dev/c/cflow
http://savannah.gnu.org/projects/cflow/

Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Just can't stay away
Just can't stay away


See User information
@joerg
i tried to use both
cflow needs more stuff to work, bash etc , i am not acquainted with
cprofilerppc was easy to install but did not work.
It may be just a catalog thing (only a .ct or .cd file in the archive) but even when i set my locale prefs to english it does not start, although there are ni
snoopy complaints for lacking catalog.

The author Jim Steichen was kind enough to provide the source
I uploaded it here. http://users.online.be/AD/CProfilerPPC_Src.lha

He told me
Quote:

you could just yank out ALL calls to CMsg() and replace it with the
correct program strings located in
cprofiler.cd

Modify the source code until it works for you. I can no longer support
the Amiga platform, so if you get a version
of CProfillerPPC to work, feel free to post your working version in
Aminet or AmigaOSDepot (i.e., where ever you found
the program!)


Seems easy enough, but
1) i would prefer not to loose the localisation possibility
2) i never used makefiles, so
If someone more experienced could have a look at it ?

Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Home away from home
Home away from home


See User information
@JosDuchIt

Quote:

Seems easy enough, but
1) i would prefer not to loose the localisation possibility
2) i never used makefiles, so
If someone more experienced could have a look at it ?


The original starts okay here, but has stacks of issues,
such as:

file requester in single choice mode, when you want to choose 30+ source files, one by one is a bit of a pain!.

Sys:T/ for temp dir instead of T: (or configurable at least)

I will take alook as I suddenly find a similar need, but it may take a while before I have time to do it. (or I may do it tonight )


Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Just can't stay away
Just can't stay away


See User information
@broadblues

Great

I have been busy trying to compile CPropfilerPPC, but did not succeed till now

I got help from Jim Steichen, and he did send me files that are not present in the archive
I did put them all in a new archive
http://users.online.be/AD/CProfilerPPC+src.lha
including the instructions i got from Jim CProfilerJimsHelp.txt


Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Amigans Defender
Amigans Defender


See User information
@broadblues

Quote:

gprof doesn't wrk on SAMs but it might on other machines.


No. it doest't work anymore.. there is a bug in bugzilla..


Edited by ssolie on 2014/4/22 22:33:17
i'm really tired...
Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Just can't stay away
Just can't stay away


See User information
@broadblues


I am compiling the source, and i am tracking a bug that prevent the gui to appear.
That bug is in CProfGUI.c
Here is the OpenCPWindow()function
PRIVATE int OpenCPWindowvoid )
{
   
struct NewGadget  ng;
   
struct Gadget    *g;
   
UWORD             lctc;
   
UWORD             wleft CPLeftwtop CPTopwwwh;
   
UWORD             zCoords[] = { 200030025 };
        
   
ComputeFontScrFont, &CFontCPWidthCPHeight );

   
ww ComputeXCFont.FontXCPWidth );
   
wh ComputeYCFont.FontYCPHeight );

   
wleft = (Scr->Width  ww) / 2;
   
wtop  = (Scr->Height wh) / 2;

   if (!(
CPFont OpenDiskFontFont ))) // == NULL)
      
return( -);

   if (!(
CreateContext( &CPGList ))) // == NULL)
      
return( -);

   for (
lc 0tc 0lc CP_CNTlc++) 
      {
      
CopyMem( (char *) &CPNGadlc ], (char *) &ng
               (
longsizeofstruct NewGadget )
             );

      
ng.ng_VisualInfo VisualInfo;
      
ng.ng_TextAttr   Font;
      
ng.ng_LeftEdge   CFont.OffX ComputeXCFont.FontX
                                                
ng.ng_LeftEdge
                                              
);

      
ng.ng_TopEdge    CFont.OffY ComputeYCFont.FontY,
                                                
ng.ng_TopEdge
                                              
);

      
ng.ng_Width      ComputeXCFont.FontXng.ng_Width );
      
ng.ng_Height     ComputeYCFont.FontYng.ng_Height);

      
CPGadgetslc ] = 
                      
CreateGadgetA( (ULONGCPGTypeslc ], 
                                       
g
                                       &
ng
                                       (
struct TagItem *) &CPGTagstc ] );

      while (
CPGTagstc ] != TAG_DONE
         
tc += 2;

      
tc++;

      if (!
g// == NULL)
         
return( -);
      }

   if (!(
CPMenus CreateMenusCPNewMenuGTMN_FrontPen0LTAG_DONE ))) // == NULL)
      
return( -);

   
LayoutMenusCPMenusVisualInfoTAG_DONE );

   if (!(
CPWnd OpenWindowTagsNULL,

                    
WA_Left,        wleft,
                    
WA_Top,         wtop,
                    
WA_Width,       ww CFont.OffX Scr->WBorRight,
                    
WA_Height,      wh CFont.OffY Scr->WBorBottom,

                    
WA_IDCMP,       CHECKBOXIDCMP BUTTONIDCMP 
                      
LISTVIEWIDCMP STRINGIDCMP INTEGERIDCMP
                      
IDCMP_CLOSEWINDOW IDCMP_VANILLAKEY IDCMP_RAWKEY 
                      
IDCMP_REFRESHWINDOW IDCMP_MENUPICK,

                    
WA_Flags,       WFLG_DRAGBAR WFLG_DEPTHGADGET
                      
WFLG_CLOSEGADGET WFLG_SMART_REFRESH WFLG_HASZOOM
                      
WFLG_ACTIVATE,

                    
WA_Zoom,         (ULONG) &zCoords[0],
                    
WA_Gadgets,      CPGList,
                    
WA_Title,        CPWdt,
                    
WA_ScreenTitle,  ScrTitle,
                      
WA_CustomScreenScr,

                    
TAG_DONE )))
      {
      return( -
);
      }

   
SetMenuStripCPWndCPMenus );

   
GT_RefreshWindowCPWndNULL );

   
CPRender();

   return( 
);
}


The gadgets are created using
PRIVATE ULONG CPGTags[] = {

   (
TAG_DONE),   (TAG_DONE),   (TAG_DONE),
   (
TAG_DONE),   (TAG_DONE),   (TAG_DONE),

   (
GT_Underscore), '_', (TAG_DONE),
   (
GT_Underscore), '_', (TAG_DONE),

    
GTLV_ShowSelected0L, (LAYOUTA_Spacing), 3,
    
GTLV_Selected,     TRUE, (TAG_DONE),

   (
GA_TabCycle), FALSE, (GTST_MaxChars), BUFF_SIZE// Anonymous Str gadget
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
   
   (
GT_Underscore), '_', (TAG_DONE), // BuildFuncs button
   
(GA_TabCycle), FALSE, (GTST_MaxChars), BUFF_SIZE// Output filename
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),

   (
GA_TabCycle), FALSE, (GTST_MaxChars), 256// Function Str
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),

   (
GTIN_Number), 66, (GTIN_MaxChars), 4,  // Length integer
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
   
   (
GTIN_Number), 80, (GTIN_MaxChars), 4// Width integer
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
   
   (
GTIN_Number), 5, (GTIN_MaxChars), 4,  // Right Margin
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
   
   (
GTIN_Number), 5, (GTIN_MaxChars), 4,  // Left Margin
   
(STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
   
   (
GT_Underscore), '_', (TAG_DONE), // Make Profile
   
(GT_Underscore), '_', (TAG_DONE), // Load Filelist

//   (GA_TabCycle), FALSE, (GTST_MaxChars), 256,  // Function Name
//   (STRINGA_Justification), (GACT_STRINGCENTER), (TAG_DONE),
//   (GT_Underscore), '_', (TAG_DONE), // Edit Function

}


PRIVATE UWORD CPGTypes[] = {

   
CHECKBOX_KINDCHECKBOX_KINDCHECKBOX_KIND// CheckBox Gadgets
   
CHECKBOX_KINDCHECKBOX_KINDCHECKBOX_KIND,

   
BUTTON_KIND,   BUTTON_KIND,   LISTVIEW_KIND// BuildFuncs gadgets.
   
STRING_KIND,   BUTTON_KIND,
   
STRING_KIND,   STRING_KIND,   INTEGER_KIND,  // CProfiler gadgets.
   
INTEGER_KIND,  INTEGER_KIND,  INTEGER_KIND,
   
BUTTON_KIND,   BUTTON_KIND,
//   STRING_KIND,   BUTTON_KIND,                  // GetF gadgets.

}


and
PRIVATE struct NewGadget CPNGad[] = {

// Re-adjust following gadgets TopEdge by 34 if EditFuncs are uncommented.

   
147358,  2611, (STRPTR"page length",       NULLID_PageLength
   
PLACETEXT_LEFTNULL, (APTRPageLengthClicked,
   
   
147381,  2611, (STRPTR"page width",        NULLID_PageWidth
   
PLACETEXT_LEFTNULL, (APTRPageWidthClicked,
   
   
147404,  2611, (STRPTR"right margin",      NULLID_RightMargin
   
PLACETEXT_LEFTNULL, (APTRRightMarginClicked,
   
   
147427,  2611, (STRPTR"left margin",       NULLID_LeftMargin
   
PLACETEXT_LEFTNULL, (APTRLeftMarginClicked,
   
   
147454,  2611, (STRPTR"statistics only",   NULLID_StatsOnly
   
PLACETEXT_LEFTNULL, (APTRStatsOnlyClicked,
   
   
147329,  2611, (STRPTR"target function",   NULLID_TargetFunction
   
PLACETEXT_LEFTNULL, (APTRTargetFunctionClicked,

    
17,  2610120, (STRPTR"_Add File",         NULLID_AddFile
   
PLACETEXT_INNULL, (APTRAddFileClicked,

    
17,  5410120, (STRPTR"_Delete File",      NULLID_DeleteFile
   
PLACETEXT_INNULL, (APTRDeleteFileClicked,

   
122,  26495185, (STRPTR"Source Files:",     NULLID_FilesLV
   
PLACETEXT_ABOVE|NG_HIGHLABELNULL, (APTRFilesLVClicked,
   
   
12220749520,                      NULL,     NULLID_FileNameStr
   
0NULL, (APTRFileNameStrClicked,

   
26423213920, (STRPTR"_Build Functions!"NULLID_Build_Funcs
   
PLACETEXT_INNULL, (APTRBuildFuncsClicked,

   
26330535520, (STRPTR"Output Name:",      NULLID_OutFileStr
   
PLACETEXT_LEFTNULL, (APTROutFileStrClicked,

   
26332935520, (STRPTR"Function:",         NULLID_FunctionStr
   
PLACETEXT_LEFTNULL, (APTRFunctionStrClicked,
   
   
263358,  4720, (STRPTR"Length:",           NULLID_LengthInt
   
PLACETEXT_LEFTNULL, (APTRLengthIntClicked,
   
   
263381,  4720, (STRPTR"Width:",            NULLID_WidthInt
   
PLACETEXT_LEFTNULL, (APTRWidthIntClicked,
   
   
263404,  4720, (STRPTR"Right:",            NULLID_RightInt
   
PLACETEXT_LEFTNULL, (APTRRightIntClicked,
   
   
263427,  4720, (STRPTR"Left:",             NULLID_LeftInt
   
PLACETEXT_LEFTNULL, (APTRLeftIntClicked,
   
   
41536011820, (STRPTR"Make _Profile!",    NULLID_MakeProfile
   
PLACETEXT_INNULL, (APTRMakeProfileClicked,

   
// 04/28/99 Added Load FileList gadget:   
   
12223213320, (STRPTR"_Load FileList!",   NULLID_LoadListFile,
   
PLACETEXT_INNULL, (APTRLoadListFileClicked,

/*
   260, 263, 355, 20, (STRPTR) "Function Name:",    NULL, ID_EditFuncNameStr,
   PLACETEXT_LEFT, NULL, (APTR) EditFuncNameStrClicked,

    10, 263, 127, 20, (STRPTR) "_Edit Function!",   NULL, ID_EditFuncs, 
   PLACETEXT_IN, NULL, (APTR) EditFuncsClicked,

   Re-adjust Output Name thru MakeProfile gadgets TopEdge by 34 if these are uncommented.
*/
};


I did verify that lc never gets higher than 9 in the for loop
.

If i limit the gadgets CP_CNT initally set to 19, to rhe value of 9 the gui appears.
So i first suspected the 1st string gadget to cause the problem
then i deleted that gadget (commenting out the corresponding lines in the 3 arrays shown, ) and lowering the CP_CNT
The probllem was not gone, i then eliminated all string gadgets, no better result.
And always lc was 9 or 8 in order to have the window opened.

Then the CreateGadgetA failed and

if (!g) // == NULL)
         return( -2 );
      }
was entered

I am out of ideas what else to try.







btw there were more files lacking, so the archives mentioned previously are both incomplete.

This should contain them all
http://users.online.be/AD/ProfilerPPC-src3.lha
( i am using other makefile and manipulated sources and headers to be able to compile though)


Edited by JosDuchIt on 2014/4/28 19:46:12
Edited by JosDuchIt on 2014/4/28 19:58:02
Edited by JosDuchIt on 2014/4/28 20:02:17
Edited by JosDuchIt on 2014/4/28 20:12:41
Edited by JosDuchIt on 2014/4/28 20:38:20
Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Home away from home
Home away from home


See User information
Sorry I didn't have any time to investigate in the end. I used cflow to get the info I needed.

Usage is dead easy, especialy in your case as you have just one source file. Just use the rexx script provided in the cflow archive.

That source to CProfile is messy and generally rubbish I really couldn't be bothered with it!

But the program seem to start of my SAM. Font issue?

Check that the values returned by ComputeX and ComputeY are sane.




Go to top
Re: C tool to obtain functions-tree, function adresses & sizes ??
Just can't stay away
Just can't stay away


See User information
Achieved CProfierPPC compilation in a usable form with the the GUI appearing.
@broadblues : Your guess about something with the font sensitiveness is probably right.
Anyway i chose a standard topaz font and deleted (for now) eveything font related.
I deleted the menus too (for now) .
What is strange is that the problems were definitely(?) STRING_kind and INTEGER_kind related.
Don't see why computing sizes for buttons, listviews and checkboxes is OK and not for those 2 gadget types.

The source looks well structured to me (now that the lacking parts, notably includes and a static library were send to me by the author) only problem was that the makefile supposed them to be in the gcc path and in some CPGM: drawer.

I lost much time because of the described symptom: the gadget creation always sropped at the 9th gadget, even when i switvhed gadgets in the correspondig Tag, gadget-kind and the strucy NewGadget arrays.

It seems this was due to me not recognising the role of the catalog array, set up with the SetUPCatalog function.

The use of a catalog and the interesting way Jim Steichen designed the launch from CLI (looking for the tooltypes in the icon) were 2 reasons i am glad i made the effort to compile CProfilerPPC.

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project