Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
luzpaz
gstreamer
Commits
54ad9d5e
Commit
54ad9d5e
authored
Dec 19, 2002
by
Wim Taymans
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanups
Original commit message from CVS: Small cleanups
parent
fa4df165
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
43 deletions
+48
-43
tools/gst-launch.c
tools/gst-launch.c
+48
-43
No files found.
tools/gst-launch.c
View file @
54ad9d5e
...
...
@@ -107,69 +107,74 @@ xmllaunch_parse_cmdline (const gchar **argv)
}
extern
volatile
gboolean
glib_on_error_halt
;
void
fault_restore
(
void
);
static
void
fault_restore
(
void
);
void
fault_handler
(
int
signum
,
siginfo_t
*
si
,
void
*
misc
)
static
void
fault_handler
(
int
signum
,
siginfo_t
*
si
,
void
*
misc
)
{
int
spinning
=
TRUE
;
int
spinning
=
TRUE
;
fault_restore
();
fault_restore
();
if
(
si
->
si_signo
==
SIGSEGV
){
g_print
(
"Caught SIGSEGV accessing address %p
\n
"
,
si
->
si_addr
);
}
else
if
(
si
->
si_signo
==
SIGQUIT
){
g_print
(
"Caught SIGQUIT
\n
"
);
}
else
{
g_print
(
"signo: %d
\n
"
,
si
->
si_signo
);
g_print
(
"errno: %d
\n
"
,
si
->
si_errno
);
g_print
(
"code: %d
\n
"
,
si
->
si_code
);
}
if
(
si
->
si_signo
==
SIGSEGV
)
{
g_print
(
"Caught SIGSEGV accessing address %p
\n
"
,
si
->
si_addr
);
}
else
if
(
si
->
si_signo
==
SIGQUIT
){
g_print
(
"Caught SIGQUIT
\n
"
);
}
else
{
g_print
(
"signo: %d
\n
"
,
si
->
si_signo
);
g_print
(
"errno: %d
\n
"
,
si
->
si_errno
);
g_print
(
"code: %d
\n
"
,
si
->
si_code
);
}
glib_on_error_halt
=
FALSE
;
g_on_error_stack_trace
(
"gst-launch"
);
glib_on_error_halt
=
FALSE
;
g_on_error_stack_trace
(
"gst-launch"
);
wait
(
NULL
);
wait
(
NULL
);
#if 1
/* FIXME how do we know if we were run by libtool? */
g_print
(
"Spinning. Please run 'gdb gst-launch %d' to continue debugging, "
"Ctrl-C to quit, or Ctrl-
\\
to dump core.
\n
"
,
getpid
());
while
(
spinning
)
usleep
(
1000000
);
/* FIXME how do we know if we were run by libtool? */
g_print
(
"Spinning. Please run 'gdb gst-launch %d' to continue debugging, "
"Ctrl-C to quit, or Ctrl-
\\
to dump core.
\n
"
,
getpid
());
while
(
spinning
)
usleep
(
1000000
);
#else
/* This spawns a gdb and attaches it to gst-launch. */
{
char
str
[
40
];
sprintf
(
str
,
"gdb -quiet gst-launch %d"
,
getpid
());
system
(
str
);
}
_exit
(
0
);
/* This spawns a gdb and attaches it to gst-launch. */
{
char
str
[
40
];
sprintf
(
str
,
"gdb -quiet gst-launch %d"
,
getpid
());
system
(
str
);
}
_exit
(
0
);
#endif
}
void
fault_restore
(
void
)
static
void
fault_restore
(
void
)
{
struct
sigaction
action
;
struct
sigaction
action
;
memset
(
&
action
,
0
,
sizeof
(
action
));
action
.
sa_handler
=
SIG_DFL
;
memset
(
&
action
,
0
,
sizeof
(
action
));
action
.
sa_handler
=
SIG_DFL
;
sigaction
(
SIGSEGV
,
&
action
,
NULL
);
sigaction
(
SIGQUIT
,
&
action
,
NULL
);
sigaction
(
SIGSEGV
,
&
action
,
NULL
);
sigaction
(
SIGQUIT
,
&
action
,
NULL
);
}
void
fault_setup
(
void
)
static
void
fault_setup
(
void
)
{
struct
sigaction
action
;
struct
sigaction
action
;
memset
(
&
action
,
0
,
sizeof
(
action
));
action
.
sa_sigaction
=
fault_handler
;
action
.
sa_flags
=
SA_SIGINFO
;
memset
(
&
action
,
0
,
sizeof
(
action
));
action
.
sa_sigaction
=
fault_handler
;
action
.
sa_flags
=
SA_SIGINFO
;
sigaction
(
SIGSEGV
,
&
action
,
NULL
);
sigaction
(
SIGQUIT
,
&
action
,
NULL
);
sigaction
(
SIGSEGV
,
&
action
,
NULL
);
sigaction
(
SIGQUIT
,
&
action
,
NULL
);
}
int
...
...
@@ -196,7 +201,7 @@ main(int argc, char *argv[])
free
(
malloc
(
8
));
/* -lefence */
fault_setup
();
fault_setup
();
gst_init_with_popt_table
(
&
argc
,
&
argv
,
options
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment