Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tci.c TCG_CONST err #1

Open
wants to merge 1 commit into
base: base_cgc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ endif
defconfig:
rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)

debug:
$(foreach v, $(V), \
$(warning $v : $($v)))

ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
endif
Expand Down
1 change: 1 addition & 0 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ endif

install: all
ifneq ($(PROGS),)
$(warning $(PWD))
$(call install-prog,$(PROGS),$(DESTDIR)$(bindir))
endif
ifdef CONFIG_TRACE_SYSTEMTAP
Expand Down
12 changes: 9 additions & 3 deletions disas.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* General "disassemble this chunk" code. Used for debugging. */
#include "config.h"
#include "disas/bfd.h"
//#include "disas/bfd.h"
#include "elf.h"
#include <errno.h>

Expand Down Expand Up @@ -195,9 +195,10 @@ static int print_insn_od_target(bfd_vma pc, disassemble_info *info)
bit 16 indicates little endian.
other targets - unused
*/
void target_disas(FILE *out, CPUArchState *env, target_ulong code,
void real_target_disas(FILE *out, CPUState *env, target_ulong code,
target_ulong size, int flags)
{
CPUClass *cc = CPU_GET_CLASS(env);
target_ulong pc;
int count;
CPUDebug s;
Expand All @@ -216,6 +217,11 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
#else
s.info.endian = BFD_ENDIAN_LITTLE;
#endif

if (cc->disas_set_info) {
cc->disas_set_info(env, &s.info);
}

#if defined(TARGET_I386)
if (flags == 2) {
s.info.mach = bfd_mach_x86_64;
Expand Down Expand Up @@ -265,7 +271,7 @@ void target_disas(FILE *out, CPUArchState *env, target_ulong code,
s.info.mach = bfd_mach_ppc;
#endif
}
s.info.disassembler_options = (char *)"any";
s.info.disassembler_options = (char *)"intel";
print_insn = print_insn_ppc;
#elif defined(TARGET_M68K)
print_insn = print_insn_m68k;
Expand Down
5 changes: 4 additions & 1 deletion include/disas/disas.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
#ifdef NEED_CPU_H
/* Disassemble this for me please... (debugging). */
void disas(FILE *out, void *code, unsigned long size);
void target_disas(FILE *out, CPUArchState *env, target_ulong code,
void target_disas(FILE *out, CPUState *env, target_ulong code,
target_ulong size, int flags);

void real_target_disas(FILE *out, CPUState *env, target_ulong code,
target_ulong size, int flags);

void monitor_disas(Monitor *mon, CPUArchState *env,
Expand Down
3 changes: 3 additions & 0 deletions include/qom/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <signal.h>
#include <setjmp.h>
#include "hw/qdev-core.h"
#include "disas/bfd.h"
#include "exec/hwaddr.h"
#include "qemu/queue.h"
#include "qemu/thread.h"
Expand Down Expand Up @@ -171,6 +172,8 @@ typedef struct CPUClass {
void (*cpu_exec_enter)(CPUState *cpu);
void (*cpu_exec_exit)(CPUState *cpu);
bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request);

void (*disas_set_info)(CPUState *cpu, disassemble_info *info);
} CPUClass;

#ifdef HOST_WORDS_BIGENDIAN
Expand Down
5 changes: 4 additions & 1 deletion linux-user/Makefile.objs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
$(warning $(PWD))
obj-y = main.o syscall.o strace.o mmap.o signal.o \
elfload.o linuxload.o uaccess.o
elfload.o linuxload.o uaccess.o tci.o


9 changes: 9 additions & 0 deletions linux-user/elfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ static void probe_guest_base(const char *image_name,

On return: INFO values will be filled in, as necessary or available. */

extern struct library *GLOBAL_librarymap;
extern const char *filename;

static void load_elf_image(const char *image_name, int image_fd,
struct image_info *info, char **pinterp_name,
char bprm_buf[BPRM_BUF_SIZE])
Expand Down Expand Up @@ -605,6 +608,12 @@ static void load_elf_image(const char *image_name, int image_fd,
load_addr = target_mmap(loaddr, hiaddr - loaddr, PROT_NONE,
MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
-1, 0);

if (strcmp(filename, image_name)){
if (GLOBAL_librarymap == NULL) init_librarymap();
add_to_librarymap(image_name, load_addr, load_addr+(hiaddr-loaddr));
}

if (load_addr == -1) {
goto exit_perror;
}
Expand Down
31 changes: 31 additions & 0 deletions linux-user/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ void cpu_loop(CPUX86State *env)
int trapnr;
abi_ulong pc;
target_siginfo_t info;
void *a;

for(;;) {
cpu_exec_start(cs);
Expand Down Expand Up @@ -612,6 +613,30 @@ struct qemu_argument {
const char *help;
};

extern int GLOBAL_parent_id, GLOBAL_start_clnum, GLOBAL_id;

static void handle_arg_qirachild(const char *arg) {
singlestep = 1; // always

int ret = sscanf(arg, "%d %d %d", &GLOBAL_parent_id, &GLOBAL_start_clnum, &GLOBAL_id);
if (ret != 3) {
printf("CORRUPT qirachild\n");
}
}

int GLOBAL_tracelibraries = 0;
extern int GLOBAL_tracelibraries;

static void handle_arg_tracelibraries(const char *arg) {
GLOBAL_tracelibraries = 1;
}

uint64_t GLOBAL_gatetrace = 0;
extern uint64_t GLOBAL_gatetrace;
static void handle_arg_gatetrace(const char *arg) {
GLOBAL_gatetrace = strtoull(arg, NULL, 0);
}

static const struct qemu_argument arg_table[] = {
{"h", "", false, handle_arg_help,
"", "print this help"},
Expand All @@ -628,6 +653,12 @@ static const struct qemu_argument arg_table[] = {
"logfile", "write logs to 'logfile' (default stderr)"},
{"singlestep", "QEMU_SINGLESTEP", false, handle_arg_singlestep,
"", "run in singlestep mode"},
{"qirachild", "QIRA_CHILD", true, handle_arg_qirachild,
"", "parent_id, start_clnum, id"},
{"tracelibraries", "QIRA_TRACELIBRARIES", false, handle_arg_tracelibraries,
"", ""},
{"gatetrace", "QIRA_GATETRACE", true, handle_arg_gatetrace,
"", "address to gate starting trace on"},
{"strace", "QEMU_STRACE", false, handle_arg_strace,
"", "log system calls"},
{"seed", "QEMU_RAND_SEED", true, handle_arg_randseed,
Expand Down
1 change: 1 addition & 0 deletions linux-user/tci.c
Loading