aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-04-17 14:40:49 +0200
committerSverker Eriksson <[email protected]>2019-04-24 18:31:46 +0200
commit4befc2e3febede914375c59d9a3f19a1eb3903e6 (patch)
treed10e0776b8a3fd48d3fb2e6f41fa74a50f5222f4
parent4fb0813f9004cb75eca065058c4899b0e4183635 (diff)
downloadotp-4befc2e3febede914375c59d9a3f19a1eb3903e6.tar.gz
otp-4befc2e3febede914375c59d9a3f19a1eb3903e6.tar.bz2
otp-4befc2e3febede914375c59d9a3f19a1eb3903e6.zip
erts: Fix etp-commands to work on older gdb
where $argc does not exists "if $undefined_variable" evaluates as true !?
-rw-r--r--erts/etc/unix/etp-commands.in57
1 files changed, 32 insertions, 25 deletions
diff --git a/erts/etc/unix/etp-commands.in b/erts/etc/unix/etp-commands.in
index f2b2ab1d9a..14cd2e587a 100644
--- a/erts/etc/unix/etp-commands.in
+++ b/erts/etc/unix/etp-commands.in
@@ -4124,14 +4124,6 @@ define etp-block-size-1
set $etp_blk_sz = ($arg0)->bhdr & ~7
else
# Allocated block
- if !$etp_MBC_ABLK_SZ_MASK
- if etp_arch_bits == 64
- set $etp_MBC_ABLK_OFFSET_SHIFT = (64 - 24)
- else
- set $etp_MBC_ABLK_OFFSET_SHIFT = (32 - 9)
- end
- set $etp_MBC_ABLK_SZ_MASK = ((UWord)1 << $etp_MBC_ABLK_OFFSET_SHIFT) - 1 - 7
- end
set $etp_blk_sz = ($arg0)->bhdr & $etp_MBC_ABLK_SZ_MASK
end
end
@@ -4146,13 +4138,6 @@ define etp-block2mbc-1
set $etp_mbc = ($arg0)->u.carrier
else
# Allocated block
- if !$etp_MBC_ABLK_OFFSET_SHIFT
- if etp_arch_bits == 64
- set $etp_MBC_ABLK_OFFSET_SHIFT = (64 - 24)
- else
- set $etp_MBC_ABLK_OFFSET_SHIFT = (32 - 9)
- end
- end
set $etp_mbc = (Carrier_t*) ((((UWord)($arg0) >> 18) - (($arg0)->bhdr >> $etp_MBC_ABLK_OFFSET_SHIFT)) << 18)
end
end
@@ -4197,7 +4182,7 @@ document etp-smp-atomic
%---------------------------------------------------------------------------
end
-define etp-carrier-blocks
+define etp-carrier-blocks-1
set $etp_crr = (Carrier_t*) $arg0
etp-smp-atomic $etp_crr->allctr $etp_alc
set $etp_alc = (Allctr_t*)($etp_alc & ~7)
@@ -4209,12 +4194,6 @@ define etp-carrier-blocks
set $etp_fblk_cnt = 0
set $etp_aborted = 0
- if $argc == 2
- set $etp_be_silent = $arg1
- else
- set $etp_be_silent = 0
- end
-
while 1
if !$etp_be_silent
etp-block $etp_blk
@@ -4237,6 +4216,12 @@ define etp-carrier-blocks
printf "ERROR: Missing PREV_FREE_BLK_HDR_FLG (2) in block at %#lx\n", $etp_blk
set $etp_error_cnt = $etp_error_cnt + 1
end
+ else
+ # Prev is ALLOCATED
+ if ($etp_blk->bhdr & 2)
+ printf "ERROR: Invalid PREV_FREE_BLK_HDR_FLG (2) set in block at %#lx\n", $etp_blk
+ set $etp_error_cnt = $etp_error_cnt + 1
+ end
end
end
if $etp_blk->bhdr & 1
@@ -4274,13 +4259,31 @@ define etp-carrier-blocks
end
end
-document etp-carrier-blocks
+define etp-carrier-print
+ set $etp_be_silent = 0
+ etp-carrier-blocks-1 $arg0
+end
+
+document etp-carrier-print
%---------------------------------------------------------------------------
-% Check and (maybe) print all memory blocks in carrier
-% Args: (Carrier_t*) [1=be_silent]
+% Print all memory blocks in carrier
+% Args: (Carrier_t*)
%---------------------------------------------------------------------------
end
+define etp-carrier-check
+ set $etp_be_silent = 1
+ etp-carrier-blocks-1 $arg0
+end
+
+document etp-carrier-check
+%---------------------------------------------------------------------------
+% Check all memory blocks in carrier
+% Args: (Carrier_t*)
+%---------------------------------------------------------------------------
+end
+
+
define etp-address-to-beam-opcode
set $etp_i = 0
set $etp_min_diff = ((UWord)1 << (sizeof(UWord)*8 - 1))
@@ -4412,9 +4415,13 @@ define etp-init
set $etp_arch64 = (sizeof(void *) == 8)
if $etp_arch64
set $etp_nil = 0xfffffffffffffffb
+ set $etp_MBC_ABLK_OFFSET_SHIFT = (64 - 24)
else
set $etp_nil = 0xfffffffb
+ set $etp_MBC_ABLK_OFFSET_SHIFT = (32 - 9)
end
+ set $etp_MBC_ABLK_SZ_MASK = ((UWord)1 << $etp_MBC_ABLK_OFFSET_SHIFT) - 1 - 7
+
set $etp_flat = 0
set $etp_chart_id = 0
set $etp_chart = 0