コード例 #1
0
        public static void  doShowFuncs(DebugCLI cli)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            String        arg      = null;
            FileInfoCache fileInfo = cli.FileCache;

            // we take an optional single arg which specifies a module
            try
            {
                // let's wait a bit for the background load to complete
                cli.waitForMetaData();

                if (cli.hasMoreTokens())
                {
                    arg = cli.nextToken();
                    int id = arg.Equals(".")?cli.propertyGet(DebugCLI.LIST_MODULE):cli.parseFileArg(-1, arg);                      //$NON-NLS-1$

                    DModule m = (DModule)fileInfo.getFile(id);
                    m.lineMapping(sb);
                }
                else
                {
                    SourceFile[] ar = fileInfo.FileList;
                    if (ar == null)
                    {
                        cli.err(LocalizationManager.getLocalizedTextString("key18"));
                    }
                    //$NON-NLS-1$
                    else
                    {
                        for (int i = 0; ar != null && i < ar.Length; i++)
                        {
                            DModule m = (DModule)ar[i];
                            m.lineMapping(sb);
                        }
                    }
                }

                cli.output(sb.ToString());
            }
            catch (NullReferenceException)
            {
                cli.err(LocalizationManager.getLocalizedTextString("key19"));                 //$NON-NLS-1$
            }
            catch (FormatException pe)
            {
                cli.err(pe.Message);
            }
            catch (AmbiguousException ae)
            {
                cli.err(ae.Message);
            }
            catch (NoMatchException nme)
            {
                cli.err(nme.Message);
            }
            catch (InProgressException)
            {
                cli.err(LocalizationManager.getLocalizedTextString("key20"));                 //$NON-NLS-1$
            }
        }