summaryrefslogtreecommitdiff
path: root/rtld-base.ini
blob: b15f4cdcb185cddfeb30a687182c2efe5a25ef3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;
; RTEMS Trace Linker Base configuration.
;
; Copyright 2014 Chris Johns <chrisj@rtems.org>
;

;
; The default generartor is used if a function set does provide a generator record.
;
[default-generator]
generator = printf-generator

;
; A printf generator prints to stdout the trace functions.
;
[printf-generator]
headers = printf-generator-headers
arg-trace = "rtld_pg_print_arg(@ARG_NUM@, @ARG_TYPE@, @ARG_SIZE@, (void*) &@ARG_LABEL@);"
ret-trace = "rtld_pg_print_ret(@RET_TYPE@, @RET_SIZE@, (void*) &@RET_LABEL@);"
code = <<<CODE
static inline void rtld_pg_print_arg(int         arg_num,
                                     const char* arg_type,
                                     int         arg_size,
                                     void*       arg)
{
  const char* p = arg;
  int   i;
  printf (" %2d] %s(%d) = ", arg_num, arg_type, arg_size);
  for (i = 0; i < arg_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
  printf ("\n");
}
static inline void rtld_pg_print_ret(const char* ret_type,
                                     int         ret_size,
                                     void*       ret)
{
  const char* p = ret;
  int   i;
  printf (" rt] %s(%d) = ", ret_type, ret_size);
  for (i = 0; i < ret_size; ++i, ++p) printf ("%02x", (unsigned int) *p);
  printf ("\n");
}
CODE

[printf-generator-headers]
header = "#include <stdio.h>"