File: scm-obj-compact-gdbinit

package info (click to toggle)
sigscheme 0.9.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,660 kB
  • sloc: lisp: 37,498; ansic: 31,109; sh: 4,368; makefile: 744; asm: 333; ruby: 290
file content (62 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download | duplicates (19)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# This file defines handy gdb macros
# To use it, add this line to your ~/.gdbinit or
# source this file.

define scm_immp
  set $ptr = ($arg0)
  set $tag = ((((unsigned int)($ptr)) & (0x3 << 1)) >> 1)

  if $tag == 0x3
    if ((((unsigned int)($ptr)) & 0xe) == 0x6)
      printf "this is : Integer\n"
    end
    if ((((unsigned int)($ptr)) & 0x1e) == 0xe)
      printf "this is : Char\n"
    end

    if ((((unsigned int)($ptr)) & 0xfe) == 0x1e)
      printf "this is : SCM_NULL\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0x3e)
      printf "this is : SCM_INVALID\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0x5e)
      printf "this is : SCM_UNBOUND\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0x7e)
      printf "this is : SCM_TRUE\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0x9e)
      printf "this is : SCM_FALSE\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0xbe)
      printf "this is : SCM_EOF\n"
    end
    if ((((unsigned int)($ptr)) & 0xfe) == 0xde)
      printf "this is : SCM_UNDEF\n"
    end
  end
end


define p_car
  set $ptr = ((ScmObj)(((unsigned int)($arg0)) & (~0U << 3)))
  set $car = ((ScmObj)$ptr)->car
  p $car
  scm_immp $car
end

define p_cdr
  set $ptr = ((ScmObj)(((unsigned int)($arg0)) & (~0U << 3)))
  set $cdr = ((ScmObj)$ptr)->cdr
  p $cdr
  scm_immp $cdr
end

define p_obj
  p ($arg0)
  scm_immp ($arg0)

  p_car ($arg0)
  p_cdr ($arg0)
end