source: rtems-tools/linkers/rtld-print.ini @ b938414

4.104.11
Last change on this file since b938414 was 5025439, checked in by Chris Johns <chrisj@…>, on Sep 21, 2014 at 4:24:37 AM

rtems-tld: Add config options, fix void args, and SCore traces.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1;
2; RTEMS Trace Linker Printf and Prink configuration.
3;
4; Copyright 2014 Chris Johns <chrisj@rtems.org>
5;
6
7;
8; A printf generator prints to stdout the trace functions.
9;
10[printf-generator]
11headers = printf-generator-headers
12entry-trace = "rtld_pg_printf_entry(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
13arg-trace = "rtld_pg_printf_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
14exit-trace = "rtld_pg_printf_exit(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
15ret-trace = "rtld_pg_printf_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
16code = <<<CODE
17static inline void rtld_pg_printf_entry(const char* func_name,
18                                        void*       func_addr)
19{
20  printf (">>> %s (0x%08x)\n", func_name, func_addr);
21}
22static inline void rtld_pg_printf_arg(int         arg_num,
23                                      const char* arg_type,
24                                      int         arg_size,
25                                      void*       arg)
26{
27  const unsigned char* p = arg;
28  int   i;
29  printf (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
30  for (i = 0; i < arg_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
31  printf ("\n");
32}
33static inline void rtld_pg_printf_exit(const char* func_name,
34                                       void*       func_addr)
35{
36  printf ("<<< %s (0x%08x)\n", func_name, func_addr);
37}
38static inline void rtld_pg_printf_ret(const char* ret_type,
39                                      int         ret_size,
40                                      void*       ret)
41{
42  const unsigned char* p = ret;
43  int   i;
44  printf (" rt] %s(%d) = ", ret_type, ret_size);
45  for (i = 0; i < ret_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
46  printf ("\n");
47}
48CODE
49
50[printf-generator-headers]
51header = "#include <stdio.h>"
52
53[printk-generator]
54headers = printk-generator-headers
55entry-trace = "rtld_pg_printk_entry(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
56arg-trace = "rtld_pg_printk_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
57exit-trace = "rtld_pg_printk_exit(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
58ret-trace = "rtld_pg_printk_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
59code = <<<CODE
60static inline void rtld_pg_printk_entry(const char* func_name,
61                                        void*       func_addr)
62{
63  printk (">>> %s (0x%08x)\n", func_name, func_addr);
64}
65static inline void rtld_pg_printk_arg(int         arg_num,
66                                     const char* arg_type,
67                                     int         arg_size,
68                                     void*       arg)
69{
70  const unsigned char* p = arg;
71  int   i;
72  printk (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
73  for (i = 0; i < arg_size; ++i, ++p) printk ("%02x", (unsigned int) *p);
74  printk ("\n");
75}
76static inline void rtld_pg_printk_exit(const char* func_name,
77                                       void*       func_addr)
78{
79  printk ("<<< %s (0x%08x)\n", func_name, func_addr);
80}
81static inline void rtld_pg_printk_ret(const char* ret_type,
82                                      int         ret_size,
83                                      void*       ret)
84{
85  const unsigned char* p = ret;
86  int   i;
87  printk (" rt] %s(%d) = ", ret_type, ret_size);
88  for (i = 0; i < ret_size; ++i, ++p) printk ("%02x", (unsigned int) *p);
89  printk ("\n");
90}
91CODE
92
93[printk-generator-headers]
94header = "#include <stdio.h>"
Note: See TracBrowser for help on using the repository browser.