source: rtems-tools/linkers/rtld-base.ini @ 2126ea7

4.104.115
Last change on this file since 2126ea7 was 2126ea7, checked in by Chris Johns <chrisj@…>, on 09/08/14 at 09:29:41

rtems-tld: Generate arg and ret code in the wrapper.

  • Property mode set to 100644
File size: 1.3 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
18arg-trace = "rtld_pg_print_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
19ret-trace = "rtld_pg_print_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
20code = <<<CODE
21static inline void rtld_pg_print_arg(int         arg_num,
22                                     const char* arg_type,
23                                     int         arg_size,
24                                     void*       arg)
25{
26  const char* p = arg;
27  int   i;
28  printf (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
29  for (i = 0; i < arg_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
30  printf ("\n");
31}
32static inline void rtld_pg_print_ret(const char* ret_type,
33                                     int         ret_size,
34                                     void*       ret)
35{
36  const char* p = ret;
37  int   i;
38  printf (" rt] %s(%d) = ", ret_type, ret_size);
39  for (i = 0; i < ret_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
40  printf ("\n");
41}
42CODE
43
44[printf-generator-headers]
45header = "#include <stdio.h>"
Note: See TracBrowser for help on using the repository browser.