repo.or.cz
/
binutils-gdb
/
blckswan.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Automatic date update in version.in
[binutils-gdb/blckswan.git]
/
gdb
/
testsuite
/
gdb.multi
/
bkpt-multi-exec.c
blob
eb002fb2545b5a8c02ebcf4644e39cff3c03521f
1
#include <stdio.h>
2
#include <stdlib.h>
3
#include <unistd.h>
4
#include <string.h>
5
#include <limits.h>
6
7
int
main
(
int
argc
,
char
**
argv
)
8
{
9
char
prog
[
PATH_MAX
];
10
int
len
;
11
12
strcpy
(
prog
,
argv
[
0
]);
13
len
=
strlen
(
prog
);
14
/* Replace "bkpt-multi-exec" with "crashme". */
15
memcpy
(
prog
+
len
-
15
,
"crashme"
,
7
);
16
prog
[
len
-
8
] =
0
;
17
18
printf
(
"foll-exec is about to execl(crashme)...
\n
"
);
19
20
execl
(
prog
,
21
prog
,
22
(
char
*)
0
);
23
}