On 07/06/18 11:31, Vidushi Vashishth wrote:
Hi!

Quick question. I tried to modify the printk trace generator to print the output traces into a text file instead of the console. On running the normal link and trace linker commands there are no compilation errors. However when I run the application executable using GDB it says [Inferior 1 (process 42000) exited normally].

This is what I am doing to the code section of the rtld-print.ini's printk generator:

static inline void rtld_pg_printk_entry(const char* func_name,
                                        void*       func_addr)
{
  FILE* fp = fopen("trace.txt", "a");

Always check the return value of functions which may fail.

  fprintf (fp, ">>> %s (0x%08x)\n", func_name, func_addr);
  fclose(fp);
}

Is there something wrong with this approach?

Maybe the wrong execution context. The fprintf() must be called from task context. I would debug the rtld_pg_printk_entry() function to figure out what is going on.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.hu...@embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to