Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
5826e519
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5826e519
编写于
10月 05, 2011
作者:
S
Stefan Weil
提交者:
Stefan Weil
10月 31, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tcg: Add tci disassembler
Signed-off-by:
N
Stefan Weil
<
sw@weilnetz.de
>
上级
7657f4bf
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
63 addition
and
1 deletion
+63
-1
dis-asm.h
dis-asm.h
+1
-0
disas.c
disas.c
+3
-1
tci-dis.c
tci-dis.c
+59
-0
未找到文件。
dis-asm.h
浏览文件 @
5826e519
...
...
@@ -365,6 +365,7 @@ typedef struct disassemble_info {
target address. Return number of bytes processed. */
typedef
int
(
*
disassembler_ftype
)
(
bfd_vma
,
disassemble_info
*
);
int
print_insn_tci
(
bfd_vma
,
disassemble_info
*
);
int
print_insn_big_mips
(
bfd_vma
,
disassemble_info
*
);
int
print_insn_little_mips
(
bfd_vma
,
disassemble_info
*
);
int
print_insn_i386
(
bfd_vma
,
disassemble_info
*
);
...
...
disas.c
浏览文件 @
5826e519
...
...
@@ -273,7 +273,9 @@ void disas(FILE *out, void *code, unsigned long size)
#else
disasm_info
.
endian
=
BFD_ENDIAN_LITTLE
;
#endif
#if defined(__i386__)
#if defined(CONFIG_TCG_INTERPRETER)
print_insn
=
print_insn_tci
;
#elif defined(__i386__)
disasm_info
.
mach
=
bfd_mach_i386_i386
;
print_insn
=
print_insn_i386
;
#elif defined(__x86_64__)
...
...
tci-dis.c
0 → 100644
浏览文件 @
5826e519
/*
* Tiny Code Interpreter for QEMU - disassembler
*
* Copyright (c) 2011 Stefan Weil
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dis-asm.h"
#include "tcg/tcg.h"
/* Disassemble TCI bytecode. */
int
print_insn_tci
(
bfd_vma
addr
,
disassemble_info
*
info
)
{
int
length
;
uint8_t
byte
;
int
status
;
TCGOpcode
op
;
status
=
info
->
read_memory_func
(
addr
,
&
byte
,
1
,
info
);
if
(
status
!=
0
)
{
info
->
memory_error_func
(
status
,
addr
,
info
);
return
-
1
;
}
op
=
byte
;
addr
++
;
status
=
info
->
read_memory_func
(
addr
,
&
byte
,
1
,
info
);
if
(
status
!=
0
)
{
info
->
memory_error_func
(
status
,
addr
,
info
);
return
-
1
;
}
length
=
byte
;
if
(
op
>=
tcg_op_defs_max
)
{
info
->
fprintf_func
(
info
->
stream
,
"illegal opcode %d"
,
op
);
}
else
{
const
TCGOpDef
*
def
=
&
tcg_op_defs
[
op
];
int
nb_oargs
=
def
->
nb_oargs
;
int
nb_iargs
=
def
->
nb_iargs
;
int
nb_cargs
=
def
->
nb_cargs
;
/* TODO: Improve disassembler output. */
info
->
fprintf_func
(
info
->
stream
,
"%s
\t
o=%d i=%d c=%d"
,
def
->
name
,
nb_oargs
,
nb_iargs
,
nb_cargs
);
}
return
length
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录