blob: 93ae2442a20630ef467d7e311e675bcecac4973c [file] [log] [blame]
Juan Cespedesd44c6b81998-09-25 14:48:42 +02001#include "config.h"
Juan Cespedesd44c6b81998-09-25 14:48:42 +02002
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +02003#include <stdlib.h>
Juan Cespedes7186e2a2003-01-31 19:56:34 +01004#include <string.h>
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +02005#include <assert.h>
Petr Machata2b46cfc2012-02-18 11:17:29 +01006#include <errno.h>
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +02007
Juan Cespedesf1bfe202002-03-27 00:22:23 +01008#ifdef __powerpc__
9#include <sys/ptrace.h>
10#endif
11
Petr Machata9294d822012-02-07 12:35:58 +010012#include "breakpoint.h"
Juan Cespedesf7281232009-06-25 16:11:21 +020013#include "common.h"
Petr Machata366c2f42012-02-09 19:34:36 +010014#include "proc.h"
Petr Machata2b46cfc2012-02-18 11:17:29 +010015#include "library.h"
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +020016
Petr Machatac67a6e62012-03-28 02:39:49 +020017#ifndef ARCH_HAVE_TRANSLATE_ADDRESS
18int
Petr Machatab1492df2012-04-30 21:01:40 +020019arch_translate_address_dyn(struct Process *proc,
20 target_address_t addr, target_address_t *ret)
21{
22 *ret = addr;
23 return 0;
24}
25
26struct ltelf;
27int
28arch_translate_address(struct ltelf *lte,
Petr Machatac67a6e62012-03-28 02:39:49 +020029 target_address_t addr, target_address_t *ret)
30{
31 *ret = addr;
32 return 0;
33}
34#endif
35
Petr Machataa9fd8f42012-02-07 13:25:56 +010036void
37breakpoint_on_hit(struct breakpoint *bp, struct Process *proc)
38{
39 assert(bp != NULL);
40 if (bp->cbs != NULL && bp->cbs->on_hit != NULL)
Petr Machata55ac9322012-03-27 03:07:35 +020041 (bp->cbs->on_hit)(bp, proc);
42}
43
44void
45breakpoint_on_continue(struct breakpoint *bp, struct Process *proc)
46{
47 assert(bp != NULL);
48 if (bp->cbs != NULL && bp->cbs->on_continue != NULL)
49 (bp->cbs->on_continue)(bp, proc);
50 else
51 continue_after_breakpoint(proc, bp);
Petr Machataa9fd8f42012-02-07 13:25:56 +010052}
53
Petr Machata86d38282012-04-24 18:09:01 +020054void
55breakpoint_on_retract(struct breakpoint *bp, struct Process *proc)
56{
57 assert(bp != NULL);
58 if (bp->cbs != NULL && bp->cbs->on_retract != NULL)
59 (bp->cbs->on_retract)(bp, proc);
60}
61
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +020062/*****************************************************************************/
63
Petr Machata9294d822012-02-07 12:35:58 +010064struct breakpoint *
Petr Machatafed1e8d2012-02-07 02:06:29 +010065address2bpstruct(Process *proc, void *addr)
66{
Petr Machata26627682011-07-08 18:15:32 +020067 assert(proc != NULL);
68 assert(proc->breakpoints != NULL);
Petr Machata9a5420c2011-07-09 11:21:23 +020069 assert(proc->leader == proc);
Juan Cespedescd8976d2009-05-14 13:47:58 +020070 debug(DEBUG_FUNCTION, "address2bpstruct(pid=%d, addr=%p)", proc->pid, addr);
Juan Cespedescac15c32003-01-31 18:58:58 +010071 return dict_find_entry(proc->breakpoints, addr);
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +020072}
73
Petr Machata8cce1192012-03-25 01:37:19 +010074#ifndef ARCH_HAVE_BREAKPOINT_DATA
Petr Machata2b46cfc2012-02-18 11:17:29 +010075int
76arch_breakpoint_init(struct Process *proc, struct breakpoint *sbp)
77{
78 return 0;
79}
Petr Machata8cce1192012-03-25 01:37:19 +010080
81void
82arch_breakpoint_destroy(struct breakpoint *sbp)
83{
84}
Petr Machatad3cc9882012-04-13 21:40:23 +020085
86int
87arch_breakpoint_clone(struct breakpoint *retp, struct breakpoint *sbp)
88{
89 return 0;
90}
Petr Machata2b46cfc2012-02-18 11:17:29 +010091#endif
92
Petr Machatad3cc9882012-04-13 21:40:23 +020093static void
94breakpoint_init_base(struct breakpoint *bp, struct Process *proc,
95 target_address_t addr, struct library_symbol *libsym)
96{
97 bp->cbs = NULL;
98 bp->addr = addr;
99 memset(bp->orig_value, 0, sizeof(bp->orig_value));
100 bp->enabled = 0;
101 bp->libsym = libsym;
102}
103
Petr Machata52dbfb12012-03-29 16:38:26 +0200104/* On second thought, I don't think we need PROC. All the translation
105 * (arch_translate_address in particular) should be doable using
106 * static lookups of various sections in the ELF file. We shouldn't
107 * need process for anything. */
Petr Machata2b46cfc2012-02-18 11:17:29 +0100108int
109breakpoint_init(struct breakpoint *bp, struct Process *proc,
Petr Machata55ac9322012-03-27 03:07:35 +0200110 target_address_t addr, struct library_symbol *libsym)
Petr Machata2b46cfc2012-02-18 11:17:29 +0100111{
Petr Machatad3cc9882012-04-13 21:40:23 +0200112 breakpoint_init_base(bp, proc, addr, libsym);
Petr Machata2b46cfc2012-02-18 11:17:29 +0100113 return arch_breakpoint_init(proc, bp);
114}
115
Petr Machata8cce1192012-03-25 01:37:19 +0100116void
Petr Machata55ac9322012-03-27 03:07:35 +0200117breakpoint_set_callbacks(struct breakpoint *bp, struct bp_callbacks *cbs)
118{
119 if (bp->cbs != NULL)
120 assert(bp->cbs == NULL);
121 bp->cbs = cbs;
122}
123
124void
Petr Machata8cce1192012-03-25 01:37:19 +0100125breakpoint_destroy(struct breakpoint *bp)
126{
127 if (bp == NULL)
128 return;
Petr Machata8cce1192012-03-25 01:37:19 +0100129 arch_breakpoint_destroy(bp);
130}
131
Petr Machatad3cc9882012-04-13 21:40:23 +0200132struct find_symbol_data {
133 struct library_symbol *old_libsym;
134 struct library_symbol *found_libsym;
135};
136
137static enum callback_status
138find_sym_in_lib(struct Process *proc, struct library *lib, void *u)
139{
140 struct find_symbol_data *fs = u;
141 fs->found_libsym
142 = library_each_symbol(lib, NULL, library_symbol_equal_cb,
143 fs->old_libsym);
144 return fs->found_libsym != NULL ? CBS_STOP : CBS_CONT;
145}
146
147int
148breakpoint_clone(struct breakpoint *retp, struct Process *new_proc,
149 struct breakpoint *bp, struct Process *old_proc)
150{
151 /* Find library and symbol that this breakpoint was linked to. */
152 struct library_symbol *libsym = bp->libsym;
153 struct library *lib = NULL;
154 if (libsym != NULL) {
155 struct find_symbol_data f_data = {
156 .old_libsym = libsym,
157 };
158 lib = proc_each_library(old_proc, NULL,
159 find_sym_in_lib, &f_data);
160 assert(lib != NULL);
161 libsym = f_data.found_libsym;
162 }
163
164 /* LIB and LIBSYM now hold the new library and symbol that
165 * correspond to the original breakpoint. Now we can do the
166 * clone itself. */
167 breakpoint_init_base(retp, new_proc, bp->addr, libsym);
168 memcpy(retp->orig_value, bp->orig_value, sizeof(bp->orig_value));
169 retp->enabled = bp->enabled;
Petr Machatad3cc9882012-04-13 21:40:23 +0200170 if (arch_breakpoint_clone(retp, bp) < 0)
171 return -1;
172 breakpoint_set_callbacks(retp, bp->cbs);
173 return 0;
174}
175
Petr Machata52dbfb12012-03-29 16:38:26 +0200176int
Petr Machatafa0c5702012-04-13 18:43:40 +0200177breakpoint_turn_on(struct breakpoint *bp, struct Process *proc)
Petr Machata52dbfb12012-03-29 16:38:26 +0200178{
Petr Machata52dbfb12012-03-29 16:38:26 +0200179 bp->enabled++;
180 if (bp->enabled == 1) {
Petr Machatafa0c5702012-04-13 18:43:40 +0200181 assert(proc->pid != 0);
182 enable_breakpoint(proc, bp);
Petr Machata52dbfb12012-03-29 16:38:26 +0200183 }
184 return 0;
185}
186
187int
Petr Machatafa0c5702012-04-13 18:43:40 +0200188breakpoint_turn_off(struct breakpoint *bp, struct Process *proc)
Petr Machata52dbfb12012-03-29 16:38:26 +0200189{
Petr Machata52dbfb12012-03-29 16:38:26 +0200190 bp->enabled--;
191 if (bp->enabled == 0)
Petr Machatafa0c5702012-04-13 18:43:40 +0200192 disable_breakpoint(proc, bp);
Petr Machata52dbfb12012-03-29 16:38:26 +0200193 assert(bp->enabled >= 0);
194 return 0;
195}
196
Petr Machata9294d822012-02-07 12:35:58 +0100197struct breakpoint *
Petr Machata9df15012012-02-20 12:49:46 +0100198insert_breakpoint(struct Process *proc, void *addr,
199 struct library_symbol *libsym)
Petr Machatafed1e8d2012-02-07 02:06:29 +0100200{
Petr Machata9df15012012-02-20 12:49:46 +0100201 Process *leader = proc->leader;
Petr Machata9a5420c2011-07-09 11:21:23 +0200202
203 /* Only the group leader should be getting the breakpoints and
204 * thus have ->breakpoint initialized. */
205 assert(leader != NULL);
206 assert(leader->breakpoints != NULL);
207
Petr Machata050b0a62012-04-03 01:30:30 +0200208 debug(DEBUG_FUNCTION, "insert_breakpoint(pid=%d, addr=%p, symbol=%s)",
209 proc->pid, addr, libsym ? libsym->name : "NULL");
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200210
Petr Machata218c5ff2012-04-15 04:22:39 +0200211 assert(addr != 0);
Ian Wienand9a2ad352006-02-20 22:44:45 +0100212
Petr Machata52dbfb12012-03-29 16:38:26 +0200213 /* XXX what we need to do instead is have a list of
214 * breakpoints that are enabled at this address. The
215 * following works if every breakpoint is the same and there's
216 * no extra data, but that doesn't hold anymore. For now it
217 * will suffice, about the only realistic case where we need
218 * to have more than one breakpoint per address is return from
219 * a recursive library call. */
Petr Machata2b46cfc2012-02-18 11:17:29 +0100220 struct breakpoint *sbp = dict_find_entry(leader->breakpoints, addr);
Petr Machatafed1e8d2012-02-07 02:06:29 +0100221 if (sbp == NULL) {
Petr Machata2b46cfc2012-02-18 11:17:29 +0100222 sbp = malloc(sizeof(*sbp));
223 if (sbp == NULL
Petr Machata52dbfb12012-03-29 16:38:26 +0200224 || breakpoint_init(sbp, proc, addr, libsym) < 0) {
225 free(sbp);
226 return NULL;
227 }
Petr Machatafa0c5702012-04-13 18:43:40 +0200228 if (proc_add_breakpoint(leader, sbp) < 0) {
Petr Machata52dbfb12012-03-29 16:38:26 +0200229 fail:
230 breakpoint_destroy(sbp);
Petr Machata2b46cfc2012-02-18 11:17:29 +0100231 free(sbp);
232 return NULL;
Juan Cespedescac15c32003-01-31 18:58:58 +0100233 }
Juan Cespedescac15c32003-01-31 18:58:58 +0100234 }
Petr Machata2b46cfc2012-02-18 11:17:29 +0100235
Petr Machata45728772012-04-15 04:23:55 +0200236 if (breakpoint_turn_on(sbp, proc) < 0) {
237 proc_remove_breakpoint(leader, sbp);
Petr Machata52dbfb12012-03-29 16:38:26 +0200238 goto fail;
Petr Machata45728772012-04-15 04:23:55 +0200239 }
Petr Machata9294d822012-02-07 12:35:58 +0100240
241 return sbp;
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200242}
243
Juan Cespedesf1350522008-12-16 18:19:58 +0100244void
Petr Machatafed1e8d2012-02-07 02:06:29 +0100245delete_breakpoint(Process *proc, void *addr)
246{
Juan Cespedescd8976d2009-05-14 13:47:58 +0200247 debug(DEBUG_FUNCTION, "delete_breakpoint(pid=%d, addr=%p)", proc->pid, addr);
248
Petr Machata9a5420c2011-07-09 11:21:23 +0200249 Process * leader = proc->leader;
250 assert(leader != NULL);
251
Petr Machataf7fee432012-04-19 17:00:53 +0200252 struct breakpoint *sbp = dict_find_entry(leader->breakpoints, addr);
253 assert(sbp != NULL);
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200254 /* This should only happen on out-of-memory conditions. */
Ian Wienand2d45b1a2006-02-20 22:48:07 +0100255 if (sbp == NULL)
256 return;
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200257
Petr Machatafa0c5702012-04-13 18:43:40 +0200258 if (breakpoint_turn_off(sbp, proc) < 0) {
Petr Machata52dbfb12012-03-29 16:38:26 +0200259 fprintf(stderr, "Couldn't turn off the breakpoint %s@%p\n",
260 breakpoint_name(sbp), sbp->addr);
261 return;
262 }
Petr Machataf7fee432012-04-19 17:00:53 +0200263 if (sbp->enabled == 0) {
264 proc_remove_breakpoint(leader, sbp);
265 breakpoint_destroy(sbp);
266 free(sbp);
267 }
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200268}
269
Petr Machatae9aebd62012-03-25 01:38:53 +0100270const char *
271breakpoint_name(const struct breakpoint *bp)
272{
273 assert(bp != NULL);
274 return bp->libsym != NULL ? bp->libsym->name : NULL;
275}
276
Petr Machata52dbfb12012-03-29 16:38:26 +0200277struct library *
278breakpoint_library(const struct breakpoint *bp)
279{
280 assert(bp != NULL);
281 return bp->libsym != NULL ? bp->libsym->lib : NULL;
282}
283
Juan Cespedesf1350522008-12-16 18:19:58 +0100284static void
Petr Machatafed1e8d2012-02-07 02:06:29 +0100285enable_bp_cb(void *addr, void *sbp, void *proc)
286{
Juan Cespedescd8976d2009-05-14 13:47:58 +0200287 debug(DEBUG_FUNCTION, "enable_bp_cb(pid=%d)", ((Process *)proc)->pid);
Petr Machatabc373262012-02-07 23:31:15 +0100288 if (((struct breakpoint *)sbp)->enabled)
Petr Machataf789c9c2011-07-09 10:54:27 +0200289 enable_breakpoint(proc, sbp);
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200290}
291
Juan Cespedesf1350522008-12-16 18:19:58 +0100292void
Petr Machatabc373262012-02-07 23:31:15 +0100293enable_all_breakpoints(Process *proc)
294{
Juan Cespedescd8976d2009-05-14 13:47:58 +0200295 debug(DEBUG_FUNCTION, "enable_all_breakpoints(pid=%d)", proc->pid);
Petr Machata61196a42012-02-07 16:41:03 +0100296
297 debug(1, "Enabling breakpoints for pid %u...", proc->pid);
298 if (proc->breakpoints) {
299 dict_apply_to_all(proc->breakpoints, enable_bp_cb,
300 proc);
301 }
302#ifdef __mips__
303 {
304 /*
305 * I'm sure there is a nicer way to do this. We need to
306 * insert breakpoints _after_ the child has been started.
307 */
308 struct library_symbol *sym;
309 struct library_symbol *new_sym;
310 sym=proc->list_of_symbols;
311 while(sym){
312 void *addr= sym2addr(proc,sym);
313 if(!addr){
314 sym=sym->next;
315 continue;
316 }
317 if(dict_find_entry(proc->breakpoints,addr)){
318 sym=sym->next;
319 continue;
320 }
321 debug(2,"inserting bp %p %s",addr,sym->name);
322 new_sym=malloc(sizeof(*new_sym) + strlen(sym->name) + 1);
323 memcpy(new_sym,sym,sizeof(*new_sym) + strlen(sym->name) + 1);
324 new_sym->next=proc->list_of_symbols;
325 proc->list_of_symbols=new_sym;
326 insert_breakpoint(proc, addr, new_sym);
327 sym=sym->next;
328 }
329 }
330#endif
Juan Cespedes5e01f651998-03-08 22:31:44 +0100331}
332
Juan Cespedesf1350522008-12-16 18:19:58 +0100333static void
Petr Machatafed1e8d2012-02-07 02:06:29 +0100334disable_bp_cb(void *addr, void *sbp, void *proc)
335{
Juan Cespedescd8976d2009-05-14 13:47:58 +0200336 debug(DEBUG_FUNCTION, "disable_bp_cb(pid=%d)", ((Process *)proc)->pid);
Petr Machatabc373262012-02-07 23:31:15 +0100337 if (((struct breakpoint *)sbp)->enabled)
Petr Machataf789c9c2011-07-09 10:54:27 +0200338 disable_breakpoint(proc, sbp);
Juan Cespedes5b3ffdf2001-07-02 00:52:45 +0200339}
340
Juan Cespedesf1350522008-12-16 18:19:58 +0100341void
Juan Cespedesa8909f72009-04-28 20:02:41 +0200342disable_all_breakpoints(Process *proc) {
Juan Cespedescd8976d2009-05-14 13:47:58 +0200343 debug(DEBUG_FUNCTION, "disable_all_breakpoints(pid=%d)", proc->pid);
Petr Machata9a5420c2011-07-09 11:21:23 +0200344 assert(proc->leader == proc);
Petr Machata61196a42012-02-07 16:41:03 +0100345 dict_apply_to_all(proc->breakpoints, disable_bp_cb, proc);
Juan Cespedes5e01f651998-03-08 22:31:44 +0100346}
Juan Cespedes7186e2a2003-01-31 19:56:34 +0100347
Petr Machatad09d2402012-04-13 21:34:08 +0200348/* XXX This is not currently properly supported. On clone, this is
349 * just sliced. Hopefully at the point that clone is done, this
350 * breakpoint is not necessary anymore. If this use case ends up
351 * being important, we need to add a clone and destroy callbacks to
352 * breakpoints, and we should also probably drop arch_breakpoint_data
353 * so that we don't end up with two different customization mechanisms
354 * for one structure. */
Petr Machata52dbfb12012-03-29 16:38:26 +0200355struct entry_breakpoint {
356 struct breakpoint super;
357 target_address_t dyn_addr;
358};
359
Petr Machata02648a12012-02-07 13:44:54 +0100360static void
Petr Machata12affff2012-03-29 18:33:03 +0200361entry_breakpoint_on_hit(struct breakpoint *a, struct Process *proc)
Petr Machata02648a12012-02-07 13:44:54 +0100362{
Petr Machata52dbfb12012-03-29 16:38:26 +0200363 struct entry_breakpoint *bp = (void *)a;
Petr Machata02648a12012-02-07 13:44:54 +0100364 if (proc == NULL || proc->leader == NULL)
365 return;
Petr Machata5ee36822012-04-19 17:01:51 +0200366 target_address_t dyn_addr = bp->dyn_addr;
Petr Machata3fd099b2012-04-03 02:25:42 +0200367 delete_breakpoint(proc, bp->super.addr);
Petr Machata5ee36822012-04-19 17:01:51 +0200368 linkmap_init(proc, dyn_addr);
Petr Machata93d95df2012-04-17 05:16:19 +0200369 arch_dynlink_done(proc);
Petr Machata52dbfb12012-03-29 16:38:26 +0200370}
371
372int
373entry_breakpoint_init(struct Process *proc,
Petr Machata9a04d0e2012-03-29 16:50:38 +0200374 struct entry_breakpoint *bp, target_address_t addr,
375 struct library *lib)
Petr Machata52dbfb12012-03-29 16:38:26 +0200376{
377 int err;
378 if ((err = breakpoint_init(&bp->super, proc, addr, NULL)) < 0)
379 return err;
380
381 static struct bp_callbacks entry_callbacks = {
Petr Machata12affff2012-03-29 18:33:03 +0200382 .on_hit = entry_breakpoint_on_hit,
Petr Machata52dbfb12012-03-29 16:38:26 +0200383 };
384 bp->super.cbs = &entry_callbacks;
Petr Machata9a04d0e2012-03-29 16:50:38 +0200385 bp->dyn_addr = lib->dyn_addr;
Petr Machata52dbfb12012-03-29 16:38:26 +0200386 return 0;
Petr Machata02648a12012-02-07 13:44:54 +0100387}
388
Petr Machata1974dbc2011-08-19 18:58:01 +0200389int
Petr Machata75934ad2012-04-14 02:28:03 +0200390breakpoints_init(Process *proc)
Petr Machatac7585b62011-07-08 22:58:12 +0200391{
Juan Cespedescd8976d2009-05-14 13:47:58 +0200392 debug(DEBUG_FUNCTION, "breakpoints_init(pid=%d)", proc->pid);
Petr Machata26627682011-07-08 18:15:32 +0200393
Petr Machata2b46cfc2012-02-18 11:17:29 +0100394 /* XXX breakpoint dictionary should be initialized
395 * outside. Here we just put in breakpoints. */
396 assert(proc->breakpoints != NULL);
397
398 /* Only the thread group leader should hold the breakpoints. */
Petr Machata9a5420c2011-07-09 11:21:23 +0200399 assert(proc->leader == proc);
400
Petr Machata807cdd82012-04-05 02:08:25 +0200401 /* N.B. the following used to be conditional on this, and
402 * maybe it still needs to be. */
403 assert(proc->filename != NULL);
404
405 struct library *lib = ltelf_read_main_binary(proc, proc->filename);
406 struct entry_breakpoint *entry_bp = NULL;
407 int bp_state = 0;
408 int result = -1;
409 switch (lib != NULL) {
410 fail:
Petr Machata807cdd82012-04-05 02:08:25 +0200411 switch (bp_state) {
412 case 2:
Petr Machataa2416362012-04-06 02:43:34 +0200413 proc_remove_library(proc, lib);
Petr Machata807cdd82012-04-05 02:08:25 +0200414 proc_remove_breakpoint(proc, &entry_bp->super);
415 case 1:
416 breakpoint_destroy(&entry_bp->super);
Petr Machata1974dbc2011-08-19 18:58:01 +0200417 }
Petr Machataa2416362012-04-06 02:43:34 +0200418 library_destroy(lib);
Petr Machata807cdd82012-04-05 02:08:25 +0200419 free(entry_bp);
420 case 0:
421 return result;
Petr Machata02648a12012-02-07 13:44:54 +0100422 }
423
Petr Machata807cdd82012-04-05 02:08:25 +0200424 entry_bp = malloc(sizeof(*entry_bp));
425 if (entry_bp == NULL
Petr Machata91c399c2012-05-15 12:17:51 +0200426 || (entry_breakpoint_init(proc, entry_bp,
427 lib->entry, lib)) < 0) {
428 fprintf(stderr,
429 "Couldn't initialize entry breakpoint for PID %d.\n"
430 "Some tracing events may be missed.\n", proc->pid);
431 free(entry_bp);
Petr Machata00928202012-04-07 01:14:24 +0200432
Petr Machata91c399c2012-05-15 12:17:51 +0200433 } else {
434 ++bp_state;
Petr Machata00928202012-04-07 01:14:24 +0200435
Petr Machata91c399c2012-05-15 12:17:51 +0200436 if ((result = proc_add_breakpoint(proc, &entry_bp->super)) < 0)
437 goto fail;
438 ++bp_state;
439
440 if ((result = breakpoint_turn_on(&entry_bp->super, proc)) < 0)
441 goto fail;
442 }
Petr Machataa2416362012-04-06 02:43:34 +0200443 proc_add_library(proc, lib);
444
Juan Cespedes7186e2a2003-01-31 19:56:34 +0100445 proc->callstack_depth = 0;
Petr Machata1974dbc2011-08-19 18:58:01 +0200446 return 0;
Juan Cespedes7186e2a2003-01-31 19:56:34 +0100447}