source: rtems-tools/linkers/rtld-base.ini @ 6fb1409

4.104.115
Last change on this file since 6fb1409 was 6fb1409, checked in by Chris Johns <chrisj@…>, on Sep 8, 2014 at 10:20:41 PM

rtems-tld: Add entry and exit trace support.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1;
2; RTEMS Trace Linker Base configuration.
3;
4; Copyright 2014 Chris Johns <chrisj@rtems.org>
5;
6
7;
8; The default generartor is used if a function set does provide a generator record.
9;
10[default-generator]
11generator = printf-generator
12
13;
14; A printf generator prints to stdout the trace functions.
15;
16[printf-generator]
17headers = printf-generator-headers
18entry-trace = "rtld_pg_print_entry(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
19arg-trace = "rtld_pg_print_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
20exit-trace = "rtld_pg_print_exit(@FUNC_NAME@, (void*) &@FUNC_LABEL@);"
21ret-trace = "rtld_pg_print_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
22code = <<<CODE
23static inline void rtld_pg_print_entry(const char* func_name,
24                                       void*       func_addr)
25{
26  printf (" >> %s (0x%08x)\n", func_name, func_addr);
27}
28static inline void rtld_pg_print_arg(int         arg_num,
29                                     const char* arg_type,
30                                     int         arg_size,
31                                     void*       arg)
32{
33  const unsigned char* p = arg;
34  int   i;
35  printf (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
36  for (i = 0; i < arg_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
37  printf ("\n");
38}
39static inline void rtld_pg_print_exit(const char* func_name,
40                                      void*       func_addr)
41{
42  printf (" << %s (0x%08x)\n", func_name, func_addr);
43}
44static inline void rtld_pg_print_ret(const char* ret_type,
45                                     int         ret_size,
46                                     void*       ret)
47{
48  const unsigned char* p = ret;
49  int   i;
50  printf (" rt] %s(%d) = ", ret_type, ret_size);
51  for (i = 0; i < ret_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
52  printf ("\n");
53}
54CODE
55
56[printf-generator-headers]
57header = "#include <stdio.h>"
Note: See TracBrowser for help on using the repository browser.