~ubuntu-branches/ubuntu/vivid/uml-utilities/vivid-proposed

« back to all changes in this revision

Viewing changes to gdb/gdbinit~

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2002-04-25 22:22:36 UTC
  • Revision ID: james.westby@ubuntu.com-20020425222236-c77x5ypvsn9cbxi8
Tags: upstream-20020415
ImportĀ upstreamĀ versionĀ 20020415

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#Give this a task like
 
2
#uml-task-info current_task
 
3
#it will dump info about it
 
4
define uml-task-info
 
5
set $tstate = "Unknown"
 
6
if $arg0->state == 0
 
7
 set $tstate = "R"
 
8
end
 
9
if $arg0->state == 1
 
10
 set $tstate = "S"
 
11
end
 
12
if $arg0->state == 2
 
13
 set $tstate = "D"
 
14
end
 
15
if $arg0->state == 4
 
16
 set $tstate = "Z"
 
17
end
 
18
if $arg0->state == 8
 
19
 set $tstate = "T"
 
20
end
 
21
printf "PID(ext): %d(%d)\tState: %s UID(E): %d(%d) \tCmd: %10s @ 0x%x\n", $arg0->pid, $arg0->thread.extern_pid, $tstate, \
 
22
 $arg0->uid, $arg0->euid, $arg0->comm, $arg0
 
23
end
 
24
 
 
25
#dump out the info for the files the task has open
 
26
define uml-task-files
 
27
set $files = $arg0->files
 
28
set $max = $files->max_fds
 
29
set $i = 0
 
30
if $max > 32
 
31
 set $max = 32
 
32
end
 
33
while $i < $max
 
34
 if $files->fd_array[$i] != 0
 
35
  printf "     File fd = %d Name: %s\n", $i, $files->fd_array[$i]->f_dentry.d_iname
 
36
 end
 
37
 set $i = $i + 1
 
38
end
 
39
end
 
40
 
 
41
#walk though the task list and print info about them
 
42
define uml-tasks
 
43
uml-task-info current_task
 
44
set $p = current_task.next_task
 
45
while $p != current_task
 
46
 uml-task-info $p
 
47
 if $uml_task > 1
 
48
  uml-task-files $p
 
49
 end
 
50
 set $p = $p->next_task
 
51
end
 
52
end
 
53
 
 
54
 
 
55
#Vars depend on how much info we dump
 
56
#$uml_task = (*  ) always dump some info
 
57
#$uml_task = (> 0) dump open files
 
58
set $uml_task = 0
 
59
 
 
60