From: uz Date: Sat, 7 Aug 2010 13:40:16 +0000 (+0000) Subject: Some more test and example code. X-Git-Tag: V2.13.3~661 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3eed1bffbc58b6a9f9e9fb6c4a25713c25c9cec5;p=cc65 Some more test and example code. git-svn-id: svn://svn.cc65.org/cc65/trunk@4790 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/dbginfo/dbgtest.c b/src/dbginfo/dbgtest.c index d1e9662b3..adb3cdb12 100644 --- a/src/dbginfo/dbgtest.c +++ b/src/dbginfo/dbgtest.c @@ -66,6 +66,7 @@ int main (int argc, char** argv) const char* Input; cc65_dbginfo Info; cc65_filelist* Files; + cc65_lineinfo* L; unsigned I; unsigned long Addr; @@ -92,12 +93,24 @@ int main (int argc, char** argv) } cc65_free_filelist (Info, Files); + /* Check one line */ + printf ("Requesting line info for crt0.s(59):\n"); + L = cc65_lineinfo_byname (Info, "crt0.s", 59); + if (L == 0) { + printf (" Not found\n"); + } else { + printf (" Code range is $%04X-$%04X\n", L->data[0].start, L->data[0].end); + cc65_free_lineinfo (Info, L); + } + + + /* Output debug information for all addresses in the complete 6502 address * space. This is also sort of a benchmark for the search algorithms. */ printf ("Line info:\n"); for (Addr = 0; Addr < 0x10000; ++Addr) { - cc65_lineinfo* L = cc65_lineinfo_byaddr (Info, Addr); + L = cc65_lineinfo_byaddr (Info, Addr); if (L) { unsigned I; printf (" $%04lX: ", Addr);