First version of a module that reads debug files generated by ld65.

git-svn-id: svn://svn.cc65.org/cc65/trunk@4779 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2010-08-03 18:46:50 +00:00
parent e046ecbcf2
commit 54e22eb53c
4 changed files with 1735 additions and 0 deletions

85
src/dbginfo/dbgtest.c Normal file
View File

@@ -0,0 +1,85 @@
/*****************************************************************************/
/* */
/* dbgtest.c */
/* */
/* Test file for the cc65 dbginfo module */
/* */
/* */
/* */
/* (C) 2010, Ullrich von Bassewitz */
/* Roemerstrasse 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/* warranty. In no event will the authors be held liable for any damages */
/* arising from the use of this software. */
/* */
/* Permission is granted to anyone to use this software for any purpose, */
/* including commercial applications, and to alter it and redistribute it */
/* freely, subject to the following restrictions: */
/* */
/* 1. The origin of this software must not be misrepresented; you must not */
/* claim that you wrote the original software. If you use this software */
/* in a product, an acknowledgment in the product documentation would be */
/* appreciated but is not required. */
/* 2. Altered source versions must be plainly marked as such, and must not */
/* be misrepresented as being the original software. */
/* 3. This notice may not be removed or altered from any source */
/* distribution. */
/* */
/*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "dbginfo.h"
static void ErrorFunc (const struct cc65_parseerror* E)
/* Handle errors or warnings that occur while parsing a debug file */
{
fprintf (stderr,
"%s:%s(%lu): %s\n",
E->type? "Error" : "Warning",
E->name,
E->line,
E->errormsg);
}
static void Usage (void)
/* Print usage information and exit */
{
printf ("Usage: dbgtest debug-file\n");
exit (1);
}
int main (int argc, char** argv)
{
const char* Input;
cc65_dbginfo Handle;
/* Input file is argument */
if (argc != 2) {
Usage ();
}
Input = argv[1];
Handle = cc65_read_dbginfo (Input, ErrorFunc);
if (Handle == 0) {
fprintf (stderr, "No handle\n");
}
return 0;
}