Backtrace library?

Pierre Muller muller@ics.u-strasbg.fr
Fri Aug 28 15:54:00 GMT 2009


  You could probably try to use 
Eli's work called bfdsymify.c
  This is based on GNU bfd library,
but for DJGPP stack dumps written on
a Dos console.
  But it can also handle a stack trace 
stored in a file.
  The version I have came with GDB 6.1.1 for DJGPP
and BFD version is 2.15.90, but
it might be easy to update.

  The sources are available 

ftp://ftp.univie.ac.at/applications/djgpp/v2gnu/gdb611s.zip

  
  To compile it for DJGPP on current CVS HEAD
I had to change only a little,
patch is below.

  To use it on other platform you might need to remove
DJGPP specific stuff...

  Hope this can help you.


Pierre Muller
Pascal language support maintainer for GDB

PS: Eli, is this source in any CVS tree?


Pierre@d620-muller ~/gdbcvs/djbuild/bfdsymify
$ diff -up  ../../src/bfdsymify/bfdsymify.c bfdsymify.c
--- ../../src/bfdsymify/bfdsymify.c     2009-08-28 17:00:44.781250000 +0200
+++ bfdsymify.c 2009-08-28 17:27:08.812500000 +0200
@@ -393,7 +393,8 @@ find_address_in_section (bfd *bfdp, asec
   if (pc < vma)
     return;

-  size = bfd_get_section_size_before_reloc (section);
+//  size = bfd_get_section_size_before_reloc (section);
+  size = bfd_get_section_size (section);
   if (pc >= vma + size)
     return;

@@ -575,7 +576,8 @@ int main(int argc, char **argv)
        fputs(line, ofile);
        if (progname)
        {
-         char *arg_base = basename(progname), *prog_base =
basename(line+9);
+         char *arg_base = lbasename(progname);
+         char *prog_base = lbasename(line+9);
          if (strcasecmp(prog_base, arg_base)
              && strncasecmp(prog_base, arg_base, strlen(prog_base)-4))
            fprintf(stderr,
@@ -675,7 +677,7 @@ int main(int argc, char **argv)
       }
       if (progname)
       {
-       char *arg_base = basename(progname), *prog_base = basename(prog);
+       char *arg_base = lbasename(progname), *prog_base = lbasename(prog);

        if (strcasecmp(prog_base, arg_base)
            && (strncasecmp(prog_base, arg_base, strlen(prog_base)-4)




More information about the Gdb mailing list