From 9597e4feadf1e828b43fbb81e0876cae16ab610a Mon Sep 17 00:00:00 2001 From: billow Date: Sat, 28 Oct 2023 17:44:55 +0800 Subject: [PATCH] Add test for `afvlt` --- test/db/analysis/arm | 2 +- test/db/analysis/vars | 331 ++++++++++-------- test/db/analysis/x86_64 | 30 +- test/db/archos/linux-x64/dbg_aslr | 4 +- test/db/archos/linux-x64/dbg_gdbserver_rebase | 4 +- test/db/archos/windows-x64/dbg_rebase | 4 +- test/db/cmd/dwarf | 4 +- test/db/cmd/types | 42 +-- test/db/cmd/write | 2 +- 9 files changed, 223 insertions(+), 200 deletions(-) diff --git a/test/db/analysis/arm b/test/db/analysis/arm index c1bd150ec29..b9cbcefc164 100644 --- a/test/db/analysis/arm +++ b/test/db/analysis/arm @@ -745,7 +745,7 @@ e asm.arch=arm e asm.bits=16 wx f0b503af2de9000d95b0002001210222032340f2040940f2050c40f2060e0724082509261490139112921193cdf80090cdf804c0cdf808e0039404950596ddf85080cdf81880ddf84ca0cdf81ca0ddf848b0cdf820b0ddf84480cdf82480cdf82890cdf82cc0cdf830e00d940e950f96fff740ff00211090084615b0bde8000df0bd aa -afv~var +afvl~var EOF EXPECT=< + ] +false ans int DWARF empty int printf(const char *fmt, ...); ; CALL XREFS from dbg.main @ 0x8000054e, 0x80000636 ;-- printf: @@ -905,6 +918,24 @@ arg void *str @ a4 arg const char *buf @ a4 var int32_t arg6 @ a5 arg size_t n @ d5 +is_arg name type constraints origin addr +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +true str void * DWARF loclist: [ + (0x80000c04, 0x80000c0a): a4, + (0x80000c0a, 0x80000c22): a15 + ] +true buf const char * DWARF loclist: [ + (0x80000c04, 0x80000c10): a5, + (0x80000c10, 0x80000c13): a4, + (0x80000c13, 0x80000c22): + ] +false arg6 int32_t rizin a5 +true n size_t DWARF loclist: [ + (0x80000c04, 0x80000c0e): d4, + (0x80000c0e, 0x80000c13): d5, + (0x80000c13, 0x80000c1a): d15, + (0x80000c1a, 0x80000c22): + ] void * prout(void *str, const char *buf, size_t n); ;-- prout: / void * prout(void *str, const char *buf, size_t n) @@ -923,6 +954,72 @@ var intfrac tfraction @ composite: [(.0, 32): d2, (.0, 32): d3] var fractype b_fraction @ composite: [(.0, 32): d8, (.0, 32): d9] var int a_normal_exp @ ... var fractype a_fraction @ ... +is_arg name type constraints origin addr +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +true b fp_number_type * DWARF loclist: [ + (0x80003c60, 0x80003c8c): a5, + (0x80003c8c, 0x80003c8e): a2, + (0x80003c8e, 0x80003c92): a5, + (0x80003c92, 0x80003c98): a2, + (0x80003c98, 0x80003cb4): a5, + (0x80003cb4, 0x80003cb6): a2, + (0x80003cb6, 0x80003cba): a5, + (0x80003cba, 0x80003ce9): a2, + (0x80003ce9, 0x80003d10): a12, + (0x80003d10, 0x80003d1d): a2, + (0x80003d1d, 0x80003d46): a12, + (0x80003d46, 0x80003d56): a2, + (0x80003d56, 0x80003e02): a12, + (0x80003e02, 0x80003e04): + ] +true a fp_number_type * DWARF loclist: [ + (0x80003c60, 0x80003c9c): a4, + (0x80003c9c, 0x80003cae): a2, + (0x80003cae, 0x80003cb4): , + (0x80003cb4, 0x80003ce9): a4, + (0x80003ce9, 0x80003d10): a13, + (0x80003d10, 0x80003d1d): a4, + (0x80003d1d, 0x80003d46): a13, + (0x80003d46, 0x80003d56): a4, + (0x80003d56, 0x80003e02): a13, + (0x80003e02, 0x80003e04): + ] +false arg6 int32_t rizin a5 +true tmp fp_number_type * DWARF loclist: [ + (0x80003c60, 0x80003ce9): a6, + (0x80003ce9, 0x80003d10): a15, + (0x80003d10, 0x80003d1d): a6, + (0x80003d1d, 0x80003d46): a15, + (0x80003d46, 0x80003d56): a6, + (0x80003d56, 0x80003dea): a15, + (0x80003dea, 0x80003e02): a2, + (0x80003e02, 0x80003e04): + ] +false b_normal_exp int DWARF loclist: [ + (0x80003cc0, 0x80003ce0): d2, + (0x80003ce0, 0x80003ce9): , + (0x80003d10, 0x80003d1d): d2, + (0x80003d46, 0x80003d56): d2 + ] +false tfraction intfrac DWARF composite: [(.0, 32): d2, (.0, 32): d3] +false b_fraction fractype DWARF loclist: [ + (0x80003cd8, 0x80003d08): composite: [(.0, 32): d8, (.0, 32): d9], + (0x80003d0e, 0x80003e02): composite: [(.0, 32): d8, (.0, 32): d9] + ] +false a_normal_exp int DWARF loclist: [ + (0x80003cbc, 0x80003d4c): d15, + (0x80003d4c, 0x80003d52): a4+8, + (0x80003d52, 0x80003d88): d15, + (0x80003d88, 0x80003d98): a15+8, + (0x80003dc6, 0x80003dd0): d15, + (0x80003dd0, 0x80003dd6): a15+8 + ] +false a_fraction fractype DWARF loclist: [ + (0x80003cd4, 0x80003d3c): composite: [(.0, 32): d10, (.0, 32): d11], + (0x80003d44, 0x80003d50): composite: [(.0, 32): d10, (.0, 32): d11], + (0x80003d50, 0x80003d52): a4+12, + (0x80003d52, 0x80003e02): composite: [(.0, 32): d10, (.0, 32): d11] + ] fp_number_type * _fpadd_parts(fp_number_type *a, fp_number_type *b, fp_number_type *tmp); ; CALL XREF from dbg.__adddf3 @ 0x80003e32 ; CALL XREF from dbg.__subdf3 @ 0x80003e72 @@ -943,6 +1040,20 @@ arg const char *s @ a2 var const char *sc @ a2 var int32_t arg5 @ a4 arg size_t maxsize @ d4 +is_arg name type constraints origin addr +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +true s const char * DWARF loclist: [ + (0x800030ca, 0x800030dc): a4, + (0x800030dc, 0x800030e0): , + (0x800030e0, 0x800030ea): a4, + (0x800030ea, 0x800030ec): a2 + ] +false sc const char * DWARF a2 +false arg5 int32_t rizin a4 +true maxsize size_t DWARF loclist: [ + (0x800030ca, 0x800030d2): d4, + (0x800030ea, 0x800030ec): d4 + ] size_t strnlen_s(const char *s, size_t maxsize); ; CALL XREF from dbg._Fail_s @ 0x8000191e ;-- strnlen_s: @@ -958,6 +1069,22 @@ arg char *s @ a4 arg mbstate_t *pst @ a5 arg wchar_t wc @ d4 var _Statab *pmbstate @ ... +is_arg name type constraints origin addr +--------------------------------------------------------------------------------------------------------------------------- +false pwcstate _Statab * DWARF a13 +true s char * DWARF loclist: [ + (0x800018a6, 0x800018bb): a4, + (0x800018bb, 0x800018ec): a15 + ] +true pst mbstate_t * DWARF loclist: [ + (0x800018a6, 0x800018bb): a5, + (0x800018bb, 0x800018ec): a12 + ] +true wc wchar_t DWARF loclist: [ + (0x800018a6, 0x800018bb): d4, + (0x800018bb, 0x800018ec): d15 + ] +false pmbstate _Statab * DWARF empty int _Wctomb(char *s, wchar_t wc, mbstate_t *pst); ; CALL XREF from dbg._Putstr @ 0x800014d2 ;-- _Wctomb: @@ -976,6 +1103,27 @@ var int32_t arg5 @ a4 var int32_t arg6 @ a5 var int32_t arg7 @ a6 arg size_t nin @ d15 +is_arg name type constraints origin addr +------------------------------------------------------------------------------------------------------------------------ +true pst mbstate_t * DWARF loclist: [ + (0x80003084, 0x8000309b): a6, + (0x8000309b, 0x800030b0): a12 + ] +true s const char * DWARF loclist: [ + (0x80003084, 0x8000309b): a5, + (0x8000309b, 0x800030b0): a13 + ] +true pwc wchar_t * DWARF loclist: [ + (0x80003084, 0x8000309b): a4, + (0x8000309b, 0x800030b0): a14 + ] +false arg5 int32_t rizin a4 +false arg6 int32_t rizin a5 +false arg7 int32_t rizin a6 +true nin size_t DWARF loclist: [ + (0x80003084, 0x8000309b): d4, + (0x8000309b, 0x800030b0): d15 + ] int _Mbtowc(wchar_t *pwc, const char *s, size_t nin, mbstate_t *pst); ; CALL XREF from dbg._Printf @ 0x80000d02 ;-- _Mbtowc: @@ -990,6 +1138,9 @@ int _Mbtowc(wchar_t *pwc, const char *s, size_t nin, mbstate_t *pst); | 0x80003084 movh.a a15, #0xd000 ; xmbtowc.c:150 ; int _Mbtowc(wchar_t *pwc, const char *s, size_t nin, mbstate_t *pst) --------- arg int except @ d4 +is_arg name type constraints origin addr +------------------------------------------- +true except int DWARF d4 int feraiseexcept(int except); ; CALL XREF from dbg._Feraise @ 0x8000343e ;-- feraiseexcept: @@ -1000,6 +1151,14 @@ int feraiseexcept(int except); var size_t size_arg @ a0 var Ppvoidfn newfuns @ a2 var size_t inc @ d15 +is_arg name type constraints origin addr +------------------------------------------------------------------------------------------------------------------------ +false size_arg size_t rizin a0 +false newfuns Ppvoidfn DWARF loclist: [ + (0x800019aa, 0x800019b8): a2, + (0x800019b8, 0x80001a1c): a12 + ] +false inc size_t DWARF d15 int _Atrealloc(); ; CALL XREF from dbg.atexit @ 0x80001a4c ; CALL XREF from dbg._Atexit @ 0x800033b8 @@ -1019,6 +1178,17 @@ var size_t size_arg @ a0 var int32_t arg5 @ a4 var int32_t arg6 @ a5 var int32_t arg7 @ a6 +is_arg name type constraints origin addr +-------------------------------------------------------- +true out some_t ** DWARF a14-24 +true gg struct Some * DWARF a14-20 +true q double DWARF a14-16 +true g char * DWARF a14-8 +true a int DWARF a14-4 +false size_arg size_t rizin a0 +false arg5 int32_t rizin a4 +false arg6 int32_t rizin a5 +false arg7 int32_t rizin a6 void dbg.fn1(int a, char *g, double q, struct Some *gg, some_t **out); ; CALL XREF from dbg.main @ 0x8000059e ;-- fn1: @@ -1098,150 +1268,3 @@ EXPECT=<