38 #ifdef ENABLE_XENSUPPORT
61 static int next_target_id = 1;
63 static int init_done = 0;
65 static GHashTable *target_id_tab = NULL;
66 static GHashTable *target_personality_tab = NULL;
67 static GHashTable *target_decoder_lib_tab = NULL;
75 target_id_tab = g_hash_table_new_full(g_direct_hash,g_direct_equal,
77 target_personality_tab = g_hash_table_new_full(g_str_hash,g_str_equal,
79 target_decoder_lib_tab = g_hash_table_new_full(g_str_hash,g_str_equal,
100 while (g_hash_table_size(target_id_tab) > 0) {
101 g_hash_table_iter_init(&iter,target_id_tab);
102 while (g_hash_table_iter_next(&iter,NULL,(gpointer)&t)) {
107 g_hash_table_destroy(target_id_tab);
108 target_id_tab = NULL;
114 g_hash_table_iter_init(&iter,target_personality_tab);
115 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
120 g_hash_table_destroy(target_personality_tab);
121 target_personality_tab = NULL;
129 static int cleaning = 0;
139 targets = g_hash_table_get_values(target_id_tab);
159 g_list_free(targets);
162 static sigset_t user_ignored,user_interrupt,user_exit;
163 static void (*user_sighandler)(
int signo,siginfo_t *siginfo,
void *x);
164 static int __target_global_interrupt = 0;
165 static siginfo_t __target_monitor_last_siginfo;
166 static struct sigaction __target_default_sigaction = {
168 .sa_flags = SA_SIGINFO,
170 static struct sigaction __target_default_sigaction_ign = {
171 .sa_handler = SIG_IGN,
175 static int handling = 0;
186 __target_monitor_last_siginfo = *siginfo;
188 memset(&__target_monitor_last_siginfo,0,
189 sizeof(__target_monitor_last_siginfo));
190 __target_monitor_last_siginfo.si_signo = signo;
194 user_sighandler(signo,siginfo,x);
196 if (sigismember(&user_interrupt,signo)) {
198 __target_global_interrupt = 1;
204 g_hash_table_iter_init(&iter,target_id_tab);
205 while (g_hash_table_iter_next(&iter,NULL,&vp)) {
206 target = (
struct target *)vp;
222 sigaction(signo,&__target_default_sigaction,NULL);
227 if (__target_global_interrupt) {
229 *last_siginfo = __target_monitor_last_siginfo;
232 return __target_global_interrupt;
236 __target_global_interrupt = 0;
240 (
void (*sighandler)(
int signo,siginfo_t *siginfo,
void *x)) {
244 sigemptyset(&ignored);
246 sigemptyset(&interrupt);
248 sigaddset(&exit,SIGHUP);
249 sigaddset(&exit,SIGINT);
250 sigaddset(&exit,SIGQUIT);
251 sigaddset(&exit,SIGILL);
252 sigaddset(&exit,SIGABRT);
253 sigaddset(&exit,SIGFPE);
254 sigaddset(&exit,SIGSEGV);
255 sigaddset(&exit,SIGPIPE);
256 sigaddset(&exit,SIGTERM);
257 sigaddset(&exit,SIGBUS);
258 sigaddset(&exit,SIGXCPU);
259 sigaddset(&exit,SIGXFSZ);
261 sigaddset(&ignored,SIGUSR1);
262 sigaddset(&ignored,SIGUSR2);
263 sigaddset(&ignored,SIGALRM);
271 void (*sighandler)(
int signo,siginfo_t *siginfo,
void *x)) {
278 if ((ignored && sigismember(ignored,SIGCHLD))
279 || (exit && sigismember(exit,SIGCHLD))) {
280 verror(
"cannot specify SIGCHLD in any mask");
288 sigemptyset(&user_ignored);
292 sigemptyset(&user_interrupt);
296 sigemptyset(&user_exit);
298 user_sighandler = sighandler;
300 for (i = 1; i < 32; ++
i) {
301 if ((i == SIGKILL || i == SIGSTOP)
302 && (sigismember(&user_ignored,i) || sigismember(&user_interrupt,i)
303 || sigismember(&user_exit,i))) {
304 vwarn(
"cannot catch, block, nor ignore SIGKILL nor SIGSTOP; ignoring!\n");
308 if (sigismember(&user_ignored,i))
309 sigaction(i,&__target_default_sigaction_ign,NULL);
310 else if (sigismember(&user_interrupt,i) || sigismember(&user_exit,i))
311 sigaction(i,&__target_default_sigaction,NULL);
322 __target_global_interrupt = 1;
336 return (
struct target *) \
337 g_hash_table_lookup(target_id_tab,(gpointer)(uintptr_t)
id);
362 #define TARGET_ARGP_BASE 0x333331
363 #define TARGET_ARGP_OVERLAY 0x333332
364 #define TARGET_ARGP_PERSONALITY 0x333333
365 #define TARGET_ARGP_PERSONALITY_LIB 0x333334
366 #define TARGET_ARGP_START_PAUSED 0x333335
368 #ifdef ENABLE_XENSUPPORT
369 #define __XEN_ARGP_TYPE ",xen"
371 #define __XEN_ARGP_TYPE
374 #define TARGET_ARGP_CORE_OPTS \
375 { "debug",'d',"LEVEL",0,"Set/increase the debugging level.",-3 }, \
376 { "log-flags",'l',"FLAG,FLAG,...",0,"Set the debugging flags",-3 }, \
377 { "warn",'w',"LEVEL",0,"Set/increase the warning level.",-3 }, \
378 { "target-type",'t',"TYPENAME",0, \
379 "Forcibly set the target type (ptrace" __XEN_ARGP_TYPE ",gdb,os-process,php).",-3 }, \
380 { "personality",TARGET_ARGP_PERSONALITY,"PERSONALITY",0, \
381 "Forcibly set the target personality (linux,process,php).",-3 }, \
382 { "personality-lib",TARGET_ARGP_PERSONALITY_LIB,"PERSONALITY_LIB_FILENAME",0, \
383 "Specify a shared library where the personality specified by --personality should be loaded from.",-3 }, \
384 { "start-paused",TARGET_ARGP_START_PAUSED,0,0,"Leave target paused after launch.",-3 }, \
385 { "stay-paused",'P',0,0,"Keep target paused at detach.",-3 }, \
386 { "soft-breakpoints",'s',0,0,"Force software breakpoints.",-3 }, \
387 { "debugfile-load-opts",'F',"LOAD-OPTS",0,"Add a set of debugfile load options.",-3 }, \
388 { "breakpoint-mode",'L',"STRICT-LEVEL",0,"Set/increase the breakpoint mode level.",-3 }, \
389 { "target-id",'i',"ID",0,"Specify a numeric ID for the target.",0 }, \
390 { "in-file",'I',"FILE",0,"Deliver contents of FILE to target on stdin (if avail).",-4 }, \
391 { "out-file",'O',"FILE",0,"Log stdout (if avail) to FILE.",-4 }, \
392 { "err-file",'E',"FILE",0,"Log stderr (if avail) to FILE.",-4 }, \
393 { "kill-on-close",'k',NULL,0,"Destroy target on close (SIGKILL).",-4 }, \
394 { "debugfile-root-prefix",'R',"DIR",0, \
395 "Set an alternate root prefix for debuginfo and binfile resolution.",0 }, \
396 { "active-probing",'a',"FLAG,FLAG,...",0, \
397 "A list of active probing flags to enable (disabled by default)" \
398 " (thread_entry thread_exit memory other)",0 }, \
399 { "read-only",'r',0,0, \
400 "Never write to the target (disables breakpoints; can only read)",0 }
405 "Specify an entire base target in a single argument. Any standard target option other than --base and --overlay may be used.",-3 },
407 "Specify an entire overlay target in a single argument. Your argument must be of the form [<base_target_id>:]<thread_name_or_id>:TARGET_OPTIONS",-3 },
417 int *argc,
char ***argv) {
419 char **backend_argv = NULL;
420 int backend_argc = 0;
430 verror(
"linux_userproc_spec_to_argv failed!\n");
434 #ifdef ENABLE_XENSUPPORT
437 verror(
"xen_vm_spec_to_argv failed!\n");
462 verror(
"gdb_spec_to_argv failed!\n");
519 av =
calloc(ac + 1,
sizeof(
char *));
527 av[j++] = strdup(arg0);
533 av[j++] = strdup(
"-t");
535 av[j++] = strdup(
"ptrace");
536 #ifdef ENABLE_XENSUPPORT
538 av[j++] = strdup(
"xen");
541 av[j++] = strdup(
"gdb");
543 av[j++] = strdup(
"os-process");
545 av[j++] = strdup(
"php");
547 av[j++] = strdup(
"UNKNOWN");
551 av[j++] = strdup(
"--start-paused");
554 av[j++] = strdup(
"--stay-paused");
557 av[j++] = strdup(
"-s");
560 av[j++] = strdup(
"-L");
562 snprintf(av[j],11,
"%d",spec->
bpmode);
566 av[j++] = strdup(
"-i");
572 av[j++] = strdup(
"-I");
573 av[j++] = strdup(spec->
infile);
576 av[j++] = strdup(
"-O");
577 av[j++] = strdup(spec->
outfile);
580 av[j++] = strdup(
"-E");
581 av[j++] = strdup(spec->
errfile);
584 av[j++] = strdup(
"-k");
587 av[j++] = strdup(
"--personality");
591 av[j++] = strdup(
"--personality-lib");
595 av[j++] = strdup(
"-R");
599 av[j++] = strdup(
"-a");
603 len +=
sizeof(
"thread_entry,");
605 len +=
sizeof(
"thread_exit,");
607 len +=
sizeof(
"memory,");
609 len +=
sizeof(
"other,");
612 len +=
sizeof(
"os_thread_entry,");
614 len +=
sizeof(
"os_thread_exit,");
616 len +=
sizeof(
"os_memory,");
618 len +=
sizeof(
"os_other,");
621 len +=
sizeof(
"process_thread_entry,");
623 len +=
sizeof(
"process_thread_exit,");
625 len +=
sizeof(
"process_memory,");
627 len +=
sizeof(
"process_other,");
630 len +=
sizeof(
"app_thread_entry,");
632 len +=
sizeof(
"app_thread_exit,");
634 len +=
sizeof(
"app_memory,");
636 len +=
sizeof(
"app_other,");
643 rc += snprintf(av[j] + rc,len - rc,
"%s",
"thread_entry,");
645 rc += snprintf(av[j] + rc,len - rc,
"%s",
"thread_exit,");
647 rc += snprintf(av[j] + rc,len - rc,
"%s",
"memory,");
649 rc += snprintf(av[j] + rc,len - rc,
"%s",
"other,");
652 rc += snprintf(av[j] + rc,len - rc,
"%s",
"os_thread_entry,");
654 rc += snprintf(av[j] + rc,len - rc,
"%s",
"os_thread_exit,");
656 rc += snprintf(av[j] + rc,len - rc,
"%s",
"os_memory,");
658 rc += snprintf(av[j] + rc,len - rc,
"%s",
"os_other,");
661 rc += snprintf(av[j] + rc,len - rc,
"%s",
"process_thread_entry,");
663 rc += snprintf(av[j] + rc,len - rc,
"%s",
"process_thread_exit,");
665 rc += snprintf(av[j] + rc,len - rc,
"%s",
"process_memory,");
667 rc += snprintf(av[j] + rc,len - rc,
"%s",
"process_other,");
670 rc += snprintf(av[j] + rc,len - rc,
"%s",
"app_thread_entry,");
672 rc += snprintf(av[j] + rc,len - rc,
"%s",
"app_thread_exit,");
674 rc += snprintf(av[j] + rc,len - rc,
"%s",
"app_memory,");
676 rc += snprintf(av[j] + rc,len - rc,
"%s",
"app_other,");
681 av[j++] = strdup(
"-r");
683 for (i = 0; i < backend_argc; ++
i)
684 av[j++] = backend_argv[i];
688 if (backend_argc > 0)
704 #ifdef ENABLE_XENSUPPORT
721 state->input)->driver_state;
724 static int __str2argvlist(
char *argptr,
struct array_list *argv_list) {
727 char *nargptr,*vargptr;
729 while (*argptr ==
' ')
737 while (*argptr !=
'\0') {
738 if (*argptr ==
'\\') {
757 else if (inquote && *argptr == quotechar) {
764 else if (*argptr ==
'\'' || *argptr ==
'"') {
770 else if (!inquote && *argptr ==
' ') {
771 *nargptr = *argptr =
'\0';
773 array_list_append(argv_list,vargptr);
794 array_list_append(argv_list,vargptr);
797 array_list_append(argv_list,NULL);
804 int argc,
char **argv,
814 struct argp_child target_argp_children[4];
819 struct argp target_argp = {
821 NULL,NULL,target_argp_children,NULL,NULL
827 struct argp_child target_argp_child[] = {
828 { &target_argp,0,
"Generic Target Options",0 },
837 memset(&tstate,0,
sizeof(tstate));
845 for (i = 0; i < argc; ++
i) {
846 if (strncmp(
"--",argv[i],2) == 0 && argv[i][2] ==
'\0') {
867 #ifdef ENABLE_XENSUPPORT
886 target_argp_children[tstate.
num_children].header = NULL;
890 driver_parser->children = target_argp_child;
892 retval = argp_parse(driver_parser,argc,argv,0,NULL,&tstate);
894 driver_parser->children = NULL;
897 retval = argp_parse(&target_argp,argc,argv,0,NULL,&tstate);
914 int argc,
char **argv,
917 GList **base_target_specs,
918 GList **overlay_target_specs) {
928 struct argp_child target_argp_children[4];
933 struct argp target_argp = {
935 NULL,NULL,target_argp_children,NULL,NULL
941 struct argp_child target_argp_child[] = {
942 { &target_argp,0,
"Generic Target Options",0 },
951 memset(&tstate,0,
sizeof(tstate));
959 for (i = 0; i < argc; ++
i) {
960 if (strncmp(
"--",argv[i],2) == 0 && argv[i][2] ==
'\0') {
981 #ifdef ENABLE_XENSUPPORT
1000 target_argp_children[tstate.
num_children].header = NULL;
1003 if (driver_parser) {
1004 driver_parser->children = target_argp_child;
1006 retval = argp_parse(driver_parser,argc,argv,0,NULL,&tstate);
1008 driver_parser->children = NULL;
1011 retval = argp_parse(&target_argp,argc,argv,0,NULL,&tstate);
1014 if (tstate.
spec && !primary_target_spec) {
1015 verror(
"primary target specification supplied, but not allowed!\n");
1021 if (base_target_specs && *base_target_specs) {
1027 g_list_free(*base_target_specs);
1028 *base_target_specs = NULL;
1031 if (overlay_target_specs && *overlay_target_specs) {
1037 g_list_free(*overlay_target_specs);
1038 *overlay_target_specs = NULL;
1051 *primary_target_spec = tstate.
spec;
1058 state->child_inputs[0] = state->input;
1073 char *argptr,*argptr2;
1074 char *base_thread_name_or_id;
1075 int base_target_id = -1;
1084 return ARGP_ERR_UNKNOWN;
1087 state->child_inputs[
i] = tstate;
1090 case ARGP_KEY_NO_ARGS:
1091 case ARGP_KEY_SUCCESS:
1092 case ARGP_KEY_ERROR:
1103 tstate->
spec = NULL;
1106 verror(
"you must specify at least one kind of target!\n");
1116 if (strcmp(arg,
"ptrace") == 0)
1118 #ifdef ENABLE_XENSUPPORT
1119 else if (strcmp(arg,
"xen") == 0)
1122 else if (strcmp(arg,
"os-process") == 0)
1124 else if (strcmp(arg,
"php") == 0)
1126 else if (strcmp(arg,
"gdb") == 0)
1129 verror(
"bad target type %s!\n",arg);
1135 verror(
"target type already inferred or set; cannot set type %s!\n",
1143 #ifdef ENABLE_XENSUPPORT
1144 else if (strcmp(arg,
"xen") == 0)
1147 else if (strcmp(arg,
"os-process") == 0)
1149 else if (strcmp(arg,
"php") == 0)
1161 while (*arg ==
'd') {
1177 while (*arg ==
'w') {
1190 verror(
"bad log level flag in '%s'!\n",arg);
1199 argcopy = strdup(arg);
1204 verror(
"bad debugfile_load_opts '%s'!\n",argcopy);
1257 argcopy = strdup(arg);
1259 while ((token = strtok_r((!saveptr) ? argcopy : NULL,
",",&saveptr))) {
1260 if (strncmp(token,
"os_",2) == 0) {
1264 else if (strncmp(token,
"process_",8) == 0) {
1268 else if (strncmp(token,
"proc_",5) == 0) {
1272 else if (strncmp(token,
"app_",4) == 0) {
1279 if (strcmp(
"thread_entry",token) == 0)
1281 else if (strcmp(
"thread_exit",token) == 0)
1283 else if (strcmp(
"memory",token) == 0)
1285 else if (strcmp(
"other",token) == 0)
1288 verror(
"unrecognized active probe flag '%s'!\n",token);
1298 verror(
"program does not support extra base target specs!\n");
1302 argcopy = strdup(arg);
1304 argv_list = array_list_create(32);
1305 array_list_append(argv_list,
"target_argp_base_parse_one");
1307 __str2argvlist(argcopy,argv_list);
1310 array_list_len(argv_list) - 1,
1311 (
char **)argv_list->
list,
1314 verror(
"could not parse base spec %d!\n",
1317 array_list_free(argv_list);
1321 bspec->spec_was_base = 1;
1327 array_list_free(argv_list);
1331 verror(
"program does not support extra overlay target specs!\n");
1341 argcopy = strdup(arg);
1342 argptr = index(argcopy,
':');
1344 verror(
"bad overlay spec!\n");
1348 argv_list = array_list_create(32);
1349 array_list_append(argv_list,
"target_argp_overlay_parse_one");
1351 base_thread_name_or_id = argcopy;
1355 argptr2 = index(argptr,
':');
1357 base_target_id = atoi(base_thread_name_or_id);
1358 base_thread_name_or_id = argptr;
1363 __str2argvlist(argptr,argv_list);
1366 array_list_len(argv_list) - 1,
1367 (
char **)argv_list->
list,
1370 verror(
"could not parse overlay spec %d!\n",
1373 array_list_free(argv_list);
1378 if (isdigit(*base_thread_name_or_id)) {
1392 array_list_free(argv_list);
1396 return ARGP_ERR_UNKNOWN;
1411 if (g_hash_table_lookup_extended(target->
gkv_store,key,NULL,NULL) == TRUE) {
1416 gkvi =
calloc(1,
sizeof(*gkvi));
1420 g_hash_table_insert(target->
gkv_store,strdup(key),gkvi);
1429 g_hash_table_lookup(target->
gkv_store,key))) {
1441 if (g_hash_table_lookup_extended(target->
gkv_store,key,
1442 NULL,&rval) == FALSE) {
1447 g_hash_table_remove(target->
gkv_store,key);
1448 value = gkvi->
value;
1458 if (g_hash_table_lookup_extended(target->
gkv_store,key,
1459 NULL,&rval) == FALSE) {
1464 g_hash_table_remove(target->
gkv_store,key);
1473 GHashTableIter iter;
1481 g_hash_table_iter_init(&iter,target->
gkv_store);
1482 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
1490 g_hash_table_iter_steal(&iter);
1497 g_hash_table_destroy(target->
gkv_store);
1508 char *key,
void *
value,
1516 verror(
"could not lookup thread %"PRIiTID"; forgot to load?\n",tid);
1520 if (g_hash_table_lookup_extended(tthread->
gkv_store,key,NULL,NULL) == TRUE) {
1525 gkvi =
calloc(1,
sizeof(*gkvi));
1526 gkvi->
value = value;
1530 g_hash_table_insert(tthread->
gkv_store,strdup(key),gkvi);
1542 verror(
"could not lookup thread %"PRIiTID"; forgot to load?\n",tid);
1547 g_hash_table_lookup(tthread->
gkv_store,key))) {
1563 verror(
"could not lookup thread %"PRIiTID"; forgot to load?\n",tid);
1567 if (g_hash_table_lookup_extended(tthread->
gkv_store,key,
1568 NULL,&rval) == FALSE) {
1573 g_hash_table_remove(tthread->
gkv_store,key);
1574 value = gkvi->
value;
1588 verror(
"could not lookup thread %"PRIiTID"; forgot to load?\n",tid);
1592 if (g_hash_table_lookup_extended(tthread->
gkv_store,key,
1593 NULL,&rval) == FALSE) {
1598 g_hash_table_remove(tthread->
gkv_store,key);
1608 GHashTableIter iter;
1616 g_hash_table_iter_init(&iter,tthread->
gkv_store);
1617 while (g_hash_table_iter_next(&iter,&kp,&vp)) {
1625 g_hash_table_iter_steal(&iter);
1632 g_hash_table_destroy(tthread->
gkv_store);
1642 GHashTableIter iter;
1643 struct target *overlay;
1655 verror(
"cannot free (%d refs) target %s\n",
1660 vwarn(
"forcing free (%d refs) target %s\n",
1675 "target(%s) not closed; closing first!\n",target->
name);
1688 while (g_hash_table_size(target->
overlays) > 0) {
1689 g_hash_table_iter_init(&iter,target->
overlays);
1690 g_hash_table_iter_next(&iter,NULL,(gpointer)&overlay);
1692 tmpname = strdup(overlay->name);
1694 "detaching overlay target(%s)\n",tmpname);
1697 "detached overlay target(%s)\n",tmpname);
1700 g_hash_table_destroy(target->
overlays);
1711 RPUTW(target->
base,target,target,trefcnt);
1712 target->
base = NULL;
1739 list = g_hash_table_get_values(target->
actions);
1745 g_hash_table_destroy(target->
actions);
1748 list = g_hash_table_get_values(target->
probes);
1753 g_hash_table_destroy(target->
probes);
1761 g_hash_table_destroy(target->
mmods);
1762 target->
mmods = NULL;
1772 list = g_hash_table_get_values(target->
threads);
1781 list = g_hash_table_get_values(target->
decoders);
1786 g_hash_table_destroy(target->
decoders);
1793 g_list_free(target->
spaces);
1804 verror(
"fini target(%s) (personality) failed; continuing anyway!!\n",
1817 verror(
"cannot free (%d wrefs) target %s\n",
1822 vwarn(
"forcing free (%d wrefs) target %s\n",
1828 if ((rc = target->
ops->
fini(target))) {
1829 verror(
"fini target(%s) failed; continuing anyway!\n",target->
name);
1834 g_hash_table_destroy(target->
threads);
1837 g_hash_table_destroy(target->
config);
1848 target->
name = NULL;
1861 #ifdef ENABLE_XENSUPPORT
1881 verror(
"could not find target_ops for target type %d!\n",
1887 retval =
calloc(1,
sizeof(*retval));
1890 retval->
id = next_target_id++;
1893 && g_hash_table_lookup(target_id_tab,
1894 (gpointer)(uintptr_t)spec->
target_id)) {
1908 retval->
decoders = g_hash_table_new_full(g_str_hash,g_str_equal,NULL,NULL);
1912 retval->
config = g_hash_table_new_full(g_str_hash,g_str_equal,
free,
free);
1915 retval->
gkv_store = g_hash_table_new_full(g_str_hash,g_str_equal,
free,NULL);
1919 retval->
overlays = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1921 retval->
overlay_aliases = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1924 retval->
threads = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1928 retval->
actions = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1930 retval->
probes = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1935 retval->
soft_probepoints = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1938 retval->
mmods = g_hash_table_new_full(g_direct_hash,g_direct_equal,NULL,NULL);
1940 retval->
phys_mmods = g_hash_table_new_full(g_direct_hash,g_direct_equal,
1946 if (target_id_tab) {
1947 g_hash_table_insert(target_id_tab,
1948 (gpointer)(uintptr_t)retval->
id,retval);
1949 RHOLD(retval,target_id_tab);
1964 RPUTW(target->
base,target,target,trefcnt);
1965 target->
base = NULL;
1973 if (!target_id_tab) {
1978 if (g_hash_table_lookup(target_id_tab,(gpointer)(uintptr_t)target->
id)
1984 g_hash_table_remove(target_id_tab,(gpointer)(uintptr_t)target->
id);
1985 RPUT(target,target,target_id_tab,trefcnt);
1999 verror(
"debugfile(%s) already in use in region(%s) in space (%s:0x%"PRIxADDR")!\n",
2005 RHOLD(debugfile,region);
2010 "loaded and associated debugfile(%s) for region(%s,"
2012 " in space (%s:0x%PRIxADDR)\n",
2024 GHashTableIter iter;
2033 "trying to find debugfile for address 0x%"PRIxADDR"\n",addr);
2045 g_hash_table_iter_init(&iter,region->
debugfiles);
2046 while (g_hash_table_iter_next(&iter,
2047 (gpointer)&key,(gpointer)&debugfile))
2059 GHashTableIter iter, iter2;
2078 g_hash_table_iter_init(&iter,region->
debugfiles);
2079 while (g_hash_table_iter_next(&iter,NULL,&value)) {
2080 g_hash_table_iter_init(&iter2,((
struct debugfile *)value)->srcfiles);
2081 while (g_hash_table_iter_next(&iter2,NULL,(gpointer *)&root)) {
2097 GHashTableIter iter;
2105 "trying to find symbol at address 0x%"PRIxADDR"\n",
2118 g_hash_table_iter_init(&iter,region->
debugfiles);
2119 while (g_hash_table_iter_next(&iter,
2120 (gpointer)&key,(gpointer)&debugfile)) {
2127 RHOLD(bsymbol,bsymbol);
2139 GHashTableIter iter;
2143 struct lsymbol *primary_ls,*alt_ls;
2151 "trying to find symbol at address 0x%"PRIxADDR"\n",
2164 g_hash_table_iter_init(&iter,region->
debugfiles);
2165 while (g_hash_table_iter_next(&iter,
2166 (gpointer)&key,(gpointer)&debugfile)) {
2167 primary_ls = alt_ls = NULL;
2171 (primary) ? &primary_ls : NULL,
2172 (alt) ? &alt_ls : NULL))
2180 RHOLD(bsymbol,bsymbol);
2189 RHOLD(bsymbol,bsymbol);
2200 const char *name,
const char *delim,
2208 GHashTableIter iter;
2222 g_hash_table_iter_init(&iter,region->
debugfiles);
2223 while (g_hash_table_iter_next(&iter,(gpointer)&key,
2224 (gpointer)&debugfile)) {
2241 RHOLD(bsymbol,bsymbol);
2250 const char *name,
const char *delim) {
2251 struct bsymbol *bsymbol_new;
2262 RHOLD(bsymbol_new,bsymbol_new);
2268 char *filename,
int line,
2276 GHashTableIter iter;
2286 g_hash_table_iter_init(&iter,region->
debugfiles);
2287 while (g_hash_table_iter_next(&iter,(gpointer)&key,
2288 (gpointer)&debugfile)) {
2300 if (taddr == 0 && errno) {
2311 RHOLD(bsymbol,bsymbol);
2324 GHashTableIter iter;
2334 "trying to find line for address 0x%"PRIxADDR"\n",
2347 g_hash_table_iter_init(&iter,region->
debugfiles);
2348 while (g_hash_table_iter_next(&iter,
2349 (gpointer)&key,(gpointer)&debugfile)) {
2360 ADDR addr,
char **filename,
int *line) {
2363 GHashTableIter iter;
2374 "trying to find line for address 0x%"PRIxADDR"\n",
2387 g_hash_table_iter_init(&iter,region->
debugfiles);
2388 while (g_hash_table_iter_next(&iter,
2389 (gpointer)&key,(gpointer)&debugfile)) {
2410 verror(
"must supply a context (tid,region) for raw symbol resolution!\n");
2415 start,end,is_noncontiguous,alt_start,alt_end);
2425 verror(
"must supply a context (tid,region) for raw lsymbol resolution!\n");
2430 start,end,is_noncontiguous,alt_start,alt_end);
2440 verror(
"must supply a context (tid,region) for bsymbol resolution!\n");
2445 start,end,is_noncontiguous,alt_start,alt_end);
2458 struct symbol **o_datatype,
2471 verror(
"must supply a context (tid,region) for raw lsymbol resolution!\n");
2477 memset(&tloc,0,
sizeof(tloc));
2484 " for symbol %s: %s!\n",
2492 "failed to resolve location type %s (%d)!\n",LOCTYPE(-rc),rc);
2496 symbol = lsymbol_last_symbol(lsymbol);
2520 " resolved to: %s!\n",
2528 "could not find memory for 0x%"PRIxADDR
2529 " for symbol %s: %s!\n",
2535 "ptr var (in reg) %s = 0x%"PRIxADDR"\n",
2550 verror(
"unexpected implicit value instead of pointer!\n");
2556 flags,&datatype,&range);
2558 verror(
"could not load pointer for symbol %s\n",
2564 "autoloaded pointer(s) for var %s = 0x%"PRIxADDR"\n",
2570 "could not find memory for 0x%"PRIxADDR
2571 " for symbol %s: %s!\n",
2577 verror(
"unexpected location type %s for pointer!\n",
2591 *o_datatype = datatype;
2597 *o_datatype = datatype;
2603 *o_datatype = datatype;
2628 verror(
"must supply a context (tid,region) for bsymbol resolution!\n");
2632 memset(&tloc,0,
sizeof(tloc));
2637 "could not resolve base for symbol %s: %s (%d)\n",
2663 verror(
"symbol %s is not a full type (is %s)!\n",
2669 if (datatype != type)
2689 verror(
"failed to autoload pointers for type %s at addr 0x%"PRIxADDR"\n",
2695 verror(
"last pointer was NULL!\n");
2713 verror(
"could not create value: %s\n",strerror(errno));
2720 verror(
"failed to autoload char * for type %s at addr 0x%"PRIxADDR"\n",
2728 "autoloaded char * with len %d\n",value->
bufsiz);
2736 verror(
"could not create value for type (ptr is %p) %s\n",
2737 datatype,datatype ? datatype->
name : NULL);
2742 (
unsigned char *)value->
buf,
2775 verror(
"could not lookup thread %"PRIiTID"; forgot to load?\n",tid);
2782 verror(
"symbol %s is not a full type (is %s)!\n",
2788 if (datatype != type)
2815 verror(
"failed to autoload pointers for type %s"
2822 verror(
"last pointer was NULL!\n");
2841 && (flags & LOAD_FLAG_AUTO_STRING)
2846 verror(
"could not create value: %s\n",strerror(errno));
2850 if (!(value->
buf = (
char *) \
2852 verror(
"failed to autoload char * for type %s"
2853 " at regval ptr addr 0x%"PRIxADDR"\n",
2861 "autoloaded char * with len %d\n",value->
bufsiz);
2869 verror(
"could not create value for type (ptr is %p) %s\n",
2870 datatype,datatype ? datatype->
name : NULL);
2875 (
unsigned char *)value->
buf,
2886 verror(
"could not create value for type (ptr is %p) %s\n",
2887 datatype,datatype ? datatype->
name : NULL);
2895 memcpy(value->
buf,®val,sz);
2923 const char *member,
const char *delim,
2925 struct bsymbol *bmember;
2926 struct value *retval = NULL;
2930 verror(
"could not find member '%s' in symbol %s!\n",
2944 struct value *old_value,
2945 const char *member,
const char *delim,
2949 struct symbol *tdatatype;
2965 tthread = old_value->
thread;
2971 "looking up '%s' in type ",member);
2974 " (skipping to type ");
2977 memset(&tloc,0,
sizeof(tloc));
2996 oldaddr =
v_addr(old_value);
2999 "datatype is ptr; skipping to real type ");
3002 " starting at addr 0x%"PRIxADDR"\n",oldaddr);
3005 oldaddr = old_value->
res.
addr;
3008 "datatype is not ptr; starting at addr 0x%"PRIxADDR"\n",
3013 vwarn(
"symbol %s: not a full struct/union/class type (is %s)!\n",
3028 symbol = lsymbol_last_symbol(ls);
3041 "symbol %s: loaded const value len %d\n",
3060 flags,&tloc,&datatype,&range);
3079 verror(
"symbol %s: could not create value: %s\n",
3088 "symbol %s: failed to autostring char pointer\n",
3098 "symbol %s: autoloaded char * value with len %d\n",
3113 else if (addr >= oldaddr
3114 && ((addr + newlen) - oldaddr) < (
unsigned)old_value->
bufsiz) {
3118 verror(
"symbol %s: could not create value: %s\n",
3122 memcpy(value->
buf,old_value->
buf + (addr - oldaddr),
3127 "symbol %s: forced member value copy with len %d\n",
3133 verror(
"symbol %s: could not create value: %s\n",
3140 "symbol %s: loaded member value as child with len %d\n",
3149 verror(
"symbol %s: could not create value: %s\n",
3155 (
unsigned char *)value->
buf,
3158 "symbol %s: failed to load value at 0x%"PRIxADDR"\n",
3168 "symbol %s: loaded value with len %d\n",
3178 verror(
"symbol %s: could not read reg %d value in tid %"PRIiTID"\n",
3192 else if (__WORDSIZE == 32)
3201 verror(
"symbol %s: could not create value: %s\n",
3221 else if (__WORDSIZE == 32)
3230 verror(
"symbol %s: could not create value: %s\n",
3241 "symbol %s: failed to compute location (%d %s)\n",
3246 verror(
"symbol %s: computed location not register nor address (%d)"
3282 struct symbol *tdatatype;
3291 verror(
"must supply a context (tid,region) for bsymbol load!\n");
3294 tthread = tlctxt->
thread;
3298 symbol = lsymbol_last_symbol(lsymbol);
3301 verror(
"symbol %s is not a variable (is %s)!\n",
3321 "symbol %s: loaded const value len %d\n",
3334 memset(&tloc,0,
sizeof(tloc));
3336 flags,&tloc,&datatype,&range);
3350 verror(
"symbol %s: could not create value: %s\n",
3359 "symbol %s: failed to autostring char pointer\n",
3369 "symbol %s: autoloaded char * value with len %d\n",
3375 verror(
"symbol %s: could not create value: %s\n",
3381 (
unsigned char *)value->
buf,
3384 "symbol %s: failed to load value at 0x%"PRIxADDR"\n",
3394 "symbol %s: loaded value with len %d\n",
3404 "symbol %s: could not read reg %d value in tid %"PRIiTID"\n",
3418 else if (__WORDSIZE == 32)
3427 verror(
"symbol %s: could not create value: %s\n",
3448 else if (__WORDSIZE == 32)
3457 verror(
"symbol %s: could not create value: %s\n",
3467 verror(
"symbol %s: computed location not register nor address (%d)"
3486 char *member,
const char *delim) {
3505 memset(&tloc,0,
sizeof(tloc));
3507 flags,&tloc,NULL,o_range);
3509 verror(
"symbol %s: failed to compute location: %s (%d)\n",
3524 "symbol %s: computed location is register %"PRIiREG"\n",
3530 "symbol %s: computed location is implicit value 0x%"PRIxADDR"\n",
3535 verror(
"symbol %s: computed location not register nor address (%d)"
3550 verror(
"target %s not writeable!\n",target->
name);
3564 else if (value->
isreg) {
3569 (
unsigned long)value->
bufsiz,
3570 (
unsigned char *)value->
buf)
3571 != (
unsigned long)value->
bufsiz) {
3590 region_saveptr,range_saveptr)) {
3592 *space_saveptr = space;
3623 for (i = 0; i < count; ++
i ) {
3625 verror(
"failed to follow NULL pointer #%d\n",i);
3631 "loading ptr #%d at 0x%"PRIxADDR"\n",i,paddr);
3652 "loaded next ptr value 0x%"PRIxADDR" (#%d)\n",
3656 if (i == count && range) {
3658 *range_saveptr = range;
3670 struct symbol **datatype_saveptr,
3683 verror(
"failed to follow NULL pointer #%d\n",nptrs);
3689 "loading ptr at 0x%"PRIxADDR"\n",paddr);
3703 (
unsigned char *)&paddr,
3712 "loaded next ptr value 0x%"PRIxADDR" (#%d)\n",
3725 *range_saveptr = range;
3726 if (datatype_saveptr)
3727 *datatype_saveptr = datatype;
3764 verror(
"could not find range containing addr 0x%"PRIxADDR"!\n",addr);
3770 verror(
"could not create raw value of len %d for addr 0x%"PRIxADDR"!\n",
3776 (
unsigned char *)value->
buf,value->
bufsiz)) {
3792 verror(
"could not find range containing addr 0x%"PRIxADDR"!\n",addr);
3798 (
unsigned char *)buf,bufsiz);
3804 unsigned char *buf,
int bufsiz) {
3816 addr,bufsiz,range->
start,range->
end);
3900 #define CODE_CACHE_BUF_PAD 5
3911 int nocache,
int force_copy,
int *caller_free) {
3912 unsigned char *buf = NULL;
3913 unsigned int llen = 0;
3918 unsigned char *tbuf;
3925 while (llen < len) {
3946 if (!buf && (nextaddr + len) <= (ccd->
start + ccd->
len)) {
3948 return ccd->
code + (nextaddr - ccd->
start);
3959 tlen = ccd->
len - (nextaddr - ccd->
start);
3960 if ((len - llen) < tlen)
3963 memcpy(buf + llen,ccd->
code + (nextaddr - ccd->
start),tlen);
3974 verror(
"no safe disasm range contains 0x%"PRIxADDR"!\n",nextaddr);
3981 verror(
"could not load code in safe disasm range"
3987 verror(
"could not load even 1 byte of code in safe disasm range"
3988 " 0x%"PRIxADDR
",0x%"PRIxADDR
"!\n",cstart,cend);
3991 verror(
"BUT could load 1 byte of code in safe disasm range"
3992 " 0x%"PRIxADDR
",0x%"PRIxADDR
"!\n",cstart,cend);
3999 ccd->
start = cstart;
4000 ccd->
len = cend - cstart;
4026 (gpointer)(
ptr_t)tid);
4052 g_hash_table_lookup(target->
threads,(gpointer)(
ptr_t)tid);
4054 verror(
"could not set status for nonexistent tid %d -- BUG!\n",tid);
4064 void *tstate,
void *tpstate) {
4091 t->
gkv_store = g_hash_table_new_full(g_str_hash,g_str_equal,
free,NULL);
4098 g_hash_table_insert(target->
threads,(gpointer)(
ptr_t)tid,t);
4111 RHOLD(thread,target);
4116 GHashTableIter iter;
4138 while (g_hash_table_iter_next(&iter,NULL,(gpointer)&probepoint)) {
4154 g_hash_table_remove(target->
threads,(gpointer)(uintptr_t)tthread->
tid);
4199 if (target &&
OBJLIVE(tthread))
4258 if (target && tthread->
state) {
4264 tthread->
state = NULL;
4268 RPUTW(target,target,tthread,trefcnt);
4321 if (strncmp(tfr->
value_name,
"tidhier",strlen(
"tidhier")) == 0) {
4324 tmpthread = tthread;
4327 rc += snprintf(vstrbuf + rc,
sizeof(vstrbuf) - rc,
4330 rc += snprintf(vstrbuf + rc,
sizeof(vstrbuf) - rc,
4334 if (tmpthread->
ptid == -1)
4342 }
while (tmpthread);
4344 else if (strncmp(tfr->
value_name,
"tid",strlen(
"tid")) == 0) {
4345 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%"PRIiTID,tthread->
tid);
4347 else if (strncmp(tfr->
value_name,
"tgid",strlen(
"tgid")) == 0) {
4348 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%"PRIiTID,tthread->
tgid);
4350 else if (strncmp(tfr->
value_name,
"ptid",strlen(
"ptid")) == 0) {
4351 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%"PRIiTID,tthread->
ptid);
4353 else if (strncmp(tfr->
value_name,
"namehier",strlen(
"namehier")) == 0) {
4356 tmpthread = tthread;
4359 rc += snprintf(vstrbuf + rc,
sizeof(vstrbuf) - rc,
4360 ",%s",tmpthread->
name ? tmpthread->
name :
"");
4362 rc += snprintf(vstrbuf + rc,
sizeof(vstrbuf) - rc,
4363 "%s",tmpthread->
name ? tmpthread->
name :
"");
4366 if (tmpthread->
ptid == -1)
4374 }
while (tmpthread);
4376 else if (strncmp(tfr->
value_name,
"name",strlen(
"name")) == 0) {
4377 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%s",
4378 tthread->
name ? tthread->
name :
"");
4380 else if (strncmp(tfr->
value_name,
"uid",strlen(
"uid")) == 0) {
4381 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%d",tthread->
uid);
4383 else if (strncmp(tfr->
value_name,
"gid",strlen(
"gid")) == 0) {
4384 rc = snprintf(vstrbuf,
sizeof(vstrbuf),
"%d",tthread->
gid);
4387 vwarn(
"unrecognized thread filter key '%s'; skipping!\n",
4392 if (regexec(&tfr->
regex,(
const char *)vstrbuf,0,NULL,0) == REG_NOMATCH) {
4394 "failed to match name %s value '%s' with regex!\n",
4400 "matched name %s value '%s' with regex\n",
4436 static int __target_invalidate_all_threads(
struct target *
target) {
4437 GHashTableIter iter;
4441 g_hash_table_iter_init(&iter,target->
threads);
4442 while (g_hash_table_iter_next(&iter,NULL,(gpointer)&tthread)) {
4454 if (tthread->regcaches[i]) {
4462 vwarn(
"invalidated dirty thread %"PRIiTID"; BUG?\n",tthread->tid);
4469 GHashTableIter iter;
4470 struct target *overlay;
4474 "invalidating all target(%s) threads\n",target->
name);
4479 g_hash_table_iter_init(&iter,target->
overlays);
4480 while (g_hash_table_iter_next(&iter,NULL,(gpointer)&overlay)) {
4482 "invalidating all overlay target(%s) threads\n",overlay->name);
4485 "invalidating all overlay target(%s) threads (%d)\n",overlay->name,rc);
4488 return __target_invalidate_all_threads(target);
4498 struct target *overlay;
4500 overlay = (
struct target *) \
4501 g_hash_table_lookup(target->
overlays,(gpointer)(uintptr_t)tid);
4503 overlay = (
struct target *) \
4504 g_hash_table_lookup(target->
overlay_aliases,(gpointer)(uintptr_t)tid);
4510 GHashTableIter iter;
4511 struct target *overlay;
4515 overlay = (
struct target *) \
4516 g_hash_table_lookup(base->
overlays,(gpointer)(uintptr_t)overlaytid);
4517 g_hash_table_remove(base->
overlays,(gpointer)(uintptr_t)overlaytid);
4521 while (g_hash_table_iter_next(&iter,NULL,&vp)) {
4523 g_hash_table_iter_remove(&iter);
4526 RPUT(overlay,target,base,trefcnt);
4534 if (overlay->
base != base || newtid == overlay->
base_tid) {
4551 g_hash_table_insert(base->
overlay_aliases,(gpointer)(uintptr_t)newtid,
4594 if (((space->
name && strcmp(space->
name,lpc->
name) == 0)
4595 || (space->
name == NULL && lpc->
name == NULL))
4596 && space->
tag == lpc->
tag) {
4597 verror(
"addrspace(%s:0x%"PRIxADDR") already attached to target %s!\n",
4605 RHOLD(space,target);
4616 space->
name,space->
tag,target ? target->
name : NULL);
4621 t1 = g_list_find(target->
spaces,space);
4624 space->
name,space->
tag,target ? target->
name : NULL);
4629 target->
spaces = g_list_remove_link(target->
spaces,t1);
4656 "no probepoint at 0x%"PRIxADDR"\n",addr);
4666 (gpointer)probepoint->
addr,(gpointer)probepoint);
4667 probepoint->thread = tthread;
4671 (gpointer)probepoint->
addr,(gpointer)probepoint);
4672 probepoint->thread = tthread;
4675 verror(
"bad probepoint state %d; must be HW/SW!\n",probepoint->
state);
4682 probepoint->
addr,tthread->
tid);
4692 probepoint->
thread = NULL;
4696 probepoint->
thread = NULL;
4699 verror(
"bad probepoint state %d; must be HW/SW!\n",probepoint->
state);
4706 probepoint->
addr,tthread->
tid);
4718 g_hash_table_insert(target->
probes,(gpointer)(uintptr_t)probe->
id,probe);
4725 g_hash_table_remove(target->
probes,(gpointer)(uintptr_t)probe->
id);
4738 g_hash_table_insert(target->
actions,(gpointer)(uintptr_t)action->
id,action);
4744 g_hash_table_remove(target->
actions,(gpointer)(uintptr_t)action->
id);
4754 switch (mmod->
state) {
4771 unsigned char *code,
4772 unsigned int code_len,
int nowrite) {
4774 unsigned char *ibuf = NULL;
4775 unsigned int ibuf_len;
4781 verror(
"target %s not writeable!\n",target->
name);
4793 mmod =
calloc(1,
sizeof(*mmod));
4797 mmod->
threads = array_list_create(1);
4810 ibuf_len = code_len;
4813 ibuf =
calloc(1,ibuf_len);
4821 array_list_free(mmod->
threads);
4846 array_list_free(mmod->
threads);
4857 g_hash_table_insert(target->
phys_mmods,(gpointer)addr,mmod);
4859 g_hash_table_insert(target->
mmods,(gpointer)addr,mmod);
4861 array_list_append(mmod->
threads,tthread);
4865 "created memmod at 0x%"PRIxADDR" (is_phys=%d,no_write=%d) tid %"PRIiTID";"
4866 " inserted new bytes (orig mem: %02hhx %02hhx %02hhx %02hhx"
4867 " %02hhx %02hhx %02hhx %02hhx)\n",
4868 mmod->
addr,is_phys,nowrite,tid,
4869 (
int)ibuf[0],(
int)ibuf[1],(
int)ibuf[2],(
int)ibuf[3],
4870 (
int)ibuf[4],(
int)ibuf[5],(
int)ibuf[6],(
int)ibuf[7]);
4874 "created (fake) memmod at 0x%"PRIxADDR" (is_phys=%d) tid %"PRIiTID"\n",
4875 mmod->
addr,is_phys,tid);
4887 verror(
"target %s not writeable!\n",target->
name);
4917 g_hash_table_lookup(target->
mmods,(gpointer)
addr);
4921 "found mmod 0x%"PRIxADDR" (phys=%d)\n",
4951 if (array_list_remove_item(mmod->
threads,tthread) != tthread) {
4953 " BUG?!\n",tid,addr);
4963 if (array_list_len(mmod->
threads) == 0) {
4967 return array_list_len(mmod->
threads);
4975 unsigned long (*writer)(
struct target *target,
ADDR paddr,
4976 unsigned long length,
unsigned char *buf);
4983 retval = array_list_len(mmod->
threads);
4987 if (force || array_list_len(mmod->
threads) == 0) {
4989 g_hash_table_remove(target->
phys_mmods,(gpointer)addr);
4991 g_hash_table_remove(target->
mmods,(gpointer)addr);
5002 " but cannot do anything!\n",addr);
5011 array_list_free(mmod->
threads);
5026 unsigned long (*writer)(
struct target *target,
ADDR paddr,
5027 unsigned long length,
unsigned char *buf);
5050 switch (mmod->
state) {
5053 "(was already) memmod 0x%"PRIxADDR" (is_phys=%d)"
5062 rc = writer(target,addr,mmod->
mod_len,mmod->
mod);
5064 verror(
"could not insert subst memory at 0x%"PRIxADDR"!\n",addr);
5069 "(was orig) memmod 0x%"PRIxADDR" (is_phys=%d)"
5070 " tid %"PRIiTID
"\n",
5083 rc = writer(target,addr,mmod->
mod_len,mmod->
mod);
5085 verror(
"could not insert subst memory at 0x%"PRIxADDR"!\n",addr);
5090 "(was tmp) memmod 0x%"PRIxADDR" (is_phys=%d)"
5091 " tid %"PRIiTID
"\n",
5107 unsigned long (*writer)(
struct target *target,
ADDR paddr,
5108 unsigned long length,
unsigned char *buf);
5131 switch (mmod->
state) {
5134 "(was already) memmod 0x%"PRIxADDR" (is_phys=%d)"
5137 mmod->
owner = tthread;
5145 verror(
"could not restore orig memory at 0x%"PRIxADDR"!\n",addr);
5150 "(was set) memmod 0x%"PRIxADDR" (is_phys=%d)"
5151 " tid %"PRIiTID
"\n",
5153 mmod->
owner = tthread;
5166 verror(
"could not restore orig memory at 0x%"PRIxADDR"!\n",addr);
5170 mmod->
owner = tthread;
5181 unsigned char *code,
unsigned long code_len) {
5186 unsigned int new_len;
5187 unsigned long (*writer)(
struct target *target,
ADDR paddr,
5188 unsigned long length,
unsigned char *buf);
5223 verror(
"could not increase original saved bytes at 0x%"PRIxADDR"!\n",
5230 switch (mmod->
state) {
5232 if (code_len < mmod->tmp_len) {
5235 memcpy(
new,mmod->
orig,new_len);
5240 memcpy(
new,code,code_len);
5245 "(was tmp) memmod 0x%"PRIxADDR" (is_phys=%d)"
5250 if (code_len < mmod->mod_len) {
5253 memcpy(
new,mmod->
orig,new_len);
5258 memcpy(
new,code,code_len);
5261 "(was set) memmod 0x%"PRIxADDR" (is_phys=%d)"
5262 " tid %"PRIiTID
"\n",
5268 memcpy(
new,code,code_len);
5270 "(was orig) memmod 0x%"PRIxADDR" (is_phys=%d)"
5271 " tid %"PRIiTID
"\n",
5283 rc = writer(target,addr,new_len,
new);
5284 if (rc != new_len) {
5294 mmod->
owner = tthread;
5308 tlctxt =
calloc(1,
sizeof(*tlctxt));
5329 tlctxt =
calloc(1,
sizeof(*tlctxt));
5360 struct bsymbol *alt_bsymbol = NULL;
5382 verror(
"could not find symbol for IP addr 0x%"PRIxADDR"!\n",ipval);
5383 errno = EADDRNOTAVAIL;
5390 bsymbol ? bsymbol : alt_bsymbol);
5391 tlctxt->
frames = array_list_create(8);
5401 tlctxtf =
calloc(1,
sizeof(*tlctxtf));
5402 tlctxtf->
tlctxt = tlctxt;
5406 tlctxtf->
registers = g_hash_table_new(g_direct_hash,g_direct_equal);
5410 (gpointer)(uintptr_t)ipval);
5412 array_list_append(tlctxt->
frames,tlctxtf);
5418 struct target *target;
5423 struct bsymbol *alt_bsymbol = NULL;
5446 verror(
"could not find symbol for IP addr 0x%"PRIxADDR"!\n",ipval);
5447 errno = EADDRNOTAVAIL;
5454 tlctxt->
frames = array_list_create(8);
5464 tlctxtf =
calloc(1,
sizeof(*tlctxtf));
5465 tlctxtf->
tlctxt = tlctxt;
5469 tlctxtf->
registers = g_hash_table_new(g_direct_hash,g_direct_equal);
5473 (gpointer)(uintptr_t)ipval);
5475 array_list_append(tlctxt->
frames,tlctxtf);
5480 #define TARGET_UNW_CONSECUTIVE_IPADDR_LIMIT 8
5484 char *frame_sep,
char *ksep) {
5494 char *srcfile = NULL;
5501 char vbuf_static[1024];
5502 char *vbuf_dynamic = NULL;
5506 int consecutive_ipvals = 0;
5538 if (j > 0 && ipval == last_ipval)
5539 ++consecutive_ipvals;
5540 else if (ipval != last_ipval)
5541 consecutive_ipvals = 0;
5545 "ipval 0x"PRIxADDR" same as previous frame; aborting!\n",
5564 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
"%s",frame_sep);
5567 "snprintf(frame_sep %d): %s\n",
5588 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
5592 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
5594 j,ksep,ipval,ksep,name,ksep);
5596 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
5598 j,ksep,ipval,ksep,name,ksep);
5616 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
"%s",ksep);
5619 "snprintf(ksep %d): %s\n",
5643 vbuf_static[0] =
'\0';
5649 tmpsiz = 2 + v->
bufsiz * 2 + 1;
5650 if (tmpsiz < (
int)
sizeof(vbuf_static))
5653 vbuf_dynamic =
malloc(tmpsiz);
5654 vbuf = vbuf_dynamic;
5657 snprintf(vbuf,tmpsiz,
"0x");
5658 for (k = 0; k < v->
bufsiz && k < tmpsiz; ++k) {
5659 snprintf(vbuf + 2 + 2 * k,tmpsiz - 2 - 2 * k,
5660 "%02hhx",v->
buf[k]);
5663 else if (vrc >= (
int)
sizeof(vbuf_static)) {
5664 vbuf_dynamic =
malloc(vrc + 1);
5665 vbuf = vbuf_dynamic;
5671 snprintf(vbuf,
sizeof(vbuf),
"?");
5675 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
"%s=%s",name,vbuf);
5677 retval = snprintf(buf + rc,((buflen - rc) > 0) ? buflen - rc : 0,
"%s",vbuf);
5680 vbuf_dynamic = NULL;
5704 retval = snprintf(buf + rc, ((buflen - rc) > 0) ? buflen - rc : 0,
5705 ") at %s:%d",srcfile,srcline);
5707 retval = snprintf(buf + rc, ((buflen - rc) > 0) ? buflen - rc : 0,
5708 ")%ssrcfile=%s%ssrcline=%d",
5709 ksep,srcfile,ksep,srcline);
5711 retval = snprintf(buf + rc, ((buflen - rc) > 0) ? buflen - rc : 0,
5713 ksep,srcfile,ksep,srcline);
5744 array_list_item(tlctxt->
frames,frame);
5789 if (g_hash_table_lookup_extended(tlctxtf->
registers,
5790 (gpointer)(uintptr_t)reg,NULL,&v) == TRUE) {
5816 ADDR current_ip = 0;
5819 struct bsymbol *alt_bsymbol = NULL;
5822 ADDR bp = 0,sp = 0,old_bp = 0,old_sp = 0;
5857 (
unsigned char *)tmp);
5862 sp + (pp - tmp),*(uint64_t *)pp);
5866 sp + (pp - tmp),(
ADDR)*(uint32_t *)pp);
5881 (
unsigned char *)tmp);
5904 "could not read retaddr in current_frame %d from symbol;"
5911 "no symbol in current frame; will try to infer retaddr"
5912 " and next symbol!\n");
5920 verror(
"target %s has no frame pointer register!\n",
5927 vwarn(
"could not read %%bp to manually unwind; halting!\n");
5934 (
unsigned char *)&old_bp);
5938 (
unsigned char *)&retaddr);
5946 bp,sp,retaddr,old_bp,old_sp);
5950 "retaddr of current frame %d is 0x%"PRIxADDR"\n",
5953 if (current_ip == 0 && retaddr == 0) {
5954 verror(
"aborting stack trace; two 0x0 retaddrs in a row!\n");
5962 &bsymbol,&alt_bsymbol);
5964 vwarn(
"could not find symbol for IP addr 0x%"PRIxADDR"!\n",retaddr);
5974 new =
calloc(1,
sizeof(*
new));
5976 new->frame = array_list_len(tlctxt->
frames);
5979 new->registers = g_hash_table_new(g_direct_hash,g_direct_equal);
5981 g_hash_table_insert(new->registers,
5983 (gpointer)(uintptr_t)retaddr);
5986 g_hash_table_insert(new->registers,
5987 (gpointer)(uintptr_t)rbp,
5988 (gpointer)(uintptr_t)old_bp);
5989 g_hash_table_insert(new->registers,
5990 (gpointer)(uintptr_t)rsp,
5991 (gpointer)(uintptr_t)old_sp);
5994 array_list_append(tlctxt->
frames,
new);
6005 "created new previous frame %d with IP 0x%"PRIxADDR"\n",
6015 unsigned int current_size;
6018 current_size = g_hash_table_size(target_personality_tab);
6024 lib = dlopen(filename,RTLD_NOW | RTLD_GLOBAL);
6026 verror(
"could not load '%s': %s (%s)\n",
6027 filename,dlerror(),strerror(errno));
6032 if (g_hash_table_size(target_personality_tab) == current_size) {
6033 vwarn(
"loaded library %s, but it did not add itself to the"
6034 " personality table! Duplicate personality ID?\n",filename);
6044 if (g_hash_table_lookup(target_personality_tab,(gpointer)personality)) {
6045 verror(
"Personality %s already registered; cannot register.\n",
6051 tpi =
calloc(1,
sizeof(*tpi));
6057 g_hash_table_insert(target_personality_tab,(gpointer)tpi->
personality,
6068 if (!target_personality_tab) {
6069 verror(
"Target library improperly initialized -- call target_init!\n");
6077 if (personality_lib) {
6079 vwarn(
"failed to load library '%s'; will try to find"
6080 " personality '%s' elsewhere!\n",personality_lib,personality);
6085 g_hash_table_lookup(target_personality_tab,(gpointer)
personality);
6088 else if (personality_lib) {
6089 vwarn(
"could not find personality '%s' after trying to load"
6090 " personality library '%s'\n",personality,personality_lib);
6102 bufsiz = strlen(personality) + strlen(
".so") + strlen(
"stackdb") + 1;
6104 snprintf(buf,bufsiz,
"%s.so",personality);
6107 g_hash_table_lookup(target_personality_tab,(gpointer)personality))) {
6112 vwarn(
"loaded library '%s', but it did not provide personality '%s'!\n",
6117 snprintf(buf,bufsiz,
"stackdb_%s.so",personality);
6120 g_hash_table_lookup(target_personality_tab,(gpointer)personality))) {
6125 vwarn(
"loaded library '%s', but it did not provide personality '%s'!\n",
6130 snprintf(buf,bufsiz,
"vmi_%s.so",personality);
6133 g_hash_table_lookup(target_personality_tab,(gpointer)personality))) {
6138 vwarn(
"loaded library '%s', but it did not provide personality '%s'!\n",
6144 verror(
"could not find personality '%s'!\n",personality);
6150 vwarn(
"Failed to attach personality '%s' on target %d!\n",
6151 personality,target->
id);
6159 "initialized personality '%s' for target %d!\n",
6160 personality,target->
id);
6170 unsigned int current_size;
6173 current_size = g_hash_table_size(target_decoder_lib_tab);
6179 lib = dlopen(filename,RTLD_NOW | RTLD_GLOBAL);
6181 verror(
"could not load '%s': %s (%s)\n",
6182 filename,dlerror(),strerror(errno));
6187 if (g_hash_table_size(target_decoder_lib_tab) == current_size) {
6188 vwarn(
"loaded library %s, but it did not add itself to the"
6189 " decoder_lib table! Duplicate decoder_lib ID?\n",filename);
6196 if (g_hash_table_lookup(target_decoder_lib_tab,(gpointer)lib->
name)) {
6197 verror(
"Decoder_Lib %s already registered; cannot register.\n",lib->
name);
6202 g_hash_table_insert(target_decoder_lib_tab,(gpointer)lib->
name,(gpointer)lib);
6207 char *decoder_lib_lib) {
6213 if (!target_decoder_lib_tab) {
6214 verror(
"Target library improperly initialized -- call target_init!\n");
6222 if (decoder_lib_lib) {
6224 vwarn(
"failed to load library '%s'; will try to find"
6225 " decoder_lib '%s' elsewhere!\n",decoder_lib_lib,decoder_lib);
6230 g_hash_table_lookup(target_decoder_lib_tab,(gpointer)decoder_lib);
6233 else if (decoder_lib_lib) {
6234 vwarn(
"could not find decoder_lib '%s' after trying to load"
6235 " decoder_lib library '%s'\n",decoder_lib,decoder_lib_lib);
6247 bufsiz = strlen(decoder_lib) + strlen(
".so") + strlen(
"stackdb") + 1;
6249 snprintf(buf,bufsiz,
"%s.so",decoder_lib);
6252 g_hash_table_lookup(target_decoder_lib_tab,(gpointer)decoder_lib))) {
6257 vwarn(
"loaded library '%s', but it did not provide decoder_lib '%s'!\n",
6262 snprintf(buf,bufsiz,
"stackdb_%s.so",decoder_lib);
6265 g_hash_table_lookup(target_decoder_lib_tab,(gpointer)decoder_lib))) {
6270 vwarn(
"loaded library '%s', but it did not provide decoder_lib '%s'!\n",
6275 snprintf(buf,bufsiz,
"vmi_%s.so",decoder_lib);
6278 g_hash_table_lookup(target_decoder_lib_tab,(gpointer)decoder_lib))) {
6283 vwarn(
"loaded library '%s', but it did not provide decoder_lib '%s'!\n",
6289 verror(
"could not find decoder_lib '%s'!\n",decoder_lib);
6297 vwarn(
"Failed to attach decoder_lib '%s' on target %d!\n",
6298 decoder_lib,target->
id);
6305 "initialized decoder_lib '%s' for target %d!\n",
6306 decoder_lib,target->
id);
6320 g_hash_table_new_full(g_str_hash,g_str_equal,NULL,NULL);
6344 "inserted decoder binding for symbol '%s' on decoder lib '%s' for target '%s'!\n",
6354 GHashTableIter iter;
6357 g_hash_table_iter_init(&iter,target->
decoders);
6358 while (g_hash_table_iter_next(&iter,NULL,(gpointer)&tdb)) {
6360 "looking up decoder binding for value (symbol '%s', type '%s')"
6361 " on decoder lib '%s' for target '%s'!\n",
6364 tdb->lib->name,target->
name);
6368 g_hash_table_lookup(tdb->symbol_name_decoders,tname);
6370 *decoder = tdecoder;
6371 *decoder_data = tdb->decoder_data;
6374 "found decoder binding for value (symbol '%s', type '%s')"
6375 " on decoder lib '%s' for target '%s'!\n",
6377 value->
type ? tname :
"",
6393 #define TARGET_REGCACHE_ALLOC(tctxt,errretval) \
6395 if (tctxt > target->max_thread_ctxt) { \
6396 verror("target %d only has max thread ctxt %d (%d specified)!\n", \
6397 target->id,target->max_thread_ctxt,tctxt); \
6401 tthread = target_load_thread(target,tid,0); \
6403 verror("target %d could not load thread %d!\n",target->id,tid); \
6405 return (errretval); \
6407 if (!tthread->regcaches[tctxt]) { \
6408 tthread->regcaches[tctxt] = regcache_create(target->arch); \
6410 regcache = tthread->regcaches[tctxt]; \
6413 #define TARGET_REGCACHE_ALLOC_NT(tctxt,errretval) \
6415 if (tctxt > target->max_thread_ctxt) { \
6416 verror("target %d only has max thread ctxt %d (%d specified)!\n", \
6417 target->id,target->max_thread_ctxt,tctxt); \
6421 if (!tthread->regcaches[tctxt]) { \
6422 tthread->regcaches[tctxt] = regcache_create(target->arch); \
6424 regcache = tthread->regcaches[tctxt]; \
6427 #define TARGET_REGCACHE_GET(tctxt,errretval) \
6429 if (tctxt > target->max_thread_ctxt) { \
6430 verror("target %d only has max thread ctxt %d (%d specified)!\n", \
6431 target->id,target->max_thread_ctxt,tctxt); \
6435 tthread = target_load_thread(target,tid,0); \
6437 verror("target %d could not load thread %d!\n",target->id,tid); \
6439 return (errretval); \
6441 if (!tthread->regcaches[tctxt]) { \
6442 verror("target %d could not load thread %d!\n",target->id,tid); \
6443 errno = EADDRNOTAVAIL; \
6444 return (errretval); \
6446 regcache = tthread->regcaches[tctxt]; \
6456 "target %d init reg %s in thid %d ctxt %d 0x%"PRIxREGVAL"\n",
6462 verror(
"target %d thread %d reg %d: could not init reg!\n",
6463 target->
id,tthread->
tid,reg);
6478 vwarn(
"failed -- target %d thid %d tctxt %d\n",target->
id,tid,tctxt);
6483 "target %d thid %d tctxt %d\n",target->
id,tid,tctxt);
6498 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6504 if (!(regcache = tthread->
regcaches[tctxt]))
6519 rawh(target,tthread,tctxt,i,(
void *)regcache->
values[i],
6522 regh(target,tthread,tctxt,i,regcache->
values[i],priv);
6535 verror(
"target %d could not load thread %d!\n",target->
id,tid);
6541 verror(
"target %d only has max thread ctxt %d (thid %d currently %d)!\n",
6548 "target %d reading reg %s in thid %d ctxt %d\n",
6553 "target %d could not load thread %d!\n",target->
id,tid);
6554 errno = EADDRNOTAVAIL;
6561 "target %d thread %d reg %d: could not read!\n",
6562 target->
id,tid,reg);
6576 verror(
"target %d could not load thread %d!\n",target->
id,tid);
6582 verror(
"target %d only has max thread ctxt %d (thid %d currently %d)!\n",
6589 "target %d reading reg %s in thid %d ctxt %d 0x%"PRIxREGVAL"\n",
6593 verror(
"target %d could not load thread %d!\n",target->
id,tid);
6594 errno = EADDRNOTAVAIL;
6600 verror(
"target %d thread %d reg %d: could not write!\n",
6601 target->
id,tid,reg);
6614 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6630 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6646 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6662 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6678 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6689 int detail,
char *sep,
char *kvsep,
int flags) {
6694 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6703 rc = snprintf(buf,bufsiz,
"%stctxt%s%d",sep,kvsep,tctxt);
6707 (rc >= bufsiz) ? NULL : buf + rc,
6708 (rc >= bufsiz) ? 0 : bufsiz - rc,
6709 detail,sep,kvsep,flags);
6720 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6738 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6756 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6774 struct target *target = sthread->
target;
6778 verror(
"target %d only has max thread ctxt %d (%d/%d specified)!\n",
6785 "copying thid %d ctxt %d to thid %d ctxt %d\n",
6786 sthread->
tid,stidctxt,dthread->
tid,dtidctxt);
6802 struct target *target = sthread->
target;
6806 verror(
"target %d only has max thread ctxt %d (%d/%d specified)!\n",
6821 struct target *target = dthread->
target;
6824 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6831 "copying regcache to thid %d ctxt %d\n",
6832 dthread->
tid,dtidctxt);
6843 struct target *target = sthread->
target;
6846 verror(
"target %d only has max thread ctxt %d (%d specified)!\n",
6853 "copying regcache to thid %d ctxt %d\n",
6854 sthread->
tid,stidctxt);
6874 "target %d copying in thid %d ctxt %d\n",
6875 target->
id,tid,tidctxt);
6893 "target %d reading reg %s in thid %d ctxt %d\n",
6899 verror(
"target %d thread %d reg %d ctxt %d: could not read!\n",
6900 target->
id,tid,reg,tidctxt);
6914 "target %d writing reg %s in thid %d ctxt %d 0x%"PRIxREGVAL"\n",
6920 verror(
"target %d thread %d reg %d ctxt %d: could not write!\n",
6921 target->
id,tid,reg,tidctxt);
6940 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
6952 NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,
6972 "unknown",
"heap",
"stack",
"vdso",
"vsyscall",
"anon",
"main",
"lib",
struct bsymbol * bsymbol_create(struct lsymbol *lsymbol, struct memregion *region)
#define LOCATION_ADDR(loc)
REFCNT target_thread_free(struct target_thread *tthread, int force)
struct value * target_load_symbol(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, load_flags_t flags)
int regcache_isdirty_reg_range(struct regcache *regcache, REG start, REG end)
#define RPUTW(x, objtype, hx, rc)
int memregion_contains_real(struct memregion *region, ADDR addr)
struct value * target_load_type(struct target *target, struct symbol *type, ADDR addr, load_flags_t flags)
char * THREAD_STATUS_STRINGS[]
int target_decoder_binding_add(struct target_decoder_binding *tdb, struct bsymbol *bsymbol, target_decoder_t dfn)
REGVAL target_regcache_readreg_tidctxt(struct target *target, tid_t tid, thread_ctxt_t tidctxt, REG reg)
OFFSET symbol_offsetof(struct symbol *symbol, const char *name, const char *delim)
struct array_list * threads
#define vwarnopt(level, area, flags, format,...)
struct value * value_create_noalloc(struct target_thread *thread, struct memrange *range, struct lsymbol *lsymbol, struct symbol *type)
int(* fini)(struct target *target)
int(* fini)(struct target *target)
GHashTable * regcache_copy_registers(struct regcache *regcache)
unsigned long target_memmod_length(struct target *target, struct target_memmod *mmod)
struct argp_option target_argp_opts_only_one[]
#define TARGET_ARGP_CORE_OPTS
void location_ctxt_free(struct location_ctxt *lctxt)
struct bsymbol * target_lookup_sym_line(struct target *target, char *filename, int line, SMOFFSET *offset, ADDR *addr)
void target_monitor_schedule_global_interrupt(void)
void regcache_mark_flushed(struct regcache *regcache)
struct lsymbol * debugfile_lookup_sym__int(struct debugfile *debugfile, char *name, const char *delim, struct rfilter *srcfile_filter, symbol_type_flag_t flags)
char * linux_userproc_argp_header
int value_snprintf(struct value *value, char *buf, int buflen)
struct lsymbol * lsymbol_lookup_sym__int(struct lsymbol *lsymbol, const char *name, const char *delim)
int target_decoder_lib_load(char *filename)
void value_set_strlen(struct value *value, int len)
target_status_t target_get_status(struct target *target)
struct argp_option target_argp_opts[]
int(* target_regcache_regval_handler_t)(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG reg, REGVAL regval, void *priv)
void target_default_sighandler(int signo, siginfo_t *siginfo, void *x)
int target_regcache_zero(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt)
struct array_list * frames
void * target_argp_driver_state(struct argp_state *state)
REFCNT lsymbol_release(struct lsymbol *lsymbol)
ADDR memregion_unrelocate(struct memregion *region, ADDR real_addr, struct memrange **range_saveptr)
GSList * symbol_get_ordered_members(struct symbol *symbol, symbol_type_flag_t flags)
struct lsymbol * debugfile_lookup_addr__int(struct debugfile *debugfile, ADDR addr)
int(* attach)(struct target *target)
#define TARGET_TYPE_MASK_BASE
REFCNT action_free(struct action *action, int force)
int target_insert_probepoint(struct target *target, struct target_thread *tthread, struct probepoint *probepoint)
struct value * target_load_type_reg(struct target *target, struct symbol *type, tid_t tid, REG reg, load_flags_t flags)
int target_unwind_snprintf(char *buf, int buflen, struct target *target, tid_t tid, target_unwind_style_t fstyle, char *frame_sep, char *ksep)
int regcache_init_done(struct regcache *regcache)
#define TARGET_ARGP_OVERLAY
int target_personality_register(char *personality, target_personality_t pt, struct target_personality_ops *ptops, void *pops)
void os_linux_generic_decoder_lib_register(void)
void target_thread_gkv_remove(struct target *target, tid_t tid, char *key)
struct memregion * region
#define TARGET_TYPE_MASK_OVERLAY
int gdb_spec_to_argv(struct target_spec *spec, int *argc, char ***argv)
struct target_location_ctxt * target_unwind(struct target *target, tid_t tid)
int addrspace_find_range_real(struct addrspace *space, ADDR addr, struct memregion **region_saveptr, struct memrange **range_saveptr)
int target_detach_probe(struct target *target, struct probe *probe)
int target_regcache_copy_all(struct target_thread *sthread, thread_ctxt_t stidctxt, struct target_thread *dthread, thread_ctxt_t dtidctxt)
struct scope * symbol_read_owned_scope(struct symbol *symbol)
int target_lsymbol_resolve_bounds(struct target *target, struct target_location_ctxt *tlctxt, struct lsymbol *lsymbol, ADDR base_addr, ADDR *start, ADDR *end, int *is_noncontiguous, ADDR *alt_start, ADDR *alt_end)
int regcache_write_reg(struct regcache *regcache, REG reg, REGVAL regval)
struct linux_userproc_spec * linux_userproc_build_spec(void)
int target_regcache_copy_dirty_to(struct target_thread *sthread, thread_ctxt_t stidctxt, struct regcache *dregcache)
struct target_location_ctxt_frame *(* unwind_prev)(struct target_location_ctxt *tlctxt)
GHashTable * soft_probepoints
static uint64_t unsigned int i
struct bsymbol * target_lookup_sym(struct target *target, const char *name, const char *delim, char *srcfile, symbol_type_flag_t ftype)
struct target_personality_ops * personality_ops
struct target_thread * owner
GHashTable * target_regcache_copy_registers(struct target *target, tid_t tid)
OFFSET target_offsetof_symbol(struct target *target, struct bsymbol *bsymbol, char *member, const char *delim)
GHashTable * symbol_name_decoders
int symbol_get_srcline(struct symbol *symbol)
struct probepoint * target_lookup_probepoint(struct target *target, struct target_thread *tthread, ADDR addr)
int target_bsymbol_resolve_base(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, ADDR *o_addr, struct memrange **o_range)
void vmi_inc_log_level(void)
#define v_g_slist_foreach(gslhead, gslcur, elm)
void location_internal_free(struct location *location)
#define v_g_list_foreach(glhead, glcur, elm)
struct target_location_ctxt * target_location_ctxt_create_from_bsymbol(struct target *target, tid_t tid, struct bsymbol *bsymbol)
unsigned int arch_regsize(struct arch *arch, REG reg)
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact)
ADDR target_addressof_symbol(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, load_flags_t flags, struct memrange **o_range)
struct target_ops gdb_ops
struct target_thread * base_thread
int target_regcache_copy_from(struct target_thread *dthread, thread_ctxt_t dtidctxt, struct regcache *sregcache)
struct os_process_spec * os_process_build_spec(void)
int target_regcache_init_done(struct target *target, tid_t tid, thread_ctxt_t tctxt)
struct target_location_ctxt * tlctxt
struct php_spec * php_build_spec(void)
int target_pause(struct target *target)
struct target_memmod * target_memmod_create(struct target *target, tid_t tid, ADDR addr, int is_phys, target_memmod_type_t mmt, unsigned char *code, unsigned int code_len, int nowrite)
int vmi_add_log_area_flaglist(char *flaglist, char *separator)
#define TARGET_ARGP_PERSONALITY_LIB
int lsymbol_resolve_bounds(struct lsymbol *lsymbol, ADDR base_addr, struct location_ctxt *lctxt, ADDR *start, ADDR *end, int *is_noncontiguous, ADDR *alt_start, ADDR *alt_end)
struct scope * target_lookup_addr(struct target *target, uint64_t addr)
int target_cregno(struct target *target, common_reg_t creg, REG *reg)
int(* unwind_read_reg)(struct target_location_ctxt *tlctxt, REG reg, REGVAL *o_regval)
int regcache_init_reg(struct regcache *regcache, REG reg, REGVAL regval)
int target_detach_space(struct target *target, struct addrspace *space)
struct target_thread * global_thread
struct regcache * target_regcache_get(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt)
struct target * target_create(char *type, struct target_spec *spec)
void * target_gkv_steal(struct target *target, char *key)
#define TARGET_REGCACHE_ALLOC_NT(tctxt, errretval)
target_memmod_state_t state
uint32_t symbol_get_bytesize(struct symbol *symbol)
struct debugfile * target_lookup_debugfile(struct target *target, ADDR addr)
int target_regcache_writereg_tidctxt(struct target *target, tid_t tid, thread_ctxt_t tidctxt, REG reg, REGVAL value)
char * bsymbol_get_name(struct bsymbol *bsymbol)
struct target_ops os_process_ops
int target_remove_probepoint(struct target *target, struct target_thread *tthread, struct probepoint *probepoint)
#define CODE_CACHE_BUF_PAD
int target_associate_debugfile(struct target *target, struct memregion *region, struct debugfile *debugfile)
int target_close(struct target *target)
struct bsymbol * alt_bsymbol
int target_detach_action(struct target *target, struct action *action)
ADDR target_autoload_pointers(struct target *target, struct symbol *datatype, ADDR addr, load_flags_t flags, struct symbol **datatype_saveptr, struct memrange **range_saveptr)
struct target_ops linux_userspace_process_ops
struct target_thread * thread
#define verror(format,...)
target_personality_t ptype
int target_install_default_sighandlers(void(*sighandler)(int signo, siginfo_t *siginfo, void *x))
struct target_memmod * mmod
unsigned char * __target_load_addr_real(struct target *target, struct memrange *range, ADDR addr, load_flags_t flags, unsigned char *buf, int bufsiz)
int target_decoder_lookup(struct target *target, struct value *value, target_decoder_t *decoder, void **decoder_data)
unsigned char * target_read_addr(struct target *target, ADDR addr, unsigned long length, unsigned char *buf)
int location_ctxt_read_retaddr(struct location_ctxt *lctxt, ADDR *o_retaddr)
int target_attach_space(struct target *target, struct addrspace *space)
int target_install_custom_sighandlers(sigset_t *ignored, sigset_t *interrupt, sigset_t *exit, void(*sighandler)(int signo, siginfo_t *siginfo, void *x))
char * symbol_get_srcfile(struct symbol *symbol)
struct symbol * symbol_get_datatype(struct symbol *symbol)
int target_find_memory_real(struct target *target, ADDR addr, struct addrspace **space_saveptr, struct memregion **region_saveptr, struct memrange **range_saveptr)
struct clf_range_data * clrange_find_loosest(clrange_t *clf, Word_t index, struct array_list **al_saveptr)
int linux_userproc_spec_to_argv(struct target_spec *spec, int *argc, char ***argv)
int regcache_copy_all(struct regcache *sregcache, struct regcache *dregcache)
#define LOGDUMPSYMBOL_NL(dl, lt, lf, s)
void probepoint_free_ext(struct probepoint *probepoint)
int location_ctxt_read_reg(struct location_ctxt *lctxt, REG reg, REGVAL *o_regval)
void target_detach_thread(struct target *target, struct target_thread *tthread)
int target_regcache_isdirty_reg(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG reg)
void target_location_ctxt_retarget_bsymbol(struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol)
int(* target_regcache_rawval_handler_t)(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG reg, void *rawval, int rawlen, void *priv)
int symbol_resolve_bounds(struct symbol *symbol, struct location_ctxt *lctxt, ADDR *start, ADDR *end, int *is_noncontiguous, ADDR *o_alt_start, ADDR *o_alt_end)
struct lsymbol * symbol_lookup_sym(struct symbol *symbol, const char *name, const char *delim)
int target_invalidate_thread(struct target *target, struct target_thread *tthread)
void vmi_set_log_level(int level)
int target_personality_attach(struct target *target, char *personality, char *personality_lib)
#define vwarn(format,...)
unsigned char * target_read_physaddr(struct target *target, ADDR paddr, unsigned long length, unsigned char *buf)
struct target_thread * thread
#define LOCATION_WORD(loc)
int location_set_implicit_word(struct location *loc, ADDR word)
int target_lookup_sym_addr_alt(struct target *target, ADDR addr, struct bsymbol **primary, struct bsymbol **alt)
int symbol_type_is_char(struct symbol *type)
REGVAL target_read_reg(struct target *target, tid_t tid, REG reg)
struct target_location_ctxt_frame * target_location_ctxt_get_frame(struct target_location_ctxt *tlctxt, int frame)
void regcache_invalidate(struct regcache *regcache)
int target_regcache_foreach_dirty(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, target_regcache_regval_handler_t regh, target_regcache_rawval_handler_t rawh, void *priv)
struct lsymbol * lsymbol_create_from_member(struct lsymbol *parent, struct symbol *member)
struct target_thread * target_load_thread(struct target *target, tid_t tid, int force)
void regcache_zero(struct regcache *regcache)
struct clf_range_data * clrange_find_next_loosest(clrange_t *clf, Word_t index, struct array_list **al_saveptr)
struct regcache ** regcaches
void(* target_gkv_dtor_t)(struct target *target, char *key, void *value)
int(* write_symbol)(struct target *target, struct value *value)
char * lsymbol_get_name(struct lsymbol *lsymbol)
int target_thread_gkv_insert(struct target *target, tid_t tid, char *key, void *value, target_thread_gkv_dtor_t dtor)
int target_bsymbol_resolve_bounds(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, ADDR base_addr, ADDR *start, ADDR *end, int *is_noncontiguous, ADDR *alt_start, ADDR *alt_end)
void target_monitor_clear_global_interrupt(void)
void target_default_cleanup()
struct xen_vm_spec * xen_vm_build_spec(void)
int location_set_reg(struct location *l, REG reg)
int regcache_read_reg_ifdirty(struct regcache *regcache, REG reg, REGVAL *regval)
REFCNT bsymbol_release(struct bsymbol *bsymbol)
struct target_thread * current_thread
datatype_code_t datatype_code
struct target_decoder_lib * lib
int target_argp_driver_parse(struct argp *driver_parser, void *driver_state, int argc, char **argv, target_type_t target_types, int filter_quoted, struct target_spec **primary_target_spec, GList **base_target_specs, GList **overlay_target_specs)
int target_monitor_was_interrupted(siginfo_t *last_siginfo)
struct value * value_create_raw(struct target *target, struct target_thread *thread, struct memrange *range, int len)
struct target_memmod * target_memmod_lookup(struct target *target, tid_t tid, ADDR addr, int is_phys)
void(* target_thread_gkv_dtor_t)(struct target *target, tid_t tid, char *key, void *value)
unsigned char * target_load_raw_addr_real(struct target *target, ADDR addr, load_flags_t flags, unsigned char *buf, int bufsiz)
int target_location_ctxt_read_reg(struct target_location_ctxt *tlctxt, REG reg, REGVAL *o_regval)
int probe_free(struct probe *probe, int force)
struct target_location_ctxt_frame * target_location_ctxt_prev(struct target_location_ctxt *tlctxt)
struct dt_argp_state opts
int target_attach_overlay_thread(struct target *base, struct target *overlay, tid_t newtid)
struct memrange * memregion_find_range_real(struct memregion *region, ADDR real_addr)
struct debugfile_load_opts * debugfile_load_opts_parse(char *optstr)
void target_free_spec(struct target_spec *spec)
target_memmod_type_t type
void(* free_thread_state)(struct target *target, void *state)
struct target_location_ctxt * global_tlctxt
int target_spec_to_argv(struct target_spec *spec, char *arg0, int *argc, char ***argv)
int value_set_child(struct value *value, struct value *parent_value, ADDR addr)
unsigned long target_write_physaddr(struct target *target, ADDR paddr, unsigned long length, unsigned char *buf)
int target_symbol_resolve_bounds(struct target *target, struct target_location_ctxt *tlctxt, struct symbol *symbol, ADDR *start, ADDR *end, int *is_noncontiguous, ADDR *alt_start, ADDR *alt_end)
#define SYMBOL_IST_PTR(sym)
int target_lookup_filename_line_addr(struct target *target, ADDR addr, char **filename, int *line)
const char * target_regname(struct target *target, REG reg)
#define TARGET_ARGP_PERSONALITY
int(* target_decoder_t)(struct target *target, void *data, struct value *value, char *buf, int buflen)
#define TARGET_ARGP_START_PAUSED
int target_memmod_unset(struct target *target, tid_t tid, struct target_memmod *mmod)
struct location_ctxt * location_ctxt_create(struct location_ops *ops, void *priv)
struct value * value_create_type(struct target_thread *thread, struct memrange *range, struct symbol *type)
void value_free(struct value *value)
int target_decoder_lib_bind(struct target *target, char *decoder_lib, char *decoder_lib_lib)
struct target_location_ctxt * target_global_tlctxt(struct target *target)
int target_regcache_copy_all_zero(struct target_thread *sthread, thread_ctxt_t stidctxt, struct target_thread *dthread, thread_ctxt_t dtidctxt)
struct target_spec * spec
void vmi_set_warn_level(int level)
#define TARGET_REGCACHE_GET(tctxt, errretval)
struct value * target_load_value_member(struct target *target, struct target_location_ctxt *tlctxt, struct value *old_value, const char *member, const char *delim, load_flags_t flags)
#define LOGDUMPPROBEPOINT_NL(dl, la, lt, p)
struct bsymbol * target_lookup_sym_addr(struct target *target, ADDR addr)
int target_gkv_insert(struct target *target, char *key, void *value, target_gkv_dtor_t dtor)
int target_location_ctxt_unwind(struct target_location_ctxt *tlctxt)
char * REGION_TYPE_STRINGS[]
#define SYMBOL_IST_STUNC(sym)
struct value * target_load_type_regval(struct target *target, struct symbol *type, tid_t tid, REG reg, REGVAL regval, load_flags_t flags)
void vmi_inc_warn_level(void)
error_t target_argp_parse_opt(int key, char *arg, struct argp_state *state)
int target_regcache_snprintf(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, char *buf, int bufsiz, int detail, char *sep, char *kvsep, int flags)
target_type_t target_type
int location_set_addr(struct location *l, ADDR addr)
int target_store_value(struct target *target, struct value *value)
struct target_thread * thread
ADDR target_load_pointers(struct target *target, ADDR addr, int count, struct memrange **range_saveptr)
struct target_ops php_ops
struct array_list * tpc_stack
#define v_g_list_foreach_safe(glhead, glcur, glnext, elm)
int value_set_addr(struct value *value, ADDR addr)
int target_attach_probe(struct target *target, struct target_thread *thread, struct probe *probe)
#define vdebug(devel, areas, flags, format,...)
int(* attach_overlay_thread)(struct target *base, struct target *overlay, tid_t newtid)
struct target_decoder_binding * target_decoder_binding_create(struct target_decoder_lib *lib, struct target *target)
ADDR memrange_unrelocate(struct memrange *range, ADDR real)
int target_regcache_readreg_ifdirty(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG reg, REGVAL *regval)
REFCNT target_free(struct target *target, int force)
ADDR v_addr(struct value *v)
void * realloc(void *ptr, size_t size)
struct thread_probepoint_context * tpc
struct symbol * symbol_type_skip_qualifiers(struct symbol *type)
int regcache_read_reg(struct regcache *regcache, REG reg, REGVAL *regval)
int(* unbind)(struct target_decoder_binding *tdb, void *decoder_data)
GList ** base_target_specs
int target_regcache_init_reg_tidctxt(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG reg, REGVAL regval)
int target_personality_load(char *filename)
GSList * value_regex_list
struct memregion * region
#define vdebugc(devel, areas, flags, format,...)
#define SYMBOL_IS_TYPE(sym)
struct target_ops * target_get_ops(target_type_t target_type)
struct target_location_ctxt_frame * target_location_ctxt_current_frame(struct target_location_ctxt *tlctxt)
#define TARGET_UNW_CONSECUTIVE_IPADDR_LIMIT
void target_detach_overlay(struct target *base, tid_t overlaytid)
void(* free_thread_state)(struct target *target, void *state)
struct value * value_create(struct target_thread *thread, struct memrange *range, struct lsymbol *lsymbol, struct symbol *type)
int target_detach_overlay_thread(struct target *base, struct target *overlay, tid_t tid)
void * calloc(size_t nmemb, size_t size)
struct target_personality_ops * ptops
struct array_list * debugfile_load_opts_list
int value_set_reg(struct value *value, REG reg)
int target_regcache_mark_flushed(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt)
unsigned int thread_ctxt_t
void target_thread_set_status(struct target_thread *tthread, thread_status_t status)
void target_decoder_binding_free(struct target_decoder_binding *tdb)
#define list_for_each_entry_safe(pos, n, head, member)
GHashTable * overlay_aliases
target_thread_gkv_dtor_t dtor
struct lsymbol * debugfile_lookup_sym_line__int(struct debugfile *debugfile, char *filename, int line, SMOFFSET *offset, ADDR *addr)
void regcache_destroy(struct regcache *regcache)
void * target_thread_gkv_lookup(struct target *target, tid_t tid, char *key)
#define THREAD_CTXT_DEFAULT
struct list_head ss_actions
REFCNT binfile_release(struct binfile *binfile)
int target_memmod_release(struct target *target, tid_t tid, struct target_memmod *mmod)
struct target * target_lookup_target_id(int id)
uint32_t needmonitorinterrupt
int target_attach_action(struct target *target, struct action *action)
unsigned int symbol_type_full_bytesize(struct symbol *type)
int target_invalidate_all_threads(struct target *target)
int(* invalidate_thread)(struct target *target, struct target_thread *tthread)
struct value * target_load_addr_obj(struct target *target, struct memregion *region, ADDR obj_addr, load_flags_t flags, int len)
struct location_ops target_location_ops
int memrange_contains_real(struct memrange *range, ADDR real_addr)
struct target_spec * target_build_spec(target_type_t type, target_mode_t mode)
struct target_ops xen_vm_ops
int target_regcache_isdirty(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt)
struct symbol * symbol_type_skip_ptrs(struct symbol *type)
int regcache_isdirty_reg(struct regcache *regcache, REG reg)
void target_reuse_thread_as_global(struct target *target, struct target_thread *thread)
#define TARGET_REGCACHE_ALLOC(tctxt, errretval)
int debugfile_lookup_line_addr(struct debugfile *debugfile, char *filename, ADDR addr)
struct lsymbol * bsymbol_get_lsymbol(struct bsymbol *bsymbol)
struct target_location_ctxt * target_location_ctxt_create(struct target *target, tid_t tid, struct memregion *region)
void target_thread_gkv_destroy(struct target *target, struct target_thread *tthread)
int target_finalize(struct target *target)
GList ** overlay_target_specs
GHashTable * hard_probepoints
struct symbol * bsymbol_get_symbol(struct bsymbol *bsymbol)
loctype_t lsymbol_resolve_location(struct lsymbol *lsymbol, ADDR base_addr, struct location_ctxt *lctxt, struct location *o_loc)
struct target * target_lookup_overlay(struct target *target, tid_t tid)
void * __personality_specific_ops
int target_memmod_set(struct target *target, tid_t tid, struct target_memmod *mmod)
struct value * target_load_addr_real(struct target *target, ADDR addr, load_flags_t flags, int len)
target_status_t target_notify_overlay(struct target *overlay, target_exception_flags_t flags, tid_t tid, ADDR ipval, int *again)
struct scope * scope_lookup_addr(struct scope *scope, ADDR pc)
int(* detach_overlay_thread)(struct target *base, struct target *overlay, tid_t tid)
void os_linux_generic_register(void)
int(* invalidate_thread)(struct target *target, struct target_thread *tthread)
ADDR memregion_relocate(struct memregion *region, ADDR obj_addr, struct memrange **range_saveptr)
void target_gkv_destroy(struct target *target)
int target_regcache_isdirty_reg_range(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt, REG start, REG end)
int target_lookup_line_addr(struct target *target, char *srcfile, ADDR addr)
struct target_spec * target_argp_target_spec(struct argp_state *state)
void *(* bind)(struct target_decoder_binding *tdb)
int debugfile_lookup_filename_line_addr(struct debugfile *debugfile, ADDR addr, char **filename, int *line)
struct value * target_load_symbol_member(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, const char *member, const char *delim, load_flags_t flags)
int target_memmod_set_writeable(struct target *target, struct target_memmod *mmod, int writeable)
int target_regcache_invalidate(struct target *target, struct target_thread *tthread, thread_ctxt_t tctxt)
int target_contains_real(struct target *target, ADDR addr)
void target_location_ctxt_free(struct target_location_ctxt *tlctxt)
#define SYMBOL_IS_ROOT(sym)
char * SYMBOL_TYPE(int n)
REGVAL target_regcache_readreg(struct target *target, tid_t tid, REG reg)
void target_tid_set_status(struct target *target, tid_t tid, thread_status_t status)
struct target_spec * spec
int target_monitor_schedule_interrupt(struct target *target)
#define LOCATION_REG(loc)
ADDR memrange_relocate(struct memrange *range, ADDR obj)
int target_memmod_set_tmp(struct target *target, tid_t tid, struct target_memmod *mmod, unsigned char *code, unsigned long code_len)
struct target_location_ctxt *(* unwind)(struct target *target, tid_t tid)
struct target_spec * target_argp_driver_parse_one(struct argp *driver_parser, void *driver_state, int argc, char **argv, target_type_t target_types, int filter_quoted)
char * symbol_get_name(struct symbol *symbol)
#define RPUT(x, objtype, hx, rc)
void debugfile_load_opts_free(struct debugfile_load_opts *opts)
struct location_ops * location_ops
struct symbol_root * root
void * malloc(size_t size)
char * debugfile_root_prefix
struct regcache * regcache_create(struct arch *arch)
int regcache_snprintf(struct regcache *regcache, char *buf, int bufsiz, int detail, char *sep, char *kvsep, int flags)
unsigned int max_thread_ctxt
struct target_thread * target_lookup_thread(struct target *target, tid_t tid)
void target_set_status(struct target *target, target_status_t status)
void * clrange_find(clrange_t *clf, Word_t index)
struct target_thread * thread
target_type_t target_type(struct target *target)
unsigned long target_write_addr(struct target *target, ADDR addr, unsigned long length, unsigned char *buf)
struct gdb_spec * gdb_build_spec(void)
void value_set_const(struct value *value)
int target_lookup_safe_disasm_range(struct target *target, ADDR addr, ADDR *start, ADDR *end, void **data)
target_status_t(* handle_overlay_exception)(struct target *overlay, target_exception_flags_t flags, tid_t tid, ADDR ipval, int *again)
int regcache_copy_dirty(struct regcache *sregcache, struct regcache *dregcache)
struct bsymbol * target_lookup_sym_member(struct target *target, struct bsymbol *bsymbol, const char *name, const char *delim)
void target_gkv_remove(struct target *target, char *key)
void * target_gkv_lookup(struct target *target, char *key)
int target_monitor_handling_exception(struct target *target)
GHashTable * target_regcache_copy_registers_tidctxt(struct target *target, tid_t tid, thread_ctxt_t tidctxt)
int target_thread_filter_check(struct target *target, tid_t tid, struct target_nv_filter *tf)
int target_lookup_next_safe_disasm_range(struct target *target, ADDR addr, ADDR *start, ADDR *end, void **data)
#define INIT_LIST_HEAD(ptr)
struct argp linux_userproc_argp
int vdebug_is_on(int level, log_areas_t areas, log_flags_t flags)
int target_decoder_lib_register(struct target_decoder_lib *lib)
struct target_thread * target_create_thread(struct target *target, tid_t tid, void *tstate, void *tpstate)
int clrange_add(clrange_t *clf, Word_t start, Word_t end, void *data)
int debugfile_lookup_addr_alt__int(struct debugfile *debugfile, ADDR addr, struct lsymbol **primary, struct lsymbol **alt)
int target_regcache_writereg(struct target *target, tid_t tid, REG reg, REGVAL value)
int target_write_reg(struct target *target, tid_t tid, REG reg, REGVAL value)
void * target_thread_gkv_steal(struct target *target, tid_t tid, char *key)
struct location_ctxt * lctxt
int regcache_isdirty(struct regcache *regcache)
int target_thread_obj_flags_propagate(struct target_thread *tthread, obj_flags_t orf, obj_flags_t nandf)
int target_memmod_free(struct target *target, tid_t tid, struct target_memmod *mmod, int force)
struct memregion * region
void target_driver_argp_init_children(struct argp_state *state)
#define LOGDUMPSYMBOL(dl, lt, lf, s)
#define SYMBOL_IS_VAR(sym)
loctype_t target_lsymbol_resolve_location(struct target *target, struct target_location_ctxt *tlctxt, struct lsymbol *lsymbol, ADDR base_addr, load_flags_t flags, struct location *o_loc, struct symbol **o_datatype, struct memrange **o_range)
int xen_vm_spec_to_argv(struct target_spec *spec, int *argc, char ***argv)
clrange_t clrange_create(void)
active_probe_flags_t ap_flags
#define OBJSDEAD(obj, type)
char * xen_vm_argp_header
struct value *(* read_symbol)(struct target *target, struct target_location_ctxt *tlctxt, struct bsymbol *bsymbol, load_flags_t flags)
unsigned char * target_load_code(struct target *target, ADDR start, unsigned int len, int nocache, int force_copy, int *caller_free)