Changeset a0eb2bd in rtems-testing


Ignore:
Timestamp:
Jun 3, 2014, 3:53:13 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, 8895273c193787f84c4585a10f6d6aceb3b25dc4
Children:
4813bac
Parents:
98cefe7
git-author:
Joel Sherrill <joel.sherrill@…> (06/03/14 15:53:13)
git-committer:
Joel Sherrill <joel.sherrill@…> (06/03/14 15:54:28)
Message:

rtems-gdb-macros-4.11: Add printing stack size and base

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sim-scripts/rtems-gdb-macros-4.11

    r98cefe7 ra0eb2bd  
    22# GDB macros for analyzing RTEMS threads
    33#
    4 #
    5 #  20 July 2008 - Chris:
    6 #    + Use "struct Thread_Control_struct".
    7 #
    8 #  7 August 2006 - Joel:
    9 #    + Use Thread_Control_struct not Thread_Control to make gdb happy.
    10 #      Who knows why this makes gdb happier?
    11 #  10 July 2006 - Joel:
    12 #    + Renamed all methods to start with rtems_ if public and rtems_helper_
    13 #       if private
    14 #    + Merged code to dump timer delta chain
    15 #    + Added code to dump Classic Semaphores, Message Queues, and Regions
    16 #    + Added support code to dump SuperCore Mutexes, Semaphores,
    17 #        Message Queues, Thread Queues, and Heaps
    18 #
    194#  TODO:
    20 #    + rtems_task_backtrack is CPU specific.  How to fix?
    21 #    + Need to detect when POSIX and ITRON are not configured so
    22 #      a nice message is printed when those commands are used
     5#    + rtems_task_backtrack is CPU specific.  How to detect CPU in gdb?
     6#    + Generally need to detect when options like SMP, POSIX, etc. are
     7#      enabled/disabled and impact code generation for data structures.
    238#    + Add support for Classic API
    249#       - Periods
     
    4833#    rtems_posix_mutexes
    4934#    rtems_tasks
     35#    rtems_task_stacks
    5036#    rtems_internal_ticks_chain
    5137#    rtems_internal_seconds_chain
     
    156142  printf "%08x | ",$id
    157143
    158   set $state = $pt->current_state
    159144  set $pri = $pt->current_priority
    160145  printf "%3d | ",$pri
    161   # set $cpu_time_used = ($pt->cpu_time_used.tv_sec * 1000000) + $pt->cpu_time_used.tv_nsec
     146
    162147  set $cpu_time_used = $pt->cpu_time_used
    163148  printf "%12d | ", $cpu_time_used
    164149
     150  set $stack_base = $pt->Start.Initial_stack.area
     151  set $stack_size = $pt->Start.Initial_stack.size
     152  printf "%p 0x%04x | ", $stack_base, $stack_size
     153
     154  set $state = $pt->current_state
    165155  if $state == 0
    166156    printf "READY"
     
    237227define rtems_helper_task_header
    238228    printf "\
    239 =====================================================================\n"
    240   printf "\
    241  # | Name |    ID    | Pri |    Nsecs     | State\n"
     229============================================================================\n"
     230  printf "\
     231 # | Name |    ID    | Pri |    Nsecs     | Stack Base/Size  | State\n"
    242232    printf "\
    243 ---+------+----------+-----+--------------+------------------------------\n"
     233---+------+----------+-----+--------------+------------------+--------------\n"
    244234end
    245235# Internal Helper Do Not Document
     
    913903define rtems_tasks
    914904  printf "Executing: 0x%x, Heir: 0x%x\n", \
    915     _Per_CPU_Information.executing->Object.id, \
    916     _Per_CPU_Information.heir.Object.id
    917   printf "================================================================\n"
     905    _Per_CPU_Information.per_cpu.executing->Object.id, \
     906    _Per_CPU_Information.per_cpu.heir.Object.id
     907
    918908  printf "Internal Tasks\n"
    919909  rtems_helper_show_tasks  _Thread_Internal_information
    920   printf "================================================================\n"
     910  printf "\
     911============================================================================\n"
     912
    921913  printf "Classic Tasks\n"
    922914  rtems_helper_show_tasks  _RTEMS_tasks_Information
    923   printf "================================================================\n"
     915  printf "\
     916============================================================================\n"
     917
    924918  printf "POSIX Tasks\n"
    925919  rtems_helper_show_tasks  _POSIX_Threads_Information
     920  printf "\
     921============================================================================\n"
    926922end
    927923document rtems_tasks
Note: See TracChangeset for help on using the changeset viewer.