A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
breakpoint.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2006,2007 INRIA, INESC Porto
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
* Author: Gustavo Carneiro <gjc@inescporto.pt>
8
*/
9
10
#include "
breakpoint.h
"
11
12
#include "
log.h
"
13
14
#include "ns3/core-config.h"
15
#ifdef HAVE_SIGNAL_H
16
#include <signal.h>
17
#endif
18
19
namespace
ns3
20
{
21
22
/**
23
* \file
24
* \ingroup breakpoint
25
* ns3::BreakpointFallback function implementation.
26
*/
27
28
NS_LOG_COMPONENT_DEFINE
(
"Breakpoint"
);
29
30
#if defined(HAVE_SIGNAL_H) && defined(SIGTRAP)
31
32
void
33
BreakpointFallback
()
34
{
35
NS_LOG_FUNCTION_NOARGS
();
36
37
raise(SIGTRAP);
38
}
39
40
#else
41
42
void
43
BreakpointFallback
()
44
{
45
NS_LOG_FUNCTION_NOARGS
();
46
47
int
* a =
nullptr
;
48
/**
49
* we test here to allow a debugger to change the value of
50
* the variable 'a' to allow the debugger to avoid the
51
* subsequent segfault.
52
*/
53
if
(a ==
nullptr
)
54
{
55
*a = 0;
56
}
57
}
58
59
#endif
// HAVE_SIGNAL_H
60
61
}
// namespace ns3
breakpoint.h
NS_BREAKPOINT() macro definition and ns3::BreakpointFallback function declaration.
ns3::BreakpointFallback
void BreakpointFallback()
fallback breakpoint function
Definition
breakpoint.cc:43
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_FUNCTION_NOARGS
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Definition
log-macros-enabled.h:195
log.h
Debug message logging.
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
core
model
breakpoint.cc
Generated on Wed Oct 9 2024 01:03:22 for ns-3 by
1.11.0