Added dump of exports and imports

git-svn-id: svn://svn.cc65.org/cc65/trunk@240 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2000-07-30 21:02:44 +00:00
parent f91833caef
commit 3eabe5026f
3 changed files with 158 additions and 6 deletions

View File

@@ -77,8 +77,10 @@ static void Usage (void)
" -V\t\t\tPrint the version number and exit\n"
"\n"
"Long options:\n"
" --dump-exports\tDump exported symbols\n"
" --dump-files\t\tDump the source files\n"
" --dump-header\t\tDump the object file header\n"
" --dump-imports\tDump imported symbols\n"
" --dump-options\tDump object file options\n"
" --dump-segments\tDump the segments in the file\n"
" --help\t\tHelp (this text)\n"
@@ -88,6 +90,14 @@ static void Usage (void)
static void OptDumpExports (const char* Opt, const char* Arg)
/* Dump the exported symbols */
{
What |= D_EXPORTS;
}
static void OptDumpFiles (const char* Opt, const char* Arg)
/* Dump the source files */
{
@@ -104,6 +114,14 @@ static void OptDumpHeader (const char* Opt, const char* Arg)
static void OptDumpImports (const char* Opt, const char* Arg)
/* Dump the imported symbols */
{
What |= D_IMPORTS;
}
static void OptDumpOptions (const char* Opt, const char* Arg)
/* Dump the object file options */
{
@@ -178,11 +196,17 @@ static void DumpFile (const char* Name)
}
if (What & D_FILES) {
DumpObjFiles (F, 0);
}
}
if (What & D_SEGMENTS) {
DumpObjSegments (F, 0);
}
}
if (What & D_IMPORTS) {
DumpObjImports (F, 0);
}
if (What & D_EXPORTS) {
DumpObjExports (F, 0);
}
}
/* Close the file */
fclose (F);
@@ -195,8 +219,10 @@ int main (int argc, char* argv [])
{
/* Program long options */
static const LongOpt OptTab[] = {
{ "--dump-exports", 0, OptDumpExports },
{ "--dump-files", 0, OptDumpFiles },
{ "--dump-header", 0, OptDumpHeader },
{ "--dump-imports", 0, OptDumpImports },
{ "--dump-options", 0, OptDumpOptions },
{ "--dump-segments", 0, OptDumpSegments },
{ "--help", 0, OptHelp },