GDB (xrefs)

Macros | Functions
/tmp/gdb-8.1/gdb/darwin-nat-info.c File Reference
`#include "defs.h"`
`#include "symtab.h"`
`#include "gdbtypes.h"`
`#include "gdbcore.h"`
`#include "value.h"`
`#include "gdbcmd.h"`
`#include "inferior.h"`
`#include <sys/sysctl.h>`
`#include "darwin-nat.h"`
`#include <mach/thread_info.h>`
`#include <mach/thread_act.h>`
`#include <mach/task.h>`
`#include <mach/vm_map.h>`
`#include <mach/mach_port.h>`
`#include <mach/mach_init.h>`
`#include <mach/mach_vm.h>`

Go to the source code of this file.

## Macros
#define | CHECK_ARGS(what, args)
#define | PRINT_FIELD(structure, field) printf_unfiltered(_(#field":\t%#lx\n"), (unsigned long) (structure)->field)
#define | PRINT_TV_FIELD(structure, field)
#define | task_self mach_task_self
#define | task_by_unix_pid task_for_pid
#define | port_name_array_t mach_port_array_t
#define | port_type_array_t mach_port_array_t

## Functions
static void | info_mach_tasks_command (const char *args, int from_tty)
static task_t | get_task_from_args (const char *args)
static void | info_mach_task_command (const char *args, int from_tty)
static void | info_mach_ports_command (const char *args, int from_tty)
static void | darwin_debug_port_info (task_t task, mach_port_t port)
static void | info_mach_port_command (const char *args, int from_tty)
static void | info_mach_threads_command (const char *args, int from_tty)
static void | info_mach_thread_command (const char *args, int from_tty)
static const char * | unparse_protection (vm_prot_t p)
static const char * | unparse_inheritance (vm_inherit_t i)
static const char * | unparse_share_mode (unsigned char p)
static const char * | unparse_user_tag (unsigned int tag)
static void | darwin_debug_regions (task_t task, mach_vm_address_t address, int max)
static void | darwin_debug_regions_recurse (task_t task)
static void | darwin_debug_region (task_t task, mach_vm_address_t address)
static void | info_mach_regions_command (const char *args, int from_tty)
static void | info_mach_regions_recurse_command (const char *args, int from_tty)
static void | info_mach_region_command (const char *exp, int from_tty)
static void | disp_exception (const darwin_exception_info *info)
static void | info_mach_exceptions_command (const char *args, int from_tty)
void | _initialize_darwin_info_commands (void)

## Macro Definition Documentation

## ◆ CHECK_ARGS

#define CHECK_ARGS | ( |  | what,
|  |  | args
| ) |  |

Value:
do { \
if ((NULL == args) || ((args[0] != '0') && (args[1] != 'x'))) \
error(_("%s must be specified with 0x..."), what); \
} while (0)
_
#define _(String)
Definition: gdb_locale.h:35

Definition at line 50 of file darwin-nat-info.c.

Referenced by info_mach_port_command(), and info_mach_thread_command().

## ◆ port_name_array_t

#define port_name_array_t mach_port_array_t

Definition at line 65 of file darwin-nat-info.c.

Referenced by info_mach_ports_command().

## ◆ port_type_array_t

#define port_type_array_t mach_port_array_t

Definition at line 66 of file darwin-nat-info.c.

Referenced by info_mach_ports_command().

## ◆ PRINT_FIELD

#define PRINT_FIELD | ( |  | structure,
|  |  | field
| ) |  | printf_unfiltered(_(#field":\t%#lx\n"), (unsigned long) (structure)->field)

Definition at line 55 of file darwin-nat-info.c.

Referenced by info_mach_task_command(), and info_mach_thread_command().

## ◆ PRINT_TV_FIELD

#define PRINT_TV_FIELD | ( |  | structure,
|  |  | field
| ) |  |

Value:
printf_unfiltered(_(#field":\t%u.%06u sec\n"), \
(unsigned) (structure)->field.seconds, \
(unsigned) (structure)->field.microseconds)
_
#define _(String)
Definition: gdb_locale.h:35
field
Definition: gdbtypes.h:517
printf_unfiltered
void printf_unfiltered(const char *format,...)
Definition: utils.c:2056

Definition at line 58 of file darwin-nat-info.c.

Referenced by info_mach_task_command().

## ◆ task_by_unix_pid

#define task_by_unix_pid task_for_pid

Definition at line 64 of file darwin-nat-info.c.

Referenced by info_mach_tasks_command().

## ◆ task_self

#define task_self mach_task_self

Definition at line 63 of file darwin-nat-info.c.

Referenced by info_mach_ports_command(), and info_mach_threads_command().

## Function Documentation

## ◆ _initialize_darwin_info_commands()

void _initialize_darwin_info_commands | ( | void |  | ) |

Definition at line 846 of file darwin-nat-info.c.

References _, add_info(), info_mach_exceptions_command(), info_mach_port_command(), info_mach_ports_command(), info_mach_region_command(), info_mach_regions_command(), info_mach_regions_recurse_command(), info_mach_task_command(), info_mach_tasks_command(), info_mach_thread_command(), and info_mach_threads_command().

## ◆ darwin_debug_port_info()

static void darwin_debug_port_info | ( | task_t | task,
|  | mach_port_t | port
| ) |  |
| static

Definition at line 302 of file darwin-nat-info.c.

References _, MACH_CHECK_ERROR, printf_unfiltered(), and status.

Referenced by info_mach_port_command().

## ◆ darwin_debug_region()

static void darwin_debug_region | ( | task_t | task,
|  | mach_vm_address_t | address
| ) |  |
| static

Definition at line 691 of file darwin-nat-info.c.

References darwin_debug_regions().

Referenced by info_mach_region_command().

## ◆ darwin_debug_regions()

static void darwin_debug_regions | ( | task_t | task,
|  | mach_vm_address_t | address,
|  | int | max
| ) |  |
| static

Definition at line 510 of file darwin-nat-info.c.

References _, paddress(), printf_filtered(), size, target_gdbarch(), unparse_inheritance(), and unparse_protection().

Referenced by darwin_debug_region(), and info_mach_regions_command().

## ◆ darwin_debug_regions_recurse()

static void darwin_debug_regions_recurse | ( | task_t | task | ) |
| static

Definition at line 608 of file darwin-nat-info.c.

References _, current_uiout, ui_out::field_core_addr(), ui_out::field_int(), ui_out::field_string(), gdbarch_addr_bit(), ui_out::is_mi_like_p(), ui_out::table_body(), ui_out::table_header(), target_gdbarch(), ui_out::text(), ui_left, ui_noalign, unparse_inheritance(), unparse_protection(), unparse_share_mode(), and unparse_user_tag().

Referenced by info_mach_regions_recurse_command().

## ◆ disp_exception()

static void disp_exception | ( | const darwin_exception_info * | info | ) |
| static

Definition at line 744 of file darwin-nat-info.c.

References _, darwin_exception_info::behaviors, darwin_exception_info::count, darwin_exception_info::masks, darwin_exception_info::ports, printf_filtered(), and printf_unfiltered().

Referenced by info_mach_exceptions_command().

## ◆ get_task_from_args()

static task_t get_task_from_args | ( | const char * | args | ) |
| static

Definition at line 112 of file darwin-nat-info.c.

References _, current_inferior(), get_darwin_inferior(), inferior_ptid, null_ptid, printf_unfiltered(), ptid_equal(), and darwin_inferior::task.

Referenced by info_mach_ports_command(), info_mach_regions_command(), info_mach_regions_recurse_command(), info_mach_task_command(), and info_mach_threads_command().

## ◆ info_mach_exceptions_command()

static void info_mach_exceptions_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 794 of file darwin-nat-info.c.

References _, inferior::args, darwin_exception_info::behaviors, darwin_exception_info::count, current_inferior(), darwin_host_self, disp_exception(), error(), darwin_exception_info::flavors, get_darwin_inferior(), arm-linux::inf, inferior_ptid, MACH_CHECK_ERROR, darwin_exception_info::masks, null_ptid, darwin_exception_info::ports, printf_unfiltered(), inferior::priv, and ptid_equal().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_port_command()

static void info_mach_port_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 327 of file darwin-nat-info.c.

References _, inferior::args, CHECK_ARGS, and darwin_debug_port_info().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_ports_command()

static void info_mach_ports_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 195 of file darwin-nat-info.c.

References _, current_inferior(), darwin_ex_port, darwin_host_self, darwin_port_set, gdb_assert, darwin_thread_info::gdb_port, get_darwin_inferior(), get_task_from_args(), inferior_ptid, MACH_CHECK_ERROR, name, null_ptid, port_name_array_t, port_type_array_t, printf_unfiltered(), inferior::priv, ptid_equal(), task_self, and type.

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_region_command()

static void info_mach_region_command | ( | const char * | exp,
|  | int | from_tty
| ) |  |
| static

Definition at line 721 of file darwin-nat-info.c.

References _, value::address, current_inferior(), darwin_debug_region(), error(), evaluate_expression(), get_darwin_inferior(), arm-linux::inf, inferior_ptid, null_ptid, parse_expression(), inferior::priv, ptid_equal(), TYPE_IS_REFERENCE, value_as_address(), value_ind(), and value_type().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_regions_command()

static void info_mach_regions_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 697 of file darwin-nat-info.c.

References darwin_debug_regions(), and get_task_from_args().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_regions_recurse_command()

static void info_mach_regions_recurse_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 709 of file darwin-nat-info.c.

References darwin_debug_regions_recurse(), and get_task_from_args().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_task_command()

static void info_mach_task_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 138 of file darwin-nat-info.c.

References _, get_task_from_args(), MACH_CHECK_ERROR, PRINT_FIELD, PRINT_TV_FIELD, and printf_unfiltered().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_tasks_command()

static void info_mach_tasks_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 69 of file darwin-nat-info.c.

References _, printf_unfiltered(), task_by_unix_pid, xfree(), and xmalloc().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_thread_command()

static void info_mach_thread_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 366 of file darwin-nat-info.c.

References _, CHECK_ARGS, flags, MACH_CHECK_ERROR, PRINT_FIELD, and printf_unfiltered().

Referenced by _initialize_darwin_info_commands().

## ◆ info_mach_threads_command()

static void info_mach_threads_command | ( | const char * | args,
|  | int | from_tty
| ) |  |
| static

Definition at line 339 of file darwin-nat-info.c.

References _, inferior::args, get_task_from_args(), MACH_CHECK_ERROR, printf_unfiltered(), task_self, and thread_count().

Referenced by _initialize_darwin_info_commands().

## ◆ unparse_inheritance()

static const char* unparse_inheritance | ( | vm_inherit_t | i | ) |
| static

Definition at line 426 of file darwin-nat-info.c.

References _.

Referenced by darwin_debug_regions(), and darwin_debug_regions_recurse().

## ◆ unparse_protection()

static const char* unparse_protection | ( | vm_prot_t | p | ) |
| static

Definition at line 400 of file darwin-nat-info.c.

Referenced by darwin_debug_regions(), and darwin_debug_regions_recurse().

## ◆ unparse_share_mode()

static const char* unparse_share_mode | ( | unsigned char | p | ) |
| static

Definition at line 442 of file darwin-nat-info.c.

References _.

Referenced by darwin_debug_regions_recurse().

## ◆ unparse_user_tag()

static const char* unparse_user_tag | ( | unsigned int | tag | ) |
| static

Definition at line 466 of file darwin-nat-info.c.

References _.

Referenced by darwin_debug_regions_recurse().