File: trace.h

package info (click to toggle)
remake 4.1%2Bdbg1.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,424 kB
  • ctags: 3,216
  • sloc: ansic: 32,087; perl: 1,370; sh: 295; ruby: 294; makefile: 288; lisp: 26
file content (118 lines) | stat: -rw-r--r-- 3,868 bytes parent folder | download | duplicates (2)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
Copyright (C) 2004, 2005, 2007, 2008 Rocky Bernstein <rocky@gnu.org>

This file is part of GNU Make (remake variant).

GNU Make is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

GNU Make is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU Make; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/** \file trace.h
 *
 *  \brief Header for routines related to tracing and debugging support.
 */

#ifndef REMAKE_TRACE_H
#define REMAKE_TRACE_H

#include "types.h"
#include "filedef.h"

typedef enum {
  continue_execution,   /**< Get out of debug read loop and continue execution
			     as normal.  */
  next_execution,       /**< Get out of debug read loop and continue execution
			     as but don't enter debugger for the any remaining
			     commands.  */
  skip_execution,       /**< Get out of debug read loop, but skip execution
			     of next command or action. */
  debug_readloop,       /**< Stay in debugger read loop - used only
			   inside debugger read loop. */
  debug_cmd_error       /**< Command error but stay in debugger read loop -
                             used only inside debugger read loop. */
} debug_return_t;

typedef enum
  {
    DEBUG_BRKPT_BEFORE_PREREQ     = 0,
    DEBUG_BRKPT_AFTER_PREREQ      = 1,
    DEBUG_BRKPT_AFTER_CMD         = 2,
    DEBUG_GOAL_UPDATED_HIT        = 3,
    DEBUG_READ_HIT                = 4,
    DEBUG_ERROR_HIT               = 5,
    DEBUG_STEP_HIT                = 6,
    DEBUG_STEP_COMMAND            = 7,
    DEBUG_EXPLICIT_CALL           = 8,
    DEBUG_STACK_CHANGING          = 99,
    DEBUG_NOT_GIVEN               = 100
  } debug_enter_reason_t;

typedef enum {
    INFO_TARGET_POSITION = 1,
    INFO_TARGET_NAME     = 2,
    INFO_TARGET_POSITION_AND_NAME   = 3, /* 1 & 2 */
    INFO_TARGET_TASKS               = 4,
    INFO_TARGET_TASK_COMMENT        = 8,
    INFO_TARGET_TASKS_WITH_COMMENTS = 12, /* 4 & 8 */
} info_target_output_mask_t;

/*!
  debugger command interface.
*/

/*! A call "stack". Well, since we'll have to deal with multiple child
   "jobs" it's not really a stack but a tree.
*/

/*! \brief Node for an item in the target call stack */
typedef struct target_stack_node
  {
    file_t                   *p_target;
    file_t                   *p_shared_target;
    struct target_stack_node *p_parent;
  } target_stack_node_t;

/** Pointer to top of current target call stack */
extern target_stack_node_t *p_stack_top;

/*! Push "p_target" to the call stack. Return the new stack top.
    if b_debugger is true we might enter the debugger.
*/
extern target_stack_node_t *trace_push_target (target_stack_node_t *p,
					       file_t *p_target);

/*! Pop the next target from the call stack.. */
extern void trace_pop_target (target_stack_node_t *p);

/*! \brief Node for an item in the "include Makefile" stack */
typedef struct floc_stack_node
  {
    gmk_floc               *p_floc;
    struct floc_stack_node *p_parent;
  } floc_stack_node_t;

/** Pointer to top of current target floc stack */
extern floc_stack_node_t *p_stack_floc_top;

/*! Push "p_floc" to the floc stack. Return the new stack top.
*/
extern void trace_push_floc (gmk_floc *p_floc);

/*! Pop the next floc from the call stack.. */
extern void trace_pop_floc (void);

/*! Show just a list of targets */
extern void dbg_cmd_info_targets(info_target_output_mask_t output_mask);

#endif /*REMAKE_TRACE_H*/