mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-02-16 07:30:16 +00:00
GP-3155 Regenerating parsers, documentation. LZCOUNT tests.
This commit is contained in:
parent
e4ab760242
commit
945d91fc93
@ -64,8 +64,8 @@ task generateParsers {
|
||||
*/
|
||||
task yaccDecompiler {
|
||||
|
||||
Task t1 = createBisonTask("xml", "decompile", false, true);
|
||||
Task t2 = createBisonTask("grammar", "decompile", false, true);
|
||||
Task t1 = createBisonTask("xml", "decompile", false);
|
||||
Task t2 = createBisonTask("grammar", "decompile", false);
|
||||
|
||||
if (t1 != null) {
|
||||
dependsOn t1, t2
|
||||
@ -79,9 +79,9 @@ task yaccDecompiler {
|
||||
*/
|
||||
task yaccSleigh {
|
||||
|
||||
Task t1 = createBisonTask("slghparse", "sleigh", true, false); // also produces slghparse.hh header file
|
||||
Task t2 = createBisonTask("pcodeparse", "sleigh", false, true);
|
||||
Task t3 = createBisonTask("xml", "sleigh", false, true);
|
||||
Task t1 = createBisonTask("slghparse", "sleigh", true); // also produces slghparse.hh header file
|
||||
Task t2 = createBisonTask("pcodeparse", "sleigh", false);
|
||||
Task t3 = createBisonTask("xml", "sleigh", false);
|
||||
|
||||
if (t1 != null) {
|
||||
dependsOn t1,t2,t3
|
||||
@ -110,6 +110,8 @@ def installPoint = "$rootDir/GhidraDocs/languages/html"
|
||||
|
||||
def installHelpPoint = "../help/help"
|
||||
|
||||
def defaultStylePoint = "$rootDir/Ghidra/Framework/Help/src/main/resources/help/shared/DefaultStyle.css"
|
||||
|
||||
task buildDecompilerHelpHtml(type: Exec) {
|
||||
|
||||
workingDir 'src/main/doc'
|
||||
@ -134,7 +136,7 @@ task buildDecompilerHelpHtml(type: Exec) {
|
||||
xsltproc --output $buildDir/decomp_noscaling.xml --stringparam profile.condition "noscaling" commonprofile.xsl decompileplugin.xml 2>&1
|
||||
xsltproc --stringparam base.dir ${installHelpPoint}/topics/DecompilePlugin/ --stringparam root.filename Decompiler decompileplugin_html.xsl $buildDir/decomp_noscaling.xml 2>&1
|
||||
rm ${installHelpPoint}/topics/DecompilePlugin/Decompiler.html
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' ${installHelpPoint}/topics/DecompilePlugin/*.html 2>&1
|
||||
sed -i -e '/DefaultStyle.css/ { p; sQhref=".*"Qhref="../../shared/languages.css"Q; }' ${installHelpPoint}/topics/DecompilePlugin/*.html 2>&1
|
||||
|
||||
echo '** Done. **'
|
||||
"""
|
||||
@ -174,6 +176,9 @@ task buildDecompilerHelpPdf(type: Exec) {
|
||||
|
||||
workingDir 'src/main/doc'
|
||||
|
||||
outputs.dir "$workingDir/$buildDir/pdf"
|
||||
outputs.file "$workingDir/$buildDir/pdf/decompileplugin.pdf"
|
||||
|
||||
// 'which' returns the number of failed arguments
|
||||
// Using 'which' first will allow the entire command to fail if the required
|
||||
// executables are not installed.
|
||||
@ -186,19 +191,25 @@ task buildDecompilerHelpPdf(type: Exec) {
|
||||
echo '** Checking if required executables are installed. **'
|
||||
which fop 2>&1
|
||||
which xsltproc 2>&1
|
||||
rm -f $buildDir/decompileplugin.fo $buildDir/decompileplugin.pdf $buildDir/decompileplugin_withscaling.xml 2>&1
|
||||
rm -rf $buildDir/images 2>&1
|
||||
mkdir -p $buildDir/images 2>&1
|
||||
cp $installHelpPoint/topics/DecompilePlugin/images/*.png $buildDir/images 2>&1
|
||||
cp $installHelpPoint/topics/DecompilePlugin/images/*.gif $buildDir/images 2>&1
|
||||
cp $installHelpPoint/shared/*.png $buildDir/images 2>&1
|
||||
mkdir -p $buildDir/pdf/images 2>&1
|
||||
cp $installHelpPoint/topics/DecompilePlugin/images/*.png $buildDir/pdf/images 2>&1
|
||||
cp ../resources/images/decompileFunction.gif $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Help/src/main/resources/help/shared/warning.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Help/src/main/resources/help/shared/tip.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Help/src/main/resources/help/shared/note.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Features/Base/src/main/resources/images/camera-photo.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Gui/src/main/resources/images/openFolder.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Gui/src/main/resources/images/reload3.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Gui/src/main/resources/images/page_white_copy.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Docking/src/main/resources/images/document-properties.png $buildDir/pdf/images 2>&1
|
||||
cp ../../../../../Framework/Project/src/main/resources/images/page_edit.png $buildDir/pdf/images 2>&1
|
||||
|
||||
echo '** Building decompileplugin.fo **'
|
||||
xsltproc --output $buildDir/decompileplugin_withscaling.xml --stringparam profile.condition "withscaling" commonprofile.xsl decompileplugin.xml 2>&1
|
||||
xsltproc --output $buildDir/decompileplugin.fo decompileplugin_pdf.xsl $buildDir/decompileplugin_withscaling.xml 2>&1
|
||||
xsltproc --output $buildDir/pdf/decompileplugin_withscaling.xml --stringparam profile.condition "withscaling" commonprofile.xsl decompileplugin.xml 2>&1
|
||||
xsltproc --output $buildDir/pdf/decompileplugin.fo decompileplugin_pdf.xsl $buildDir/pdf/decompileplugin_withscaling.xml 2>&1
|
||||
|
||||
echo '** Building decompileplugin.pdf **'
|
||||
fop $buildDir/decompileplugin.fo $buildDir/decompileplugin.pdf 2>&1
|
||||
fop $buildDir/pdf/decompileplugin.fo $buildDir/pdf/decompileplugin.pdf 2>&1
|
||||
|
||||
echo '** Done. **'
|
||||
"""
|
||||
@ -323,12 +334,11 @@ task buildDecompilerDocumentationHtml(type: Exec) {
|
||||
|
||||
echo -e '** Building index.html **'
|
||||
xsltproc --output $buildDir/index.html main_html.xsl main.xml 2>&1
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/index.html
|
||||
sed -i -e '/DefaultStyle.css/ { p; sQhref=".*"Qhref="../../shared/languages.css"Q; }' $buildDir/index.html
|
||||
|
||||
echo '** Building html/sleigh.html **'
|
||||
xsltproc --stringparam base.dir $buildDir/html/ --stringparam root.filename sleigh sleigh_html.xsl sleigh.xml 2>&1
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/html/sleigh*.html
|
||||
cp $installPoint/Frontpage.css $buildDir/html 2>&1
|
||||
cp $defaultStylePoint $buildDir/html 2>&1
|
||||
cp $installPoint/languages.css $buildDir/html
|
||||
cp $installPoint/Diagram1.png $buildDir/html
|
||||
cp $installPoint/Diagram2.png $buildDir/html
|
||||
@ -336,11 +346,9 @@ task buildDecompilerDocumentationHtml(type: Exec) {
|
||||
|
||||
echo '** Building html/pcoderef.html **'
|
||||
xsltproc --stringparam base.dir $buildDir/html/ --stringparam root.filename pcoderef pcoderef_html.xsl pcoderef.xml 2>&1
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/html/pcoderef.html
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/html/pcodedescription.html
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/html/pseudo-ops.html
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' $buildDir/html/reference.html
|
||||
cp $installPoint/Frontpage.css $buildDir/html
|
||||
|
||||
sed -i -e '/DefaultStyle.css/ { p; sQhref=".*"Qhref="languages.css"Q; }' $buildDir/html/*.html
|
||||
cp $defaultStylePoint $buildDir/html
|
||||
cp $installPoint/languages.css $buildDir/html
|
||||
|
||||
echo '** Installing html documentation. **'
|
||||
@ -402,40 +410,25 @@ boolean isUpToDate(File srcFile, File resultFile) {
|
||||
/**
|
||||
* Create a bison task to compile a yacc file (*.y) for the sleigh/decompiler
|
||||
*/
|
||||
Task createBisonTask(String filename, String binaryName, boolean generateHeader, boolean qualifyVariables) {
|
||||
Task createBisonTask(String filename, String binaryName, boolean generateHeader) {
|
||||
|
||||
def outputCppDir = "${cppSourceDir}"
|
||||
def outputHeadersDir = "${cppSourceDir}"
|
||||
|
||||
def yaccFile = "${cppSourceDir}/${filename}.y"
|
||||
def ccFile = "${outputCppDir}/${filename}.cc"
|
||||
def headerFile = "${outputCppDir}/${filename}.hh"
|
||||
def yaccFile = "${filename}.y"
|
||||
def ccFile = "${filename}.cc"
|
||||
def headerFile = "${filename}.hh"
|
||||
|
||||
return task("bison_${binaryName}_$filename", type: Exec) {
|
||||
|
||||
inputs.file "${yaccFile}"
|
||||
outputs.file "${ccFile}"
|
||||
inputs.file "${cppSourceDir}/${yaccFile}"
|
||||
outputs.file "${cppSourceDir}/${ccFile}"
|
||||
if (generateHeader) {
|
||||
outputs.file "${headerFile}"
|
||||
}
|
||||
|
||||
// doFirst {
|
||||
// file(outputCppDir).mkdirs()
|
||||
// file(outputHeadersDir)mkdirs()
|
||||
// }
|
||||
|
||||
workingDir "${cppSourceDir}"
|
||||
executable 'bison' // use bison program to process yacc files
|
||||
|
||||
// specify the bison's output file
|
||||
args "-o", "${ccFile}"
|
||||
|
||||
// most of the yacc files should be compiled with a variable qualifyer to avoid dupes.
|
||||
// Unfortunately there is one (slghparse) that can't use a qualifyer because it
|
||||
// declares a variable used by other files.
|
||||
|
||||
if (qualifyVariables) {
|
||||
args "-p", filename
|
||||
}
|
||||
// specify the bison's output file and that no #line directives should be generated
|
||||
args "-l", "-o", "${ccFile}"
|
||||
|
||||
// tell bison where to put the hh file.
|
||||
if (generateHeader) {
|
||||
@ -452,25 +445,20 @@ Task createBisonTask(String filename, String binaryName, boolean generateHeader,
|
||||
*/
|
||||
Task createLexTask(String filename, String binaryName) {
|
||||
|
||||
def outputCppDir = "${cppSourceDir}"
|
||||
|
||||
def lexFile = "${cppSourceDir}/${filename}.l"
|
||||
def ccFile = "${outputCppDir}/${filename}.cc"
|
||||
def lexFile = "${filename}.l"
|
||||
def ccFile = "${filename}.cc"
|
||||
|
||||
return task("lex_${binaryName}_$filename", type: Exec) {
|
||||
|
||||
// set up inputs and outputs so that gradle knows when this needs to be rebuilt
|
||||
inputs.file "${lexFile}"
|
||||
outputs.files "${ccFile}"
|
||||
inputs.file "${cppSourceDir}/${lexFile}"
|
||||
outputs.files "${cppSourceDir}/${ccFile}"
|
||||
|
||||
// doFirst {
|
||||
// file(outputCppDir).mkdirs();
|
||||
// }
|
||||
|
||||
workingDir "${cppSourceDir}"
|
||||
executable 'flex' // the program to execute
|
||||
|
||||
// tell flex where to put the output
|
||||
args "-o", "${ccFile}"
|
||||
// tell flex where to put the output and not to generate #line directives
|
||||
args "-L", "-o", "${ccFile}"
|
||||
|
||||
// tell flex the input file
|
||||
args "${lexFile}"
|
||||
|
@ -31,6 +31,7 @@ src/decompile/datatests/impliedfield.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/indproto.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/injectoverride.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/loopcomment.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/lzcount.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/mixfloatint.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/modulo.xml||GHIDRA||||END|
|
||||
src/decompile/datatests/modulo2.xml||GHIDRA||||END|
|
||||
|
@ -231,15 +231,15 @@ sla_opt/%.o: %.cc
|
||||
$(CXX) $(ARCH_TYPE) -c $(OPT_CXXFLAGS) $(ADDITIONAL_FLAGS) $(SLEIGH_OPT) $< -o $@
|
||||
|
||||
grammar.cc: grammar.y
|
||||
$(YACC) -p cparse -o $@ $<
|
||||
$(YACC) -l -o $@ $<
|
||||
xml.cc: xml.y
|
||||
$(YACC) -p xml -o $@ $<
|
||||
$(YACC) -l -o $@ $<
|
||||
pcodeparse.cc: pcodeparse.y
|
||||
$(YACC) -p pcode -o $@ $<
|
||||
$(YACC) -l -o $@ $<
|
||||
slghparse.cc: slghparse.y
|
||||
$(YACC) -d -o $@ $<
|
||||
$(YACC) -l -d -o $@ $<
|
||||
slghscan.cc: slghscan.l
|
||||
$(LEX) -o$@ $<
|
||||
$(LEX) -L -o$@ $<
|
||||
ruleparse.cc: ruleparse.y
|
||||
$(YACC) -p ruleparse -d -o $@ $<
|
||||
|
||||
|
@ -73,7 +73,8 @@
|
||||
/* Pull parsers. */
|
||||
#define YYPULL 1
|
||||
|
||||
|
||||
/* Substitute the type names. */
|
||||
#define YYSTYPE GRAMMARSTYPE
|
||||
/* Substitute the variable and function names. */
|
||||
#define yyparse grammarparse
|
||||
#define yylex grammarlex
|
||||
@ -85,16 +86,15 @@
|
||||
#define yychar grammarchar
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
#line 16 "src/decompile/cpp/grammar.y" /* yacc.c:339 */
|
||||
|
||||
|
||||
#include "grammar.hh"
|
||||
|
||||
extern int yylex(void);
|
||||
extern int yyerror(const char *str);
|
||||
extern int grammarlex(void);
|
||||
extern int grammarerror(const char *str);
|
||||
static CParse *parse;
|
||||
extern int yydebug;
|
||||
|
||||
#line 83 "src/decompile/cpp/grammar.cc" /* yacc.c:339 */
|
||||
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
@ -114,17 +114,25 @@ extern int yydebug;
|
||||
|
||||
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#ifndef GRAMMARDEBUG
|
||||
# if defined YYDEBUG
|
||||
#if YYDEBUG
|
||||
# define GRAMMARDEBUG 1
|
||||
# else
|
||||
# define GRAMMARDEBUG 0
|
||||
# endif
|
||||
# else /* ! defined YYDEBUG */
|
||||
# define GRAMMARDEBUG 0
|
||||
# endif /* ! defined YYDEBUG */
|
||||
#endif /* ! defined GRAMMARDEBUG */
|
||||
#if GRAMMARDEBUG
|
||||
extern int grammardebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
#ifndef GRAMMARTOKENTYPE
|
||||
# define GRAMMARTOKENTYPE
|
||||
enum grammartokentype
|
||||
{
|
||||
DOTDOTDOT = 258,
|
||||
BADTOKEN = 259,
|
||||
@ -143,11 +151,11 @@ extern int grammardebug;
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
#if ! defined GRAMMARSTYPE && ! defined GRAMMARSTYPE_IS_DECLARED
|
||||
|
||||
union YYSTYPE
|
||||
union GRAMMARSTYPE
|
||||
{
|
||||
#line 25 "src/decompile/cpp/grammar.y" /* yacc.c:355 */
|
||||
|
||||
|
||||
uint4 flags;
|
||||
TypeDeclarator *dec;
|
||||
@ -160,16 +168,16 @@ union YYSTYPE
|
||||
string *str;
|
||||
uintb *i;
|
||||
|
||||
#line 149 "src/decompile/cpp/grammar.cc" /* yacc.c:355 */
|
||||
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
typedef union GRAMMARSTYPE GRAMMARSTYPE;
|
||||
# define GRAMMARSTYPE_IS_TRIVIAL 1
|
||||
# define GRAMMARSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
extern YYSTYPE grammarlval;
|
||||
extern GRAMMARSTYPE grammarlval;
|
||||
|
||||
int grammarparse (void);
|
||||
|
||||
@ -177,7 +185,7 @@ int grammarparse (void);
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
|
||||
#line 166 "src/decompile/cpp/grammar.cc" /* yacc.c:358 */
|
||||
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@ -358,7 +366,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
|
||||
#if (! defined yyoverflow \
|
||||
&& (! defined __cplusplus \
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|| (defined GRAMMARSTYPE_IS_TRIVIAL && GRAMMARSTYPE_IS_TRIVIAL)))
|
||||
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
@ -472,7 +480,7 @@ static const yytype_uint8 yytranslate[] =
|
||||
15
|
||||
};
|
||||
|
||||
#if YYDEBUG
|
||||
#if GRAMMARDEBUG
|
||||
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
|
||||
static const yytype_uint8 yyrline[] =
|
||||
{
|
||||
@ -487,7 +495,7 @@ static const yytype_uint8 yyrline[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE || 0
|
||||
#if GRAMMARDEBUG || YYERROR_VERBOSE || 0
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
@ -706,7 +714,7 @@ while (0)
|
||||
|
||||
|
||||
/* Enable debugging if requested. */
|
||||
#if YYDEBUG
|
||||
#if GRAMMARDEBUG
|
||||
|
||||
# ifndef YYFPRINTF
|
||||
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
|
||||
@ -827,12 +835,12 @@ do { \
|
||||
/* Nonzero means print parse trace. It is left uninitialized so that
|
||||
multiple parsers can coexist. */
|
||||
int yydebug;
|
||||
#else /* !YYDEBUG */
|
||||
#else /* !GRAMMARDEBUG */
|
||||
# define YYDPRINTF(Args)
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
||||
# define YY_STACK_PRINT(Bottom, Top)
|
||||
# define YY_REDUCE_PRINT(Rule)
|
||||
#endif /* !YYDEBUG */
|
||||
#endif /* !GRAMMARDEBUG */
|
||||
|
||||
|
||||
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
||||
@ -1343,427 +1351,427 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 2:
|
||||
#line 60 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ parse->setResultDeclarations((yyvsp[0].declist)); }
|
||||
#line 1334 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
#line 61 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ vector<TypeDeclarator *> *res = parse->newVecDeclarator(); res->push_back((yyvsp[0].dec)); parse->setResultDeclarations(res); }
|
||||
#line 1340 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
#line 65 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->mergeSpecDecVec((yyvsp[-1].spec)); }
|
||||
#line 1346 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
#line 66 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->mergeSpecDecVec((yyvsp[-2].spec),(yyvsp[-1].declist)); }
|
||||
#line 1352 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
#line 70 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addSpecifier((yyval.spec),(yyvsp[0].str)); }
|
||||
#line 1358 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 7:
|
||||
#line 71 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addTypeSpecifier((yyval.spec),(yyvsp[0].type)); }
|
||||
#line 1364 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 8:
|
||||
#line 72 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addSpecifier((yyval.spec),(yyvsp[0].str)); }
|
||||
#line 1370 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 9:
|
||||
#line 73 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addFuncSpecifier((yyval.spec),(yyvsp[0].str)); }
|
||||
#line 1376 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 10:
|
||||
#line 74 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addSpecifier((yyvsp[0].spec),(yyvsp[-1].str)); }
|
||||
#line 1382 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 11:
|
||||
#line 75 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addTypeSpecifier((yyvsp[0].spec),(yyvsp[-1].type)); }
|
||||
#line 1388 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 12:
|
||||
#line 76 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addSpecifier((yyvsp[0].spec),(yyvsp[-1].str)); }
|
||||
#line 1394 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 13:
|
||||
#line 77 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addFuncSpecifier((yyvsp[0].spec),(yyvsp[-1].str)); }
|
||||
#line 1400 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 14:
|
||||
#line 81 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->newVecDeclarator(); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1406 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 15:
|
||||
#line 82 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[-2].declist); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1412 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
#line 86 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[0].dec); }
|
||||
#line 1418 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 17:
|
||||
#line 91 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = (yyvsp[0].type); }
|
||||
#line 1424 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 18:
|
||||
#line 92 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = (yyvsp[0].type); }
|
||||
#line 1430 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 19:
|
||||
#line 93 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = (yyvsp[0].type); }
|
||||
#line 1436 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 20:
|
||||
#line 97 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newStruct("",(yyvsp[-1].declist)); }
|
||||
#line 1442 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 21:
|
||||
#line 98 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newStruct(*(yyvsp[-3].str),(yyvsp[-1].declist)); }
|
||||
#line 1448 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 22:
|
||||
#line 99 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->oldStruct(*(yyvsp[0].str)); }
|
||||
#line 1454 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 23:
|
||||
#line 100 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newUnion("",(yyvsp[-1].declist)); }
|
||||
#line 1460 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 24:
|
||||
#line 101 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newUnion(*(yyvsp[-3].str),(yyvsp[-1].declist)); }
|
||||
#line 1466 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 25:
|
||||
#line 102 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->oldUnion(*(yyvsp[0].str)); }
|
||||
#line 1472 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 26:
|
||||
#line 106 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[0].declist); }
|
||||
#line 1478 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 27:
|
||||
#line 107 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[-1].declist); (yyval.declist)->insert((yyval.declist)->end(),(yyvsp[0].declist)->begin(),(yyvsp[0].declist)->end()); }
|
||||
#line 1484 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 28:
|
||||
#line 111 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->mergeSpecDecVec((yyvsp[-2].spec),(yyvsp[-1].declist)); }
|
||||
#line 1490 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 29:
|
||||
#line 115 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addTypeSpecifier((yyval.spec),(yyvsp[0].type)); }
|
||||
#line 1496 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 30:
|
||||
#line 116 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addTypeSpecifier((yyvsp[0].spec),(yyvsp[-1].type)); }
|
||||
#line 1502 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 31:
|
||||
#line 117 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->newSpecifier(); parse->addSpecifier((yyval.spec),(yyvsp[0].str)); }
|
||||
#line 1508 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
#line 118 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.spec) = parse->addSpecifier((yyvsp[0].spec),(yyvsp[-1].str)); }
|
||||
#line 1514 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 33:
|
||||
#line 122 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->newVecDeclarator(); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1520 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 34:
|
||||
#line 123 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[-2].declist); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1526 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 35:
|
||||
#line 127 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[0].dec); }
|
||||
#line 1532 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 36:
|
||||
#line 132 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newEnum(*(yyvsp[-3].str),(yyvsp[-1].vecenum)); }
|
||||
#line 1538 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 37:
|
||||
#line 133 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newEnum("",(yyvsp[-1].vecenum)); }
|
||||
#line 1544 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 38:
|
||||
#line 134 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newEnum(*(yyvsp[-4].str),(yyvsp[-2].vecenum)); }
|
||||
#line 1550 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 39:
|
||||
#line 135 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->newEnum("",(yyvsp[-2].vecenum)); }
|
||||
#line 1556 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 40:
|
||||
#line 136 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.type) = parse->oldEnum(*(yyvsp[0].str)); }
|
||||
#line 1562 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 41:
|
||||
#line 140 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.vecenum) = parse->newVecEnumerator(); (yyval.vecenum)->push_back((yyvsp[0].enumer)); }
|
||||
#line 1568 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 42:
|
||||
#line 141 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.vecenum) = (yyvsp[-2].vecenum); (yyval.vecenum)->push_back((yyvsp[0].enumer)); }
|
||||
#line 1574 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 43:
|
||||
#line 145 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.enumer) = parse->newEnumerator(*(yyvsp[0].str)); }
|
||||
#line 1580 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 44:
|
||||
#line 146 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.enumer) = parse->newEnumerator(*(yyvsp[-2].str),*(yyvsp[0].i)); }
|
||||
#line 1586 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 45:
|
||||
#line 150 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[0].dec); }
|
||||
#line 1592 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 46:
|
||||
#line 151 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->mergePointer((yyvsp[-1].ptrspec),(yyvsp[0].dec)); }
|
||||
#line 1598 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 47:
|
||||
#line 155 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newDeclarator((yyvsp[0].str)); }
|
||||
#line 1604 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 48:
|
||||
#line 156 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[-1].dec); }
|
||||
#line 1610 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 49:
|
||||
#line 157 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newArray((yyvsp[-4].dec),(yyvsp[-2].flags),(yyvsp[-1].i)); }
|
||||
#line 1616 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
#line 158 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newArray((yyvsp[-3].dec),0,(yyvsp[-1].i)); }
|
||||
#line 1622 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 51:
|
||||
#line 160 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newFunc((yyvsp[-3].dec),(yyvsp[-1].declist)); }
|
||||
#line 1628 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 52:
|
||||
#line 165 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.ptrspec) = parse->newPointer(); (yyval.ptrspec)->push_back(0); }
|
||||
#line 1634 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 53:
|
||||
#line 166 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.ptrspec) = parse->newPointer(); (yyval.ptrspec)->push_back((yyvsp[0].flags)); }
|
||||
#line 1640 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 54:
|
||||
#line 167 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.ptrspec) = (yyvsp[0].ptrspec); (yyval.ptrspec)->push_back(0); }
|
||||
#line 1646 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 55:
|
||||
#line 168 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.ptrspec) = (yyvsp[0].ptrspec); (yyval.ptrspec)->push_back((yyvsp[-1].flags)); }
|
||||
#line 1652 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 56:
|
||||
#line 172 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.flags) = parse->convertFlag((yyvsp[0].str)); }
|
||||
#line 1658 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 57:
|
||||
#line 173 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.flags) = (yyvsp[-1].flags); (yyval.flags) |= parse->convertFlag((yyvsp[0].str)); }
|
||||
#line 1664 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 58:
|
||||
#line 177 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[0].declist); }
|
||||
#line 1670 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 59:
|
||||
#line 178 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[-2].declist); (yyval.declist)->push_back((TypeDeclarator *)0); }
|
||||
#line 1676 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 60:
|
||||
#line 182 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = parse->newVecDeclarator(); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1682 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 61:
|
||||
#line 183 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.declist) = (yyvsp[-2].declist); (yyval.declist)->push_back((yyvsp[0].dec)); }
|
||||
#line 1688 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 62:
|
||||
#line 187 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->mergeSpecDec((yyvsp[-1].spec),(yyvsp[0].dec)); }
|
||||
#line 1694 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 63:
|
||||
#line 188 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->mergeSpecDec((yyvsp[0].spec)); }
|
||||
#line 1700 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 64:
|
||||
#line 189 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->mergeSpecDec((yyvsp[-1].spec),(yyvsp[0].dec)); }
|
||||
#line 1706 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 65:
|
||||
#line 193 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newDeclarator(); parse->mergePointer((yyvsp[0].ptrspec),(yyval.dec)); }
|
||||
#line 1712 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 66:
|
||||
#line 194 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[0].dec); }
|
||||
#line 1718 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 67:
|
||||
#line 195 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->mergePointer((yyvsp[-1].ptrspec),(yyvsp[0].dec)); }
|
||||
#line 1724 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 68:
|
||||
#line 199 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = (yyvsp[-1].dec); }
|
||||
#line 1730 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 69:
|
||||
#line 201 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newArray((yyvsp[-3].dec),0,(yyvsp[-1].i)); }
|
||||
#line 1736 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 70:
|
||||
#line 203 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.dec) = parse->newFunc((yyvsp[-3].dec),(yyvsp[-1].declist)); }
|
||||
#line 1742 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 71:
|
||||
#line 207 "src/decompile/cpp/grammar.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.i) = (yyvsp[0].i); }
|
||||
#line 1748 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
|
||||
#line 1752 "src/decompile/cpp/grammar.cc" /* yacc.c:1646 */
|
||||
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
@ -1991,7 +1999,7 @@ yyreturn:
|
||||
#endif
|
||||
return yyresult;
|
||||
}
|
||||
#line 210 "src/decompile/cpp/grammar.y" /* yacc.c:1906 */
|
||||
|
||||
|
||||
|
||||
void GrammarToken::set(uint4 tp)
|
||||
@ -3114,13 +3122,13 @@ bool CParse::parseStream(istream &s,uint4 doctype)
|
||||
return runParse(doctype);
|
||||
}
|
||||
|
||||
int yylex(void)
|
||||
int grammarlex(void)
|
||||
|
||||
{
|
||||
return parse->lex();
|
||||
}
|
||||
|
||||
int yyerror(const char *str)
|
||||
int grammarerror(const char *str)
|
||||
|
||||
{
|
||||
return 0;
|
||||
|
@ -13,13 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
%define api.prefix {grammar}
|
||||
%{
|
||||
#include "grammar.hh"
|
||||
|
||||
extern int yylex(void);
|
||||
extern int yyerror(const char *str);
|
||||
extern int grammarlex(void);
|
||||
extern int grammarerror(const char *str);
|
||||
static CParse *parse;
|
||||
extern int yydebug;
|
||||
%}
|
||||
|
||||
%union {
|
||||
@ -1329,13 +1329,13 @@ bool CParse::parseStream(istream &s,uint4 doctype)
|
||||
return runParse(doctype);
|
||||
}
|
||||
|
||||
int yylex(void)
|
||||
int grammarlex(void)
|
||||
|
||||
{
|
||||
return parse->lex();
|
||||
}
|
||||
|
||||
int yyerror(const char *str)
|
||||
int grammarerror(const char *str)
|
||||
|
||||
{
|
||||
return 0;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -13,14 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
%define api.prefix {pcode}
|
||||
%{
|
||||
#include "pcodeparse.hh"
|
||||
|
||||
//#define YYERROR_VERBOSE
|
||||
extern int yylex(void);
|
||||
extern int pcodelex(void);
|
||||
static PcodeSnippet *pcode;
|
||||
extern int yydebug;
|
||||
extern int yyerror(const char *str );
|
||||
extern int pcodeerror(const char *str );
|
||||
%}
|
||||
|
||||
%union {
|
||||
@ -800,11 +800,11 @@ void PcodeSnippet::addOperand(const string &name,int4 index)
|
||||
addSymbol(sym);
|
||||
}
|
||||
|
||||
int yylex(void) {
|
||||
int pcodelex(void) {
|
||||
return pcode->lex();
|
||||
}
|
||||
|
||||
int yyerror(const char *s)
|
||||
int pcodeerror(const char *s)
|
||||
|
||||
{
|
||||
pcode->reportError((const Location *)0,s);
|
||||
|
@ -10127,11 +10127,11 @@ int4 RuleXorSwap::applyOp(PcodeOp *op,Funcdata &data)
|
||||
}
|
||||
|
||||
/// \class RuleLzcountShiftBool
|
||||
/// \brief Simplify equality checks that use lzcount.
|
||||
/// \brief Simplify equality checks that use lzcount: `lzcount(X) >> c => X == 0` if X is 2^c bits wide
|
||||
///
|
||||
/// Some compilers check if a value is equal to zero by checking the most
|
||||
/// significant bit in lzcount; for instance on a 32-bit system,
|
||||
/// it being equal to 32 would have the 5th bit set.
|
||||
/// the result of lzcount on zero would have the 5th bit set.
|
||||
/// - `lzcount(a ^ 3) >> 5 => a ^ 3 == 0 => a == 3` (by RuleXorCollapse)
|
||||
/// - `lzcount(a - 3) >> 5 => a - 3 == 0 => a == 3` (by RuleEqual2Zero)
|
||||
void RuleLzcountShiftBool::getOpList(vector<uint4> &oplist) const
|
||||
@ -10170,7 +10170,6 @@ int4 RuleLzcountShiftBool::applyOp(PcodeOp *op,Funcdata &data)
|
||||
|
||||
// CPUI_INT_EQUAL must produce a 1-byte boolean result
|
||||
Varnode* eqResVn = data.newUniqueOut(1, newOp);
|
||||
data.opSetOutput(newOp, eqResVn);
|
||||
|
||||
data.opInsertBefore(newOp, baseOp);
|
||||
|
||||
@ -10178,7 +10177,10 @@ int4 RuleLzcountShiftBool::applyOp(PcodeOp *op,Funcdata &data)
|
||||
// we have to guarantee that a Varnode of this size gets outputted
|
||||
// to the descending PcodeOps. This is handled here with CPUI_INT_ZEXT.
|
||||
data.opRemoveInput(baseOp, 1);
|
||||
data.opSetOpcode(baseOp, CPUI_INT_ZEXT);
|
||||
if (baseOp->getOut()->getSize() == 1)
|
||||
data.opSetOpcode(baseOp, CPUI_COPY);
|
||||
else
|
||||
data.opSetOpcode(baseOp, CPUI_INT_ZEXT);
|
||||
data.opSetInput(baseOp, eqResVn, 0);
|
||||
return 1;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -107,71 +107,72 @@ extern int yydebug;
|
||||
OP_CPOOLREF = 302,
|
||||
OP_NEW = 303,
|
||||
OP_POPCOUNT = 304,
|
||||
BADINTEGER = 305,
|
||||
GOTO_KEY = 306,
|
||||
CALL_KEY = 307,
|
||||
RETURN_KEY = 308,
|
||||
IF_KEY = 309,
|
||||
DEFINE_KEY = 310,
|
||||
ATTACH_KEY = 311,
|
||||
MACRO_KEY = 312,
|
||||
SPACE_KEY = 313,
|
||||
TYPE_KEY = 314,
|
||||
RAM_KEY = 315,
|
||||
DEFAULT_KEY = 316,
|
||||
REGISTER_KEY = 317,
|
||||
ENDIAN_KEY = 318,
|
||||
WITH_KEY = 319,
|
||||
ALIGN_KEY = 320,
|
||||
OP_UNIMPL = 321,
|
||||
TOKEN_KEY = 322,
|
||||
SIGNED_KEY = 323,
|
||||
NOFLOW_KEY = 324,
|
||||
HEX_KEY = 325,
|
||||
DEC_KEY = 326,
|
||||
BIG_KEY = 327,
|
||||
LITTLE_KEY = 328,
|
||||
SIZE_KEY = 329,
|
||||
WORDSIZE_KEY = 330,
|
||||
OFFSET_KEY = 331,
|
||||
NAMES_KEY = 332,
|
||||
VALUES_KEY = 333,
|
||||
VARIABLES_KEY = 334,
|
||||
PCODEOP_KEY = 335,
|
||||
IS_KEY = 336,
|
||||
LOCAL_KEY = 337,
|
||||
DELAYSLOT_KEY = 338,
|
||||
CROSSBUILD_KEY = 339,
|
||||
EXPORT_KEY = 340,
|
||||
BUILD_KEY = 341,
|
||||
CONTEXT_KEY = 342,
|
||||
ELLIPSIS_KEY = 343,
|
||||
GLOBALSET_KEY = 344,
|
||||
BITRANGE_KEY = 345,
|
||||
CHAR = 346,
|
||||
INTEGER = 347,
|
||||
INTB = 348,
|
||||
STRING = 349,
|
||||
SYMBOLSTRING = 350,
|
||||
SPACESYM = 351,
|
||||
SECTIONSYM = 352,
|
||||
TOKENSYM = 353,
|
||||
USEROPSYM = 354,
|
||||
VALUESYM = 355,
|
||||
VALUEMAPSYM = 356,
|
||||
CONTEXTSYM = 357,
|
||||
NAMESYM = 358,
|
||||
VARSYM = 359,
|
||||
BITSYM = 360,
|
||||
SPECSYM = 361,
|
||||
VARLISTSYM = 362,
|
||||
OPERANDSYM = 363,
|
||||
STARTSYM = 364,
|
||||
ENDSYM = 365,
|
||||
NEXT2SYM = 366,
|
||||
MACROSYM = 367,
|
||||
LABELSYM = 368,
|
||||
SUBTABLESYM = 369
|
||||
OP_LZCOUNT = 305,
|
||||
BADINTEGER = 306,
|
||||
GOTO_KEY = 307,
|
||||
CALL_KEY = 308,
|
||||
RETURN_KEY = 309,
|
||||
IF_KEY = 310,
|
||||
DEFINE_KEY = 311,
|
||||
ATTACH_KEY = 312,
|
||||
MACRO_KEY = 313,
|
||||
SPACE_KEY = 314,
|
||||
TYPE_KEY = 315,
|
||||
RAM_KEY = 316,
|
||||
DEFAULT_KEY = 317,
|
||||
REGISTER_KEY = 318,
|
||||
ENDIAN_KEY = 319,
|
||||
WITH_KEY = 320,
|
||||
ALIGN_KEY = 321,
|
||||
OP_UNIMPL = 322,
|
||||
TOKEN_KEY = 323,
|
||||
SIGNED_KEY = 324,
|
||||
NOFLOW_KEY = 325,
|
||||
HEX_KEY = 326,
|
||||
DEC_KEY = 327,
|
||||
BIG_KEY = 328,
|
||||
LITTLE_KEY = 329,
|
||||
SIZE_KEY = 330,
|
||||
WORDSIZE_KEY = 331,
|
||||
OFFSET_KEY = 332,
|
||||
NAMES_KEY = 333,
|
||||
VALUES_KEY = 334,
|
||||
VARIABLES_KEY = 335,
|
||||
PCODEOP_KEY = 336,
|
||||
IS_KEY = 337,
|
||||
LOCAL_KEY = 338,
|
||||
DELAYSLOT_KEY = 339,
|
||||
CROSSBUILD_KEY = 340,
|
||||
EXPORT_KEY = 341,
|
||||
BUILD_KEY = 342,
|
||||
CONTEXT_KEY = 343,
|
||||
ELLIPSIS_KEY = 344,
|
||||
GLOBALSET_KEY = 345,
|
||||
BITRANGE_KEY = 346,
|
||||
CHAR = 347,
|
||||
INTEGER = 348,
|
||||
INTB = 349,
|
||||
STRING = 350,
|
||||
SYMBOLSTRING = 351,
|
||||
SPACESYM = 352,
|
||||
SECTIONSYM = 353,
|
||||
TOKENSYM = 354,
|
||||
USEROPSYM = 355,
|
||||
VALUESYM = 356,
|
||||
VALUEMAPSYM = 357,
|
||||
CONTEXTSYM = 358,
|
||||
NAMESYM = 359,
|
||||
VARSYM = 360,
|
||||
BITSYM = 361,
|
||||
SPECSYM = 362,
|
||||
VARLISTSYM = 363,
|
||||
OPERANDSYM = 364,
|
||||
STARTSYM = 365,
|
||||
ENDSYM = 366,
|
||||
NEXT2SYM = 367,
|
||||
MACROSYM = 368,
|
||||
LABELSYM = 369,
|
||||
SUBTABLESYM = 370
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -180,7 +181,7 @@ extern int yydebug;
|
||||
|
||||
union YYSTYPE
|
||||
{
|
||||
#line 29 "slghparse.y" /* yacc.c:1909 */
|
||||
|
||||
|
||||
char ch;
|
||||
uintb *i;
|
||||
@ -225,7 +226,7 @@ union YYSTYPE
|
||||
FamilySymbol *famsym;
|
||||
SpecificSymbol *specsym;
|
||||
|
||||
#line 214 "slghparse.hh" /* yacc.c:1909 */
|
||||
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -476,6 +476,7 @@ void ScoreUnionFields::scoreTrialDown(const Trial &trial,bool lastLevel)
|
||||
case CPUI_INT_AND:
|
||||
case CPUI_INT_OR:
|
||||
case CPUI_POPCOUNT:
|
||||
case CPUI_LZCOUNT:
|
||||
if (meta == TYPE_ARRAY || meta == TYPE_STRUCT || meta == TYPE_UNION || meta == TYPE_CODE || meta == TYPE_FLOAT)
|
||||
score = -5;
|
||||
else if (meta == TYPE_PTR || meta == TYPE_BOOL)
|
||||
@ -717,6 +718,7 @@ void ScoreUnionFields::scoreTrialUp(const Trial &trial,bool lastLevel)
|
||||
case CPUI_INT_AND:
|
||||
case CPUI_INT_OR:
|
||||
case CPUI_POPCOUNT:
|
||||
case CPUI_LZCOUNT:
|
||||
if (meta == TYPE_ARRAY || meta == TYPE_STRUCT || meta == TYPE_UNION || meta == TYPE_CODE || meta == TYPE_FLOAT)
|
||||
score = -5;
|
||||
else if (meta == TYPE_PTR || meta == TYPE_BOOL)
|
||||
|
@ -73,7 +73,8 @@
|
||||
/* Pull parsers. */
|
||||
#define YYPULL 1
|
||||
|
||||
|
||||
/* Substitute the type names. */
|
||||
#define YYSTYPE XMLSTYPE
|
||||
/* Substitute the variable and function names. */
|
||||
#define yyparse xmlparse
|
||||
#define yylex xmllex
|
||||
@ -85,7 +86,7 @@
|
||||
#define yychar xmlchar
|
||||
|
||||
/* Copy the first part of user declarations. */
|
||||
#line 16 "src/decompile/cpp/xml.y" /* yacc.c:339 */
|
||||
|
||||
|
||||
#include "xml.hh"
|
||||
// CharData mode look for '<' '&' or "]]>"
|
||||
@ -179,16 +180,15 @@ struct NameValue {
|
||||
string *value; ///< The value
|
||||
};
|
||||
|
||||
extern int yylex(void); ///< Interface to the scanner
|
||||
extern int yyerror(const char *str); ///< Interface for registering an error in parsing
|
||||
extern int xmllex(void); ///< Interface to the scanner
|
||||
extern int xmlerror(const char *str); ///< Interface for registering an error in parsing
|
||||
extern void print_content(const string &str); ///< Send character data to the ContentHandler
|
||||
extern int4 convertEntityRef(const string &ref); ///< Convert an XML entity to its equivalent character
|
||||
extern int4 convertCharRef(const string &ref); ///< Convert an XML character reference to its equivalent character
|
||||
static XmlScan *global_scan; ///< Global reference to the scanner
|
||||
static ContentHandler *handler; ///< Global reference to the content handler
|
||||
extern int yydebug; ///< Debug mode
|
||||
|
||||
#line 177 "src/decompile/cpp/xml.cc" /* yacc.c:339 */
|
||||
|
||||
|
||||
# ifndef YY_NULLPTR
|
||||
# if defined __cplusplus && 201103L <= __cplusplus
|
||||
@ -208,17 +208,25 @@ extern int yydebug; ///< Debug mode
|
||||
|
||||
|
||||
/* Debug traces. */
|
||||
#ifndef YYDEBUG
|
||||
# define YYDEBUG 0
|
||||
#endif
|
||||
#ifndef XMLDEBUG
|
||||
# if defined YYDEBUG
|
||||
#if YYDEBUG
|
||||
# define XMLDEBUG 1
|
||||
# else
|
||||
# define XMLDEBUG 0
|
||||
# endif
|
||||
# else /* ! defined YYDEBUG */
|
||||
# define XMLDEBUG 0
|
||||
# endif /* ! defined YYDEBUG */
|
||||
#endif /* ! defined XMLDEBUG */
|
||||
#if XMLDEBUG
|
||||
extern int xmldebug;
|
||||
#endif
|
||||
|
||||
/* Token type. */
|
||||
#ifndef YYTOKENTYPE
|
||||
# define YYTOKENTYPE
|
||||
enum yytokentype
|
||||
#ifndef XMLTOKENTYPE
|
||||
# define XMLTOKENTYPE
|
||||
enum xmltokentype
|
||||
{
|
||||
CHARDATA = 258,
|
||||
CDATA = 259,
|
||||
@ -233,27 +241,27 @@ extern int xmldebug;
|
||||
#endif
|
||||
|
||||
/* Value type. */
|
||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||
#if ! defined XMLSTYPE && ! defined XMLSTYPE_IS_DECLARED
|
||||
|
||||
union YYSTYPE
|
||||
union XMLSTYPE
|
||||
{
|
||||
#line 119 "src/decompile/cpp/xml.y" /* yacc.c:355 */
|
||||
|
||||
|
||||
int4 i;
|
||||
string *str;
|
||||
Attributes *attr;
|
||||
NameValue *pair;
|
||||
|
||||
#line 233 "src/decompile/cpp/xml.cc" /* yacc.c:355 */
|
||||
|
||||
};
|
||||
|
||||
typedef union YYSTYPE YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define YYSTYPE_IS_DECLARED 1
|
||||
typedef union XMLSTYPE XMLSTYPE;
|
||||
# define XMLSTYPE_IS_TRIVIAL 1
|
||||
# define XMLSTYPE_IS_DECLARED 1
|
||||
#endif
|
||||
|
||||
|
||||
extern YYSTYPE xmllval;
|
||||
extern XMLSTYPE xmllval;
|
||||
|
||||
int xmlparse (void);
|
||||
|
||||
@ -261,7 +269,7 @@ int xmlparse (void);
|
||||
|
||||
/* Copy the second part of user declarations. */
|
||||
|
||||
#line 250 "src/decompile/cpp/xml.cc" /* yacc.c:358 */
|
||||
|
||||
|
||||
#ifdef short
|
||||
# undef short
|
||||
@ -442,7 +450,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
|
||||
|
||||
#if (! defined yyoverflow \
|
||||
&& (! defined __cplusplus \
|
||||
|| (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
|
||||
|| (defined XMLSTYPE_IS_TRIVIAL && XMLSTYPE_IS_TRIVIAL)))
|
||||
|
||||
/* A type that is properly aligned for any stack member. */
|
||||
union yyalloc
|
||||
@ -555,7 +563,7 @@ static const yytype_uint8 yytranslate[] =
|
||||
5, 6, 7, 8, 9, 10, 11
|
||||
};
|
||||
|
||||
#if YYDEBUG
|
||||
#if XMLDEBUG
|
||||
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
|
||||
static const yytype_uint8 yyrline[] =
|
||||
{
|
||||
@ -570,7 +578,7 @@ static const yytype_uint8 yyrline[] =
|
||||
};
|
||||
#endif
|
||||
|
||||
#if YYDEBUG || YYERROR_VERBOSE || 0
|
||||
#if XMLDEBUG || YYERROR_VERBOSE || 0
|
||||
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
|
||||
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
|
||||
static const char *const yytname[] =
|
||||
@ -815,7 +823,7 @@ while (0)
|
||||
|
||||
|
||||
/* Enable debugging if requested. */
|
||||
#if YYDEBUG
|
||||
#if XMLDEBUG
|
||||
|
||||
# ifndef YYFPRINTF
|
||||
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
|
||||
@ -936,12 +944,12 @@ do { \
|
||||
/* Nonzero means print parse trace. It is left uninitialized so that
|
||||
multiple parsers can coexist. */
|
||||
int yydebug;
|
||||
#else /* !YYDEBUG */
|
||||
#else /* !XMLDEBUG */
|
||||
# define YYDPRINTF(Args)
|
||||
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
|
||||
# define YY_STACK_PRINT(Bottom, Top)
|
||||
# define YY_REDUCE_PRINT(Rule)
|
||||
#endif /* !YYDEBUG */
|
||||
#endif /* !XMLDEBUG */
|
||||
|
||||
|
||||
/* YYINITDEPTH -- initial size of the parser's stacks. */
|
||||
@ -1452,259 +1460,259 @@ yyreduce:
|
||||
switch (yyn)
|
||||
{
|
||||
case 10:
|
||||
#line 144 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = new string; global_scan->setmode(XmlScan::AttValueSingleMode); }
|
||||
#line 1443 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 11:
|
||||
#line 145 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); *(yyval.str) += *(yyvsp[0].str); delete (yyvsp[0].str); global_scan->setmode(XmlScan::AttValueSingleMode); }
|
||||
#line 1449 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 12:
|
||||
#line 146 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); *(yyval.str) += (yyvsp[0].i); global_scan->setmode(XmlScan::AttValueSingleMode); }
|
||||
#line 1455 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 13:
|
||||
#line 147 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = new string; global_scan->setmode(XmlScan::AttValueDoubleMode); }
|
||||
#line 1461 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 14:
|
||||
#line 148 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); *(yyval.str) += *(yyvsp[0].str); delete (yyvsp[0].str); global_scan->setmode(XmlScan::AttValueDoubleMode); }
|
||||
#line 1467 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 15:
|
||||
#line 149 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); *(yyval.str) += (yyvsp[0].i); global_scan->setmode(XmlScan::AttValueDoubleMode); }
|
||||
#line 1473 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 16:
|
||||
#line 150 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1479 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 17:
|
||||
#line 151 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1485 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 18:
|
||||
#line 152 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::NameMode); delete (yyvsp[0].str); }
|
||||
#line 1491 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 19:
|
||||
#line 153 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CommentMode); delete (yyvsp[-3].str); }
|
||||
#line 1497 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 20:
|
||||
#line 154 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ delete (yyvsp[-3].str); }
|
||||
#line 1503 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 21:
|
||||
#line 155 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ delete (yyvsp[-1].str); yyerror("Processing instructions are not supported"); YYERROR; }
|
||||
#line 1509 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 22:
|
||||
#line 156 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1515 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 23:
|
||||
#line 157 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CDataMode); delete (yyvsp[-8].str); }
|
||||
#line 1521 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
#line 168 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ delete (yyvsp[-8].str); yyerror("DTD's not supported"); YYERROR; }
|
||||
#line 1527 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 39:
|
||||
#line 176 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->setVersion(*(yyvsp[0].str)); delete (yyvsp[0].str); }
|
||||
#line 1533 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 40:
|
||||
#line 177 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->setEncoding(*(yyvsp[0].str)); delete (yyvsp[0].str); }
|
||||
#line 1539 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 46:
|
||||
#line 184 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->endElement((yyvsp[0].attr)->getelemURI(),(yyvsp[0].attr)->getelemName(),(yyvsp[0].attr)->getelemName()); delete (yyvsp[0].attr); }
|
||||
#line 1545 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 47:
|
||||
#line 185 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->endElement((yyvsp[-2].attr)->getelemURI(),(yyvsp[-2].attr)->getelemName(),(yyvsp[-2].attr)->getelemName()); delete (yyvsp[-2].attr); delete (yyvsp[0].str); }
|
||||
#line 1551 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 48:
|
||||
#line 187 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->startElement((yyvsp[-1].attr)->getelemURI(),(yyvsp[-1].attr)->getelemName(),(yyvsp[-1].attr)->getelemName(),*(yyvsp[-1].attr)); (yyval.attr) = (yyvsp[-1].attr); }
|
||||
#line 1557 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 49:
|
||||
#line 188 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->startElement((yyvsp[-2].attr)->getelemURI(),(yyvsp[-2].attr)->getelemName(),(yyvsp[-2].attr)->getelemName(),*(yyvsp[-2].attr)); (yyval.attr) = (yyvsp[-2].attr); }
|
||||
#line 1563 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 50:
|
||||
#line 189 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->startElement((yyvsp[-2].attr)->getelemURI(),(yyvsp[-2].attr)->getelemName(),(yyvsp[-2].attr)->getelemName(),*(yyvsp[-2].attr)); (yyval.attr) = (yyvsp[-2].attr); }
|
||||
#line 1569 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 51:
|
||||
#line 190 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ handler->startElement((yyvsp[-3].attr)->getelemURI(),(yyvsp[-3].attr)->getelemName(),(yyvsp[-3].attr)->getelemName(),*(yyvsp[-3].attr)); (yyval.attr) = (yyvsp[-3].attr); }
|
||||
#line 1575 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 52:
|
||||
#line 192 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.attr) = new Attributes((yyvsp[0].str)); global_scan->setmode(XmlScan::SNameMode); }
|
||||
#line 1581 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 53:
|
||||
#line 193 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.attr) = (yyvsp[-1].attr); (yyval.attr)->add_attribute( (yyvsp[0].pair)->name, (yyvsp[0].pair)->value); delete (yyvsp[0].pair); global_scan->setmode(XmlScan::SNameMode); }
|
||||
#line 1587 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 54:
|
||||
#line 194 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.pair) = new NameValue; (yyval.pair)->name = (yyvsp[-2].str); (yyval.pair)->value = (yyvsp[0].str); }
|
||||
#line 1593 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 55:
|
||||
#line 195 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::NameMode); delete (yyvsp[-1].str); }
|
||||
#line 1599 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 56:
|
||||
#line 196 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1605 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 57:
|
||||
#line 197 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-2].str); }
|
||||
#line 1611 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 58:
|
||||
#line 199 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1617 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 59:
|
||||
#line 200 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ print_content( *(yyvsp[0].str) ); delete (yyvsp[0].str); global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1623 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 60:
|
||||
#line 201 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1629 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 61:
|
||||
#line 202 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ string *tmp=new string(); *tmp += (yyvsp[0].i); print_content(*tmp); delete tmp; global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1635 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 62:
|
||||
#line 203 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ print_content( *(yyvsp[0].str) ); delete (yyvsp[0].str); global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1641 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 63:
|
||||
#line 204 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1647 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 64:
|
||||
#line 205 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CharDataMode); }
|
||||
#line 1653 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 65:
|
||||
#line 207 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.i) = convertEntityRef(*(yyvsp[0].str)); delete (yyvsp[0].str); }
|
||||
#line 1659 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 66:
|
||||
#line 208 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.i) = convertCharRef(*(yyvsp[0].str)); delete (yyvsp[0].str); }
|
||||
#line 1665 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 67:
|
||||
#line 210 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::NameMode); }
|
||||
#line 1671 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 68:
|
||||
#line 211 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ global_scan->setmode(XmlScan::CharRefMode); }
|
||||
#line 1677 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 69:
|
||||
#line 212 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1683 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
case 70:
|
||||
#line 213 "src/decompile/cpp/xml.y" /* yacc.c:1646 */
|
||||
|
||||
{ (yyval.str) = (yyvsp[-1].str); }
|
||||
#line 1689 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
break;
|
||||
|
||||
|
||||
#line 1693 "src/decompile/cpp/xml.cc" /* yacc.c:1646 */
|
||||
|
||||
default: break;
|
||||
}
|
||||
/* User semantic actions sometimes alter yychar, and that requires
|
||||
@ -1932,7 +1940,7 @@ yyreturn:
|
||||
#endif
|
||||
return yyresult;
|
||||
}
|
||||
#line 214 "src/decompile/cpp/xml.y" /* yacc.c:1906 */
|
||||
|
||||
|
||||
|
||||
XmlScan::XmlScan(istream &t) : s(t)
|
||||
@ -2217,7 +2225,7 @@ int4 convertCharRef(const string &ref)
|
||||
return val;
|
||||
}
|
||||
|
||||
int yylex(void)
|
||||
int xmllex(void)
|
||||
|
||||
{
|
||||
int res = global_scan->nexttoken();
|
||||
@ -2226,7 +2234,7 @@ int yylex(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
int yyerror(const char *str)
|
||||
int xmlerror(const char *str)
|
||||
|
||||
{
|
||||
handler->setError(str);
|
||||
|
@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
%define api.prefix {xml}
|
||||
%{
|
||||
#include "xml.hh"
|
||||
// CharData mode look for '<' '&' or "]]>"
|
||||
@ -106,14 +107,13 @@ struct NameValue {
|
||||
string *value; ///< The value
|
||||
};
|
||||
|
||||
extern int yylex(void); ///< Interface to the scanner
|
||||
extern int yyerror(const char *str); ///< Interface for registering an error in parsing
|
||||
extern int xmllex(void); ///< Interface to the scanner
|
||||
extern int xmlerror(const char *str); ///< Interface for registering an error in parsing
|
||||
extern void print_content(const string &str); ///< Send character data to the ContentHandler
|
||||
extern int4 convertEntityRef(const string &ref); ///< Convert an XML entity to its equivalent character
|
||||
extern int4 convertCharRef(const string &ref); ///< Convert an XML character reference to its equivalent character
|
||||
static XmlScan *global_scan; ///< Global reference to the scanner
|
||||
static ContentHandler *handler; ///< Global reference to the content handler
|
||||
extern int yydebug; ///< Debug mode
|
||||
%}
|
||||
|
||||
%union {
|
||||
@ -495,7 +495,7 @@ int4 convertCharRef(const string &ref)
|
||||
return val;
|
||||
}
|
||||
|
||||
int yylex(void)
|
||||
int xmllex(void)
|
||||
|
||||
{
|
||||
int res = global_scan->nexttoken();
|
||||
@ -504,7 +504,7 @@ int yylex(void)
|
||||
return res;
|
||||
}
|
||||
|
||||
int yyerror(const char *str)
|
||||
int xmlerror(const char *str)
|
||||
|
||||
{
|
||||
handler->setError(str);
|
||||
|
@ -0,0 +1,17 @@
|
||||
<decompilertest>
|
||||
<!-- Example of a "Count Leading Zeros" instruction (cntlzw) being used as a zero test -->
|
||||
<binaryimage arch="PowerPC:BE:32:default:default">
|
||||
<bytechunk space="ram" offset="0x10020" readonly="true">
|
||||
686300037c6300345463d97e4e800020
|
||||
</bytechunk>
|
||||
<symbol space="ram" offset="0x10020" name="cntlzwtest"/>
|
||||
</binaryimage>
|
||||
<script>
|
||||
<com>lo fu cntlzwtest</com>
|
||||
<com>decompile</com>
|
||||
<com>print C</com>
|
||||
<com>quit</com>
|
||||
</script>
|
||||
<stringmatch name = "Leading zeros count #1" min="1" max="1">return param_1 == 3;</stringmatch>
|
||||
<stringmatch name = "Leading zeros count #2" min="0" max="0">lzcount</stringmatch>
|
||||
</decompilertest>
|
@ -25,7 +25,7 @@
|
||||
|
||||
<xsl:param name="use.id.as.filename" select="1"/> <!-- Split up into files based on id attribute -->
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:param name="chunker.output.indent" select="'yes'"/> <!-- Do proper indenting of html -->
|
||||
|
||||
|
@ -40,11 +40,15 @@
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="body.attributes">
|
||||
<!-- Remove all BODY attributes so that CSS stylesheet can provide everything -->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:param name="suppress.navigation" select="1"/> <!-- Turn off header/footer navigation links -->
|
||||
|
||||
<xsl:param name="use.id.as.filename" select="1"/> <!-- Split up into files based on id attribute -->
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'../../shared/Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'help/shared/DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="0"/>
|
||||
|
||||
@ -54,5 +58,5 @@
|
||||
|
||||
<xsl:param name="admon.textlabel" select="0"/> <!-- Don't display title for important/note tags -->
|
||||
|
||||
<xsl:param name="admon.graphics.path" select="'../../shared/'"/>
|
||||
<xsl:param name="admon.graphics.path" select="'help/shared/'"/>
|
||||
</xsl:stylesheet>
|
||||
|
@ -35,6 +35,6 @@
|
||||
|
||||
<xsl:param name="admon.textlabel" select="0"/> <!-- Don't display title for important/note tags -->
|
||||
|
||||
<xsl:param name="admon.graphics.path" select="'../../../build/images'"/>
|
||||
<xsl:param name="admon.graphics.path" select="'../../../build/pdf/images/'"/>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -23,7 +23,7 @@
|
||||
set toc,title
|
||||
</xsl:param>
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'html/Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'html/DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:output method="html"
|
||||
encoding="UTF8"
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<xsl:param name="use.id.as.filename" select="1"/> <!-- Split up into files based on id attribute -->
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:param name="chunker.output.indent" select="'yes'"/> <!-- Do proper indenting of html -->
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<xsl:param name="use.id.as.filename" select="1"/> <!-- Split up into files based on id attribute -->
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:param name="chunker.output.indent" select="'yes'"/> <!-- Do proper indenting of html -->
|
||||
|
||||
|
@ -3,14 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Program Annotations Affecting the Decompiler</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="up" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="prev" href="DecompilerConcepts.html" title="Decompiler Concepts">
|
||||
<link rel="next" href="DecompilerOptions.html" title="Decompiler Options">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="DecompilerAnnotations"></a>Program Annotations Affecting the Decompiler</h1></div></div></div>
|
||||
|
||||
|
@ -3,14 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Decompiler Concepts</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="up" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="prev" href="DecompilerIntro.html" title="Decompiler">
|
||||
<link rel="next" href="DecompilerAnnotations.html" title="Program Annotations Affecting the Decompiler">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="DecompilerConcepts"></a>Decompiler Concepts</h1></div></div></div>
|
||||
|
||||
@ -182,7 +182,7 @@
|
||||
</p>
|
||||
<div class="informalexample">
|
||||
<div class="table">
|
||||
<a name="ops.htmltable"></a><p class="title"><b>Table<EFBFBD>.<2E>P-code Operations</b></p>
|
||||
<a name="ops.htmltable"></a><p class="title"><b>Table . P-code Operations</b></p>
|
||||
<div class="table-contents"><table width="90%" frame="box" rules="all" id="ops.htmltable">
|
||||
|
||||
<col width="40%">
|
||||
|
@ -3,14 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Decompiler</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="up" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="prev" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="next" href="DecompilerConcepts.html" title="Decompiler Concepts">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="DecompilerIntro"></a>Decompiler</h1></div></div></div>
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
<li class="listitem" style="list-style-type: disc">
|
||||
Press the <span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/decompileFunction.gif" width="16" height="16"></span>
|
||||
</span><EFBFBD>icon
|
||||
</span> icon
|
||||
in the tool bar, <span class="emphasis"><em>or</em></span>
|
||||
</li>
|
||||
<li class="listitem" style="list-style-type: disc">
|
||||
|
@ -3,14 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Decompiler Options</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="up" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="prev" href="DecompilerAnnotations.html" title="Program Annotations Affecting the Decompiler">
|
||||
<link rel="next" href="DecompilerWindow.html" title="Decompiler Window">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="DecompilerOptions"></a>Decompiler Options</h1></div></div></div>
|
||||
|
||||
@ -40,12 +40,12 @@
|
||||
<li class="listitem" style="list-style-type: none">
|
||||
 <span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/document-properties.png" width="16" height="16"></span>
|
||||
</span><EFBFBD><span class="emphasis"><em>Analysis</em></span> - lists <a class="xref" href="DecompilerOptions.html#AnalysisOptions" title="Analysis Options">Analysis Options</a> that affect the Decompiler's transformation process.
|
||||
</span> <span class="emphasis"><em>Analysis</em></span> - lists <a class="xref" href="DecompilerOptions.html#AnalysisOptions" title="Analysis Options">Analysis Options</a> that affect the Decompiler's transformation process.
|
||||
</li>
|
||||
<li class="listitem" style="list-style-type: none">
|
||||
 <span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/document-properties.png" width="16" height="16"></span>
|
||||
</span><EFBFBD><span class="emphasis"><em>Display</em></span> - lists <a class="xref" href="DecompilerOptions.html#DisplayOptions" title="Display Options">Display Options</a> that affect the final presentation of Decompiler output.
|
||||
</span> <span class="emphasis"><em>Display</em></span> - lists <a class="xref" href="DecompilerOptions.html#DisplayOptions" title="Display Options">Display Options</a> that affect the final presentation of Decompiler output.
|
||||
</li>
|
||||
</ul></div>
|
||||
</div>
|
||||
|
@ -3,13 +3,13 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Decompiler Window</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="up" href="Decompiler.html" title="Decompiler">
|
||||
<link rel="prev" href="DecompilerOptions.html" title="Decompiler Options">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="DecompilerWindow"></a>Decompiler Window</h1></div></div></div>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
function in the Code Browser, then select the
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/decompileFunction.gif" width="16" height="16"></span>
|
||||
</span><EFBFBD>icon from the tool bar, or the
|
||||
</span> icon from the tool bar, or the
|
||||
<span class="bold"><strong>Decompile</strong></span> option from the
|
||||
<span class="bold"><strong>Window</strong></span> menu in the tool.
|
||||
</p>
|
||||
@ -91,7 +91,7 @@
|
||||
Initially pressing
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/decompileFunction.gif" width="16" height="16"></span>
|
||||
</span><EFBFBD>or selecting
|
||||
</span> or selecting
|
||||
<span class="bold"><strong>Decompile</strong></span> from the <span class="bold"><strong>Window</strong></span> menu in the tool
|
||||
brings up the <span class="emphasis"><em>main</em></span> window. The main window always displays the function
|
||||
at the <span class="emphasis"><em>current address</em></span> within the Code Browser and follows as the user navigates
|
||||
@ -153,7 +153,7 @@
|
||||
Pressing the
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/camera-photo.png" width="16" height="16"></span>
|
||||
</span><EFBFBD>icon
|
||||
</span> icon
|
||||
in any Decompiler window's toolbar causes a <span class="emphasis"><em>Snapshot</em></span> window
|
||||
to be created, which shows decompilation of the same function.
|
||||
Unlike the <span class="emphasis"><em>main</em></span> window however, the <span class="emphasis"><em>Snapshot</em></span> window
|
||||
@ -240,7 +240,7 @@
|
||||
<p>
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/page_edit.png" width="16" height="16"></span>
|
||||
</span><EFBFBD>- button
|
||||
</span> - button
|
||||
</p>
|
||||
<p>
|
||||
Exports the decompiled result of the current function to a file. A file chooser
|
||||
@ -265,7 +265,7 @@
|
||||
<p>
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/camera-photo.png" width="16" height="16"></span>
|
||||
</span><EFBFBD>- button
|
||||
</span> - button
|
||||
</p>
|
||||
<p>
|
||||
Creates a new <span class="emphasis"><em>Snapshot</em></span> window. The <span class="emphasis"><em>Snapshot</em></span> window
|
||||
@ -282,7 +282,7 @@
|
||||
<p>
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/reload3.png" width="16" height="16"></span>
|
||||
</span><EFBFBD>- button
|
||||
</span> - button
|
||||
</p>
|
||||
<p>
|
||||
Triggers a re-decompilation of the current function displayed in the window.
|
||||
@ -310,7 +310,7 @@
|
||||
<p>
|
||||
<span class="guiicon">
|
||||
<span class="inlinemediaobject"><img src="images/page_white_copy.png" width="16" height="16"></span>
|
||||
</span><EFBFBD>- button
|
||||
</span> - button
|
||||
</p>
|
||||
<p>
|
||||
Copies the currently selected text in the Decompiler window to the clipboard.
|
||||
|
@ -62,7 +62,7 @@ task unpackFidDatabases {
|
||||
// Relative to the 'workingDir' Exec task property.
|
||||
def installPoint = "../help/help"
|
||||
|
||||
task buildFidDocumentationPdf(type: Exec) {
|
||||
task buildFidHelpPdf(type: Exec) {
|
||||
|
||||
workingDir 'src/main/doc'
|
||||
|
||||
@ -91,7 +91,7 @@ task buildFidDocumentationPdf(type: Exec) {
|
||||
cp $installPoint/topics/FunctionID/images/*.png $buildDir/images
|
||||
|
||||
echo '** Building FunctionID.fo **'
|
||||
xsltproc --output $buildDir/fid_withscaling.xml --stringparam profile.condition "withscaling" /usr/share/sgml/docbook/xsl-stylesheets/profiling/profile.xsl fid.xml 2>&1
|
||||
xsltproc --output $buildDir/fid_withscaling.xml --stringparam profile.condition "withscaling" commonprofile.xsl fid.xml 2>&1
|
||||
xsltproc --output $buildDir/FunctionID.fo fid_pdf.xsl $buildDir/fid_withscaling.xml 2>&1
|
||||
|
||||
echo '** Building FunctionID.pdf **'
|
||||
@ -137,10 +137,12 @@ task buildFidDocumentationPdf(type: Exec) {
|
||||
* A build (ex: 'gradle buildLocal') will place the html files in the distribution.
|
||||
* There is an associated, auto-generated clean task.
|
||||
**/
|
||||
task buildFidDocumentationHtml(type: Exec) {
|
||||
task buildFidHelpHtml(type: Exec) {
|
||||
|
||||
workingDir 'src/main/doc'
|
||||
|
||||
def buildDir = "../../../build/html"
|
||||
|
||||
// 'which' returns the number of failed arguments
|
||||
// Using the 'which' command first will allow the task to fail if the required
|
||||
// executables are not installed.
|
||||
@ -158,9 +160,10 @@ task buildFidDocumentationHtml(type: Exec) {
|
||||
rm -f $installPoint/topics/FunctionID/*.html
|
||||
|
||||
echo '** Building html files **'
|
||||
xsltproc --output $buildDir/fid_noscaling.xml --stringparam profile.condition "noscaling" /usr/share/sgml/docbook/xsl-stylesheets/profiling/profile.xsl fid.xml 2>&1
|
||||
xsltproc --output $buildDir/fid_noscaling.xml --stringparam profile.condition "noscaling" commonprofile.xsl fid.xml 2>&1
|
||||
xsltproc --stringparam base.dir ${installPoint}/topics/FunctionID/ fid_html.xsl $buildDir/fid_noscaling.xml 2>&1
|
||||
sed -i -e '/Frontpage.css/ { p; s/Frontpage.css/languages.css/; }' ${installPoint}/topics/FunctionID/*.html
|
||||
rm ${installPoint}/topics/FunctionID/index.html
|
||||
sed -i -e '/DefaultStyle.css/ { p; sQhref=".*"Qhref="../../shared/languages.css"Q; }' ${installPoint}/topics/FunctionID/*.html
|
||||
|
||||
echo '** Done. **'
|
||||
"""
|
||||
|
@ -4,6 +4,7 @@ Module.manifest||GHIDRA||||END|
|
||||
data/building_fid.txt||GHIDRA||||END|
|
||||
data/common_symbols_win32.txt||GHIDRA|||Symbols used to generate fiddb files distributed with Ghidra|END|
|
||||
data/common_symbols_win64.txt||GHIDRA|||Symbols used to generate fiddb files distributed with Ghidra|END|
|
||||
src/main/doc/commonprofile.xsl||GHIDRA||||END|
|
||||
src/main/doc/fid.xml||GHIDRA||||END|
|
||||
src/main/doc/fid_common.xsl||GHIDRA||||END|
|
||||
src/main/doc/fid_html.xsl||GHIDRA||||END|
|
||||
|
@ -0,0 +1,6 @@
|
||||
<?xml version='1.0'?>
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/profiling/profile.xsl"/>
|
||||
</xsl:stylesheet>
|
@ -41,7 +41,7 @@ from Microsoft Visual Studio for the x86 processor. These have been broken apart
|
||||
separate Function ID databases, based on 32-bit or 64-code and the version of Visual Studio.
|
||||
Within each database, there are a two library variants -- one for debug versions and one for production.
|
||||
</para>
|
||||
<sect2>
|
||||
<sect2 id="hashing">
|
||||
<title>Hashing</title>
|
||||
<para>
|
||||
Function ID works by calculating a cumulative hash over all the machine <emphasis>instructions</emphasis>
|
||||
@ -82,7 +82,7 @@ is robust against changes due to linking; the <emphasis role="bold">specific has
|
||||
helps distinguish between closely related variants of a function.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="parentchild">
|
||||
<title>Parents and Children</title>
|
||||
<para>
|
||||
When Function ID examines a function, its parent and child functions are also considered
|
||||
@ -92,7 +92,7 @@ the full hashes of the functions will be identical, but the system will try to m
|
||||
the two subfunctions, allowing it to distinguish between the two.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="libraries">
|
||||
<title>Libraries</title>
|
||||
<para>
|
||||
Within a Function ID database, functions are grouped into <emphasis>libraries</emphasis>,
|
||||
@ -144,7 +144,7 @@ the analyzer will still report a single match but will leave off the fields it
|
||||
couldn't distinguish.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="singlematches">
|
||||
<title>Single Matches</title>
|
||||
<para>
|
||||
A <emphasis role="bold">Single Match</emphasis> for a function occurs under the following conditions:
|
||||
@ -283,7 +283,7 @@ increasing its overall score.
|
||||
If there are still more than one potential match, the highest assigned score is
|
||||
used to filter out matches with lower scores.
|
||||
</para>
|
||||
<sect2>
|
||||
<sect2 id="matchingfunction">
|
||||
<title>Matching Function Names</title>
|
||||
<para>
|
||||
If there are still multiple potential matches once thresholds have been applied to the
|
||||
@ -416,7 +416,7 @@ to populate the database.
|
||||
<imagedata condition="withscaling" fileref="images/PopulateFidDbFromPrograms1.png" width="100%" contentwidth="4in" contentdepth="3.033175in" align="center"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
<sect3>
|
||||
<sect3 id="dialogfields">
|
||||
<title>Dialog Fields</title>
|
||||
<para>
|
||||
<informalexample>
|
||||
@ -519,7 +519,7 @@ most commonly called within the library. This list can be used to create a
|
||||
</section>
|
||||
<section id="preparelibraries">
|
||||
<title>Preparing Libraries for a Function ID Database</title>
|
||||
<sect2>
|
||||
<sect2 id="programlocation">
|
||||
<title>Location of Programs</title>
|
||||
<para>
|
||||
All functions going into a single Function ID <emphasis>Library</emphasis> must already be imported and analyzed
|
||||
@ -530,7 +530,7 @@ the root for the library. The process acts recursively, so there can be addition
|
||||
but all programs to be included in the library must be under the one root.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="analysis">
|
||||
<title>Analysis</title>
|
||||
<para>
|
||||
All programs must be analyzed enough to have recovered the bodies of all the functions that are to be included
|
||||
@ -572,7 +572,7 @@ function that is declared as a match by the analyzer but has the incorrect symbo
|
||||
As with any classification algorithm, it is generally not possible to eliminate this kind
|
||||
of error completely, but with Function ID there are some mitigation strategies.
|
||||
</para>
|
||||
<sect2>
|
||||
<sect2 id="causes">
|
||||
<title>Causes</title>
|
||||
<para>
|
||||
False positives for the most part only happen with small functions.
|
||||
@ -611,7 +611,7 @@ There are two related causes with Function ID:
|
||||
In either case, Function ID can apply a symbol that is misleading for the analyst.
|
||||
</para>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="mitigation">
|
||||
<title>Mitigation via Threshold</title>
|
||||
<para>
|
||||
All mitigation strategies, to some extent, trade-off false positives for
|
||||
@ -758,7 +758,7 @@ section and check the box next to "FidDebugPlugin".
|
||||
The Function ID Debug Plug-in introduces the following actions to the
|
||||
<emphasis role="bold">Tools -> Function ID</emphasis> menu.
|
||||
</para>
|
||||
<sect2>
|
||||
<sect2 id="readonly">
|
||||
<title>Create Read-only Database</title>
|
||||
<para>
|
||||
Users can convert the read/write (.fidb) database into the a read-only (.fidbf) form. This is
|
||||
@ -787,7 +787,7 @@ the <command>RETURN</command> key, with the cursor and focus still in the desire
|
||||
<imagedata condition="withscaling" fileref="images/FIDSearch.png" width="100%" contentwidth="4in" contentdepth="3.3397in" align="center"/>
|
||||
</imageobject>
|
||||
</mediaobject>
|
||||
<sect3>
|
||||
<sect3 id="searchfields">
|
||||
<title>Search Fields</title>
|
||||
<para>
|
||||
<informalexample>
|
||||
@ -845,7 +845,7 @@ the <command>RETURN</command> key, with the cursor and focus still in the desire
|
||||
</informalexample>
|
||||
</para>
|
||||
</sect3>
|
||||
<sect3>
|
||||
<sect3 id="resultwindow">
|
||||
<title>Result Window</title>
|
||||
<para>
|
||||
Invoking a search will bring up the <emphasis>Result Window</emphasis>, presenting a row for
|
||||
@ -901,7 +901,7 @@ other columns:
|
||||
</variablelist>
|
||||
</informalexample>
|
||||
</para>
|
||||
<sect4>
|
||||
<sect4 id="editmenu">
|
||||
<title>Edit Menu</title>
|
||||
<para>
|
||||
The <emphasis>Result Window</emphasis> supports a small number of actions under the
|
||||
@ -962,7 +962,7 @@ strategy.
|
||||
</sect4>
|
||||
</sect3>
|
||||
</sect2>
|
||||
<sect2>
|
||||
<sect2 id="tableviewer">
|
||||
<title>Table Viewer</title>
|
||||
<para>
|
||||
This invokes an extremely low-level view into the underlying tables that back a
|
||||
|
@ -2,7 +2,7 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/html/chunk.xsl"/>
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
|
||||
|
||||
<xsl:include href="fid_common.xsl" />
|
||||
|
||||
@ -40,9 +40,15 @@
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="body.attributes">
|
||||
<!-- Remove all BODY attributes so that CSS stylesheet can provide everything -->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:param name="suppress.navigation" select="1"/> <!-- Turn off header/footer navigation links -->
|
||||
|
||||
<xsl:param name="use.id.as.filename" select="1"/> <!-- Split up into files based on id attribute -->
|
||||
|
||||
<xsl:param name="html.stylesheet" select="'../../shared/Frontpage.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
<xsl:param name="html.stylesheet" select="'help/shared/DefaultStyle.css'"/> <!-- Use our custom cascading style sheet -->
|
||||
|
||||
<xsl:param name="chunk.section.depth" select="0"/>
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
|
||||
<xsl:import href="/usr/share/sgml/docbook/xsl-stylesheets/fo/docbook.xsl"/>
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
|
||||
|
||||
<xsl:template match="table" mode="label.markup"/>
|
||||
|
||||
|
@ -3,24 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Function ID</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="index.html" title="Function ID">
|
||||
<link rel="up" href="index.html" title="Function ID">
|
||||
<link rel="prev" href="index.html" title="Function ID">
|
||||
<link rel="next" href="FunctionIDPlugin.html" title="Function ID Plug-in">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<div class="navheader">
|
||||
<table width="100%" summary="Navigation header">
|
||||
<tr><th colspan="3" align="center">Function ID</th></tr>
|
||||
<tr>
|
||||
<td width="20%" align="left"></td>
|
||||
<th width="60%" align="center"><EFBFBD></th>
|
||||
<td width="20%" align="right"><EFBFBD><a accesskey="n" href="FunctionIDPlugin.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="FunctionID"></a>Function ID</h1></div></div></div>
|
||||
<div class="mediaobject" align="center"><table border="0" summary="manufactured viewport for HTML img" style="cellpadding: 0; cellspacing: 0;" width="100%"><tr><td align="center"><img src="images/FIDmatch.png" align="middle" width="723" height="267"></td></tr></table></div>
|
||||
@ -57,7 +47,7 @@ Within each database, there are a two library variants -- one for debug versions
|
||||
</p>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472630336"></a>Hashing</h3></div></div></div>
|
||||
<a name="hashing"></a>Hashing</h3></div></div></div>
|
||||
<p>
|
||||
Function ID works by calculating a cumulative hash over all the machine <span class="emphasis"><em>instructions</em></span>
|
||||
that make up the body of a function. For each function, two different 64-bit hashes are computed: a
|
||||
@ -90,7 +80,7 @@ helps distinguish between closely related variants of a function.
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472620992"></a>Parents and Children</h3></div></div></div>
|
||||
<a name="parentchild"></a>Parents and Children</h3></div></div></div>
|
||||
<p>
|
||||
When Function ID examines a function, its parent and child functions are also considered
|
||||
as a way of disambiguating multiple matches. For example, suppose two functions have identical
|
||||
@ -101,7 +91,7 @@ the two subfunctions, allowing it to distinguish between the two.
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472619376"></a>Libraries</h3></div></div></div>
|
||||
<a name="libraries"></a>Libraries</h3></div></div></div>
|
||||
<p>
|
||||
Within a Function ID database, functions are grouped into <span class="emphasis"><em>libraries</em></span>,
|
||||
which are intended to be recognizable named software components
|
||||
@ -141,7 +131,7 @@ couldn't distinguish.
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472607824"></a>Single Matches</h3></div></div></div>
|
||||
<a name="singlematches"></a>Single Matches</h3></div></div></div>
|
||||
<p>
|
||||
A <span class="bold"><strong>Single Match</strong></span> for a function occurs under the following conditions:
|
||||
</p>
|
||||
@ -268,7 +258,7 @@ used to filter out matches with lower scores.
|
||||
</p>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472572880"></a>Matching Function Names</h3></div></div></div>
|
||||
<a name="matchingfunction"></a>Matching Function Names</h3></div></div></div>
|
||||
<p>
|
||||
If there are still multiple potential matches once thresholds have been applied to the
|
||||
match scores, the remaining matches will be grouped based on function names. If
|
||||
@ -284,22 +274,5 @@ parameter information is stripped.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navfooter">
|
||||
<hr>
|
||||
<table width="100%" summary="Navigation footer">
|
||||
<tr>
|
||||
<td width="40%" align="left"></td>
|
||||
<td width="20%" align="center"><EFBFBD></td>
|
||||
<td width="40%" align="right"><EFBFBD><a accesskey="n" href="FunctionIDPlugin.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%" align="left" valign="top">Function ID<49></td>
|
||||
<td width="20%" align="center"></td>
|
||||
<td width="40%" align="right" valign="top"><EFBFBD>Function ID Plug-in</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</div></body>
|
||||
</html>
|
||||
|
@ -3,24 +3,13 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Function ID Debug Plug-in</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="index.html" title="Function ID">
|
||||
<link rel="up" href="index.html" title="Function ID">
|
||||
<link rel="prev" href="FunctionIDPlugin.html" title="Function ID Plug-in">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<div class="navheader">
|
||||
<table width="100%" summary="Navigation header">
|
||||
<tr><th colspan="3" align="center">Function ID Debug Plug-in</th></tr>
|
||||
<tr>
|
||||
<td width="20%" align="left">
|
||||
<a accesskey="p" href="FunctionIDPlugin.html">Prev</a><EFBFBD></td>
|
||||
<th width="60%" align="center"><EFBFBD></th>
|
||||
<td width="20%" align="right"><EFBFBD></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="FunctionIDDebug"></a>Function ID Debug Plug-in</h1></div></div></div>
|
||||
<p>
|
||||
@ -54,7 +43,7 @@ The Function ID Debug Plug-in introduces the following actions to the
|
||||
</p>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472459600"></a>Create Read-only Database</h3></div></div></div>
|
||||
<a name="readonly"></a>Create Read-only Database</h3></div></div></div>
|
||||
<p>
|
||||
Users can convert the read/write (.fidb) database into the a read-only (.fidbf) form. This is
|
||||
the more efficient final form used directly by the Function ID analyzer. The .fidbf form is
|
||||
@ -80,7 +69,7 @@ the <span class="command"><strong>RETURN</strong></span> key, with the cursor an
|
||||
<div class="mediaobject" align="center"><table border="0" summary="manufactured viewport for HTML img" style="cellpadding: 0; cellspacing: 0;" width="100%"><tr><td align="center"><img src="images/FIDSearch.png" align="middle" width="315" height="263"></td></tr></table></div>
|
||||
<div class="sect3">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="idm140323472451184"></a>Search Fields</h4></div></div></div>
|
||||
<a name="searchfields"></a>Search Fields</h4></div></div></div>
|
||||
<p>
|
||||
</p>
|
||||
<div class="informalexample"><div class="variablelist"><dl class="variablelist">
|
||||
@ -118,7 +107,7 @@ the <span class="command"><strong>RETURN</strong></span> key, with the cursor an
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="idm140323472437088"></a>Result Window</h4></div></div></div>
|
||||
<a name="resultwindow"></a>Result Window</h4></div></div></div>
|
||||
<p>
|
||||
Invoking a search will bring up the <span class="emphasis"><em>Result Window</em></span>, presenting a row for
|
||||
each matching function record. Columns list properties of the function and correspond
|
||||
@ -162,7 +151,7 @@ other columns:
|
||||
</p>
|
||||
<div class="sect4">
|
||||
<div class="titlepage"><div><div><h5 class="title">
|
||||
<a name="idm140323472422400"></a>Edit Menu</h5></div></div></div>
|
||||
<a name="editmenu"></a>Edit Menu</h5></div></div></div>
|
||||
<p>
|
||||
The <span class="emphasis"><em>Result Window</em></span> supports a small number of actions under the
|
||||
<span class="bold"><strong>Edit</strong></span> menu that allow the user to change the
|
||||
@ -203,7 +192,7 @@ strategy.
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472406032"></a>Table Viewer</h3></div></div></div>
|
||||
<a name="tableviewer"></a>Table Viewer</h3></div></div></div>
|
||||
<p>
|
||||
This invokes an extremely low-level view into the underlying tables that back a
|
||||
Function ID database. It can be invoked on any attached database. A window is brought up
|
||||
@ -214,22 +203,5 @@ present readable values. The only meaningful table is likely to be the
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navfooter">
|
||||
<hr>
|
||||
<table width="100%" summary="Navigation footer">
|
||||
<tr>
|
||||
<td width="40%" align="left">
|
||||
<a accesskey="p" href="FunctionIDPlugin.html">Prev</a><EFBFBD></td>
|
||||
<td width="20%" align="center"><EFBFBD></td>
|
||||
<td width="40%" align="right"><EFBFBD></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%" align="left" valign="top">Function ID Plug-in<69></td>
|
||||
<td width="20%" align="center"></td>
|
||||
<td width="40%" align="right" valign="top"><EFBFBD></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</div></body>
|
||||
</html>
|
||||
|
@ -3,26 +3,14 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Function ID Plug-in</title>
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="help/shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
|
||||
<link rel="stylesheet" type="text/css" href="../../shared/languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="index.html" title="Function ID">
|
||||
<link rel="up" href="index.html" title="Function ID">
|
||||
<link rel="prev" href="FunctionID.html" title="Function ID">
|
||||
<link rel="next" href="FunctionIDDebug.html" title="Function ID Debug Plug-in">
|
||||
</head>
|
||||
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||
<div class="navheader">
|
||||
<table width="100%" summary="Navigation header">
|
||||
<tr><th colspan="3" align="center">Function ID Plug-in</th></tr>
|
||||
<tr>
|
||||
<td width="20%" align="left">
|
||||
<a accesskey="p" href="FunctionID.html">Prev</a><EFBFBD></td>
|
||||
<th width="60%" align="center"><EFBFBD></th>
|
||||
<td width="20%" align="right"><EFBFBD><a accesskey="n" href="FunctionIDDebug.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="chapter">
|
||||
<body><div class="chapter">
|
||||
<div class="titlepage"><div><div><h1 class="title">
|
||||
<a name="FunctionIDPlugin"></a>Function ID Plug-in</h1></div></div></div>
|
||||
<p>
|
||||
@ -132,7 +120,7 @@ to populate the database.
|
||||
<div class="mediaobject" align="center"><table border="0" summary="manufactured viewport for HTML img" style="cellpadding: 0; cellspacing: 0;" width="100%"><tr><td align="center"><img src="images/PopulateFidDbFromPrograms1.png" align="middle" width="422" height="320"></td></tr></table></div>
|
||||
<div class="sect3">
|
||||
<div class="titlepage"><div><div><h4 class="title">
|
||||
<a name="idm140323472541088"></a>Dialog Fields</h4></div></div></div>
|
||||
<a name="dialogfields"></a>Dialog Fields</h4></div></div></div>
|
||||
<p>
|
||||
</p>
|
||||
<div class="informalexample"><div class="variablelist"><dl class="variablelist">
|
||||
@ -204,7 +192,7 @@ most commonly called within the library. This list can be used to create a
|
||||
<a name="preparelibraries"></a>Preparing Libraries for a Function ID Database</h2></div></div></div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472516592"></a>Location of Programs</h3></div></div></div>
|
||||
<a name="programlocation"></a>Location of Programs</h3></div></div></div>
|
||||
<p>
|
||||
All functions going into a single Function ID <span class="emphasis"><em>Library</em></span> must already be imported and analyzed
|
||||
somewhere within a single Ghidra repository (shared or non-shared). Multiple libraries contained within
|
||||
@ -216,7 +204,7 @@ but all programs to be included in the library must be under the one root.
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472513952"></a>Analysis</h3></div></div></div>
|
||||
<a name="analysis"></a>Analysis</h3></div></div></div>
|
||||
<p>
|
||||
All programs must be analyzed enough to have recovered the bodies of all the functions that are to be included
|
||||
in the library. Generally, the easiest way to accomplish this is to run Ghidra's default auto-analysis.
|
||||
@ -260,7 +248,7 @@ of error completely, but with Function ID there are some mitigation strategies.
|
||||
</p>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472502064"></a>Causes</h3></div></div></div>
|
||||
<a name="causes"></a>Causes</h3></div></div></div>
|
||||
<p>
|
||||
False positives for the most part only happen with small functions.
|
||||
There are two related causes with Function ID:
|
||||
@ -291,7 +279,7 @@ In either case, Function ID can apply a symbol that is misleading for the analys
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<div class="titlepage"><div><div><h3 class="title">
|
||||
<a name="idm140323472493552"></a>Mitigation via Threshold</h3></div></div></div>
|
||||
<a name="mitigation"></a>Mitigation via Threshold</h3></div></div></div>
|
||||
<p>
|
||||
All mitigation strategies, to some extent, trade-off false positives for
|
||||
<span class="bold"><strong>false negatives</strong></span>, which are functions that should have
|
||||
@ -391,23 +379,5 @@ script.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navfooter">
|
||||
<hr>
|
||||
<table width="100%" summary="Navigation footer">
|
||||
<tr>
|
||||
<td width="40%" align="left">
|
||||
<a accesskey="p" href="FunctionID.html">Prev</a><EFBFBD></td>
|
||||
<td width="20%" align="center"><EFBFBD></td>
|
||||
<td width="40%" align="right"><EFBFBD><a accesskey="n" href="FunctionIDDebug.html">Next</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%" align="left" valign="top">Function ID<49></td>
|
||||
<td width="20%" align="center"></td>
|
||||
<td width="40%" align="right" valign="top"><EFBFBD>Function ID Debug Plug-in</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</div></body>
|
||||
</html>
|
||||
|
@ -42,7 +42,21 @@ public class OpBehaviorLzcount extends UnaryOpBehavior {
|
||||
|
||||
@Override
|
||||
public BigInteger evaluateUnary(int sizeout, int sizein, BigInteger unsignedIn1) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
int bitcount = 0;
|
||||
sizein = sizein * 8 - 1;
|
||||
while (sizein >= 0) {
|
||||
if (unsignedIn1.testBit(sizein)) {
|
||||
break;
|
||||
}
|
||||
bitcount += 1;
|
||||
sizein -= 1;
|
||||
}
|
||||
if (sizeout == 1) {
|
||||
bitcount &= 0xff;
|
||||
}
|
||||
else if (sizeout == 2) {
|
||||
bitcount &= 0xffff;
|
||||
}
|
||||
return BigInteger.valueOf(bitcount);
|
||||
}
|
||||
}
|
||||
|
@ -39,8 +39,26 @@ public class OpBehaviorPopcount extends UnaryOpBehavior {
|
||||
|
||||
@Override
|
||||
public BigInteger evaluateUnary(int sizeout, int sizein, BigInteger unsignedIn1) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
int bitcount = 0;
|
||||
while (sizein >= 8) {
|
||||
bitcount += evaluateUnary(1, 8, unsignedIn1.longValue());
|
||||
sizein -= 8;
|
||||
if (sizein == 0) {
|
||||
break;
|
||||
}
|
||||
unsignedIn1 = unsignedIn1.shiftRight(64);
|
||||
}
|
||||
if (sizein > 0) {
|
||||
long mask = sizein * 8 - 1;
|
||||
bitcount += evaluateUnary(1, 8, unsignedIn1.longValue() & mask);
|
||||
}
|
||||
if (sizeout == 1) {
|
||||
bitcount &= 0xff;
|
||||
}
|
||||
else if (sizeout == 2) {
|
||||
bitcount &= 0xffff;
|
||||
}
|
||||
return BigInteger.valueOf(bitcount);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,91 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.pcode.opbehavior;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import ghidra.pcode.utils.Utils;
|
||||
|
||||
public class OpBehaviorLzcountTest extends AbstractOpBehaviorTest {
|
||||
@Test
|
||||
public void testEvaluateUnaryLong() {
|
||||
|
||||
OpBehaviorLzcount op = new OpBehaviorLzcount();
|
||||
|
||||
Assert.assertEquals(8, op.evaluateUnary(1, 1, 0L));
|
||||
Assert.assertEquals(16, op.evaluateUnary(1, 2, 0L));
|
||||
Assert.assertEquals(32, op.evaluateUnary(1, 4, 0L));
|
||||
Assert.assertEquals(64, op.evaluateUnary(1, 8, 0L));
|
||||
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 1, 0xffL));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 2, 0xffffL));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 4, 0xffffffffL));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 8, 0xffffffffffffffffL));
|
||||
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 1, 0x96L));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 2, 0xdbf4L));
|
||||
Assert.assertEquals(1, op.evaluateUnary(1, 4, 0x460f457bL));
|
||||
Assert.assertEquals(3, op.evaluateUnary(1, 8, 0x1fae97efca7d5759L));
|
||||
|
||||
Assert.assertEquals(4, op.evaluateUnary(1, 1, 0xaL));
|
||||
Assert.assertEquals(6, op.evaluateUnary(1, 2, 0x2a5L));
|
||||
Assert.assertEquals(9, op.evaluateUnary(1, 4, 0x60dfffL));
|
||||
Assert.assertEquals(13, op.evaluateUnary(1, 8, 0x635017adefe4eL));
|
||||
|
||||
Assert.assertEquals(3, op.evaluateUnary(1, 1, 0x17L));
|
||||
Assert.assertEquals(8, op.evaluateUnary(1, 2, 0xd1L));
|
||||
Assert.assertEquals(22, op.evaluateUnary(1, 4, 0x39eL));
|
||||
Assert.assertEquals(27, op.evaluateUnary(1, 8, 0x189c178d6aL));
|
||||
|
||||
Assert.assertEquals(4, op.evaluateUnary(1, 1, 0xfL));
|
||||
Assert.assertEquals(4, op.evaluateUnary(1, 2, 0xff0L));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 4, 0xffff0000L));
|
||||
Assert.assertEquals(24, op.evaluateUnary(1, 8, 0xff00ff00ffL));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvaluateUnaryBigInteger() {
|
||||
OpBehaviorLzcount op = new OpBehaviorLzcount();
|
||||
|
||||
BigInteger NEGATIVE_ONE = Utils.convertToUnsignedValue(BigInteger.valueOf(-1), 16);
|
||||
BigInteger BIG_POSITIVE = new BigInteger("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 16);
|
||||
BigInteger BIG_NEGATIVE = Utils
|
||||
.convertToUnsignedValue(new BigInteger("80000000000000000000000000000000", 16), 16);
|
||||
|
||||
assertEquals(BigInteger.valueOf(128), op.evaluateUnary(1, 16, BigInteger.ZERO), 16);
|
||||
assertEquals(BigInteger.ZERO, op.evaluateUnary(1, 16, NEGATIVE_ONE), 16);
|
||||
assertEquals(BigInteger.ONE, op.evaluateUnary(1, 16, BIG_POSITIVE), 16);
|
||||
assertEquals(BigInteger.ZERO, op.evaluateUnary(1, 16, BIG_NEGATIVE), 16);
|
||||
|
||||
BigInteger val = BigInteger.valueOf(0x35017adefe4eL);
|
||||
val = val.shiftLeft(64);
|
||||
val = val.or(Utils.convertToUnsignedValue(BigInteger.valueOf(0xd46223189c178d6aL), 8));
|
||||
assertEquals(BigInteger.valueOf(18), op.evaluateUnary(1, 16, val), 16);
|
||||
|
||||
BigInteger FF = BigInteger.valueOf(0xff);
|
||||
val = BigInteger.ZERO;
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
val = val.shiftLeft(16);
|
||||
val = val.add(FF);
|
||||
}
|
||||
assertEquals(BigInteger.valueOf(8), op.evaluateUnary(1, 40, val), 40);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
/* ###
|
||||
* IP: GHIDRA
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package ghidra.pcode.opbehavior;
|
||||
|
||||
import java.math.BigInteger;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import ghidra.pcode.utils.Utils;
|
||||
|
||||
public class OpBehaviorPopcountTest extends AbstractOpBehaviorTest {
|
||||
@Test
|
||||
public void testEvaluateUnaryLong() {
|
||||
|
||||
OpBehaviorPopcount op = new OpBehaviorPopcount();
|
||||
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 1, 0L));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 2, 0L));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 4, 0L));
|
||||
Assert.assertEquals(0, op.evaluateUnary(1, 8, 0L));
|
||||
|
||||
Assert.assertEquals(8, op.evaluateUnary(1, 1, 0xffL));
|
||||
Assert.assertEquals(16, op.evaluateUnary(1, 2, 0xffffL));
|
||||
Assert.assertEquals(32, op.evaluateUnary(1, 4, 0xffffffffL));
|
||||
Assert.assertEquals(64, op.evaluateUnary(1, 8, 0xffffffffffffffffL));
|
||||
|
||||
Assert.assertEquals(4, op.evaluateUnary(1, 1, 0x96L));
|
||||
Assert.assertEquals(11, op.evaluateUnary(1, 2, 0xdbf4L));
|
||||
Assert.assertEquals(16, op.evaluateUnary(1, 4, 0x460f457bL));
|
||||
Assert.assertEquals(41, op.evaluateUnary(1, 8, 0x1fae97efca7d5759L));
|
||||
|
||||
Assert.assertEquals(5, op.evaluateUnary(1, 1, 0x7aL));
|
||||
Assert.assertEquals(10, op.evaluateUnary(1, 2, 0xfca5L));
|
||||
Assert.assertEquals(20, op.evaluateUnary(1, 4, 0x2660dfffL));
|
||||
Assert.assertEquals(38, op.evaluateUnary(1, 8, 0x79f635017adefe4eL));
|
||||
|
||||
Assert.assertEquals(4, op.evaluateUnary(1, 1, 0x17L));
|
||||
Assert.assertEquals(10, op.evaluateUnary(1, 2, 0x77d1L));
|
||||
Assert.assertEquals(15, op.evaluateUnary(1, 4, 0x5758039eL));
|
||||
Assert.assertEquals(28, op.evaluateUnary(1, 8, 0xd46223189c178d6aL));
|
||||
|
||||
Assert.assertEquals(7, op.evaluateUnary(1, 1, 0xbfL));
|
||||
Assert.assertEquals(12, op.evaluateUnary(1, 2, 0xe3efL));
|
||||
Assert.assertEquals(17, op.evaluateUnary(1, 4, 0xb2d7e134L));
|
||||
Assert.assertEquals(34, op.evaluateUnary(1, 8, 0x69f7a0fa6eeda6L));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEvaluateUnaryBigInteger() {
|
||||
OpBehaviorPopcount op = new OpBehaviorPopcount();
|
||||
|
||||
BigInteger NEGATIVE_ONE = Utils.convertToUnsignedValue(BigInteger.valueOf(-1), 16);
|
||||
BigInteger BIG_POSITIVE = new BigInteger("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 16);
|
||||
BigInteger BIG_NEGATIVE = Utils
|
||||
.convertToUnsignedValue(new BigInteger("80000000000000000000000000000000", 16), 16);
|
||||
|
||||
assertEquals(BigInteger.ZERO, op.evaluateUnary(1, 16, BigInteger.ZERO), 16);
|
||||
assertEquals(BigInteger.valueOf(128), op.evaluateUnary(1, 16, NEGATIVE_ONE), 16);
|
||||
assertEquals(BigInteger.valueOf(127), op.evaluateUnary(1, 16, BIG_POSITIVE), 16);
|
||||
assertEquals(BigInteger.ONE, op.evaluateUnary(1, 16, BIG_NEGATIVE), 16);
|
||||
|
||||
BigInteger val = BigInteger.valueOf(0x79f635017adefe4eL);
|
||||
val = val.shiftLeft(64);
|
||||
val = val.or(Utils.convertToUnsignedValue(BigInteger.valueOf(0xd46223189c178d6aL), 8));
|
||||
assertEquals(BigInteger.valueOf(66), op.evaluateUnary(1, 16, val), 16);
|
||||
|
||||
BigInteger FF = BigInteger.valueOf(0xff);
|
||||
val = BigInteger.ZERO;
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
val = val.shiftLeft(16);
|
||||
val = val.add(FF);
|
||||
}
|
||||
assertEquals(BigInteger.valueOf(160), op.evaluateUnary(1, 40, val), 40);
|
||||
}
|
||||
}
|
@ -2,6 +2,7 @@
|
||||
|
||||
<processor_spec>
|
||||
<properties>
|
||||
<property key="emulateInstructionStateModifierClass" value="ghidra.program.emulation.m68kEmulateInstructionStateModifier"/>
|
||||
<property key="assemblyRating:68000:BE:32:default" value="PLATINUM"/>
|
||||
</properties>
|
||||
<programcounter register="PC"/>
|
||||
|
@ -2,7 +2,8 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Additional P-CODE Operations</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
<link rel="up" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>P-Code Operation Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>P-Code Reference Manual</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Pseudo P-CODE Operations</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>Syntax Reference</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="pcoderef.html" title="P-Code Reference Manual">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>SLEIGH</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>7. Constructors</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>8. Using Context</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>4. Basic Definitions</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>2. Basic Specification Layout</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>3. Preprocessing</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>9. P-code Tables</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>5. Introduction to Symbols</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
@ -2,7 +2,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
<title>6. Tokens and Fields</title>
|
||||
<link rel="stylesheet" type="text/css" href="Frontpage.css">
|
||||
<link rel="stylesheet" type="text/css" href="DefaultStyle.css">
|
||||
<link rel="stylesheet" type="text/css" href="languages.css">
|
||||
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
||||
<link rel="home" href="sleigh.html" title="SLEIGH">
|
||||
|
Loading…
Reference in New Issue
Block a user