Problem with gdb script

Brett Swimley brett.swimley at aedinc.net
Fri Sep 5 14:43:33 UTC 2003


OK - This is all I'm using here.  Note that as I indicated, I changed 
all my "Thread_Control" references to "struct Thread_Control_struct" 
which seems to work with my version of gdb.

Brett

define dump_tasks_support
 set $index = 0
 printf "\n"
 while $index < $arg0.maximum
  set $pt = (struct Thread_Control_struct *)$arg0.local_table[$index]
  if $pt != 0
   printf "thread 0x%x: state=0x%x pri=%d\n", \
    $pt->Object.id, $pt->current_state, $pt->current_priority
   p $pt->Start->entry_point
   printf "\n"
  end

  set $index = $index + 1
  end
end

define dump_tasks
  dump_tasks_support _RTEMS_tasks_Information
end

define set_task_pointer
 set $index = 0
 set $done = 0
 printf "object_id = 0x%x\n", $arg0
 while $index < _RTEMS_tasks_Information.maximum && $done == 0
  set $pt = (struct Thread_Control_struct 
*)_RTEMS_tasks_Information.local_table[$index]
  if  $pt != 0
    if $pt->Object.id == $arg0
    p $pt
        set $done = 1
    end
  end
  set $index = $index + 1
 end
 if $done == 0
  printf "task_pointer not found\n"
  end
end


-- 
Brett Swimley
Advanced Electronic Designs
brett.swimley at aedinc.net
ph: 406-585-8892 fax: 406-585-8893






More information about the users mailing list