summaryrefslogtreecommitdiff
path: root/erts/etc
diff options
context:
space:
mode:
authorSverker Eriksson <sverker@erlang.org>2022-11-17 12:54:48 +0100
committerSverker Eriksson <sverker@erlang.org>2022-11-17 12:54:48 +0100
commit9c34634c13edd51c044895f775d315c137dc4b9b (patch)
treeaecc14748bc12c23008c855475005b3a34959ec9 /erts/etc
parentcd7a2a68088d407c066f8e394b50898785654e5c (diff)
parent3c815ce18735530f4121ed636e6585e21582b4b1 (diff)
downloaderlang-9c34634c13edd51c044895f775d315c137dc4b9b.tar.gz
Merge branch 'maint'
Diffstat (limited to 'erts/etc')
-rw-r--r--erts/etc/unix/etp-commands.in28
1 files changed, 22 insertions, 6 deletions
diff --git a/erts/etc/unix/etp-commands.in b/erts/etc/unix/etp-commands.in
index 64d8de67df..0e764c2430 100644
--- a/erts/etc/unix/etp-commands.in
+++ b/erts/etc/unix/etp-commands.in
@@ -1159,12 +1159,19 @@ document etp-mfa
end
define etp-export-get
- # Args: Eterm Eterm Uint
+ # Args: M F A [code_ix]
set $etp_h = (((Eterm)$arg0 >> 6) * ((Eterm)$arg1 >> 6)) ^ (Uint)$arg2
+ if $argc == 3
+ set $etp_code_ix = the_active_code_index.counter
+ end
+ if $argc == 4
+ set $etp_code_ix = $arg3
+ end
+
#hash_get_slot
- set $etp_t = &export_tables[the_active_code_index.counter].htable
+ set $etp_t = &export_tables[$etp_code_ix].htable
set $etp_h ^= $etp_h >> $etp_t->shift
if $etp_arch64
set $etp_h = (11400714819323198485UL * $etp_h) >> $etp_t->shift
@@ -1188,9 +1195,10 @@ end
document etp-export-get
%---------------------------------------------------------
-% etp-export-get module function arity
+% etp-export-get module function arity [code_ix]
%
% Lookup and print pointer to Export entry.
+% code_ix is optional, default is the_active_code_index
% Example:
% (gdb) etp-string-to-atom "erlang"
% $1 = 13323
@@ -1207,8 +1215,15 @@ define etp-module-get
set $etp_ix = ((Eterm)$arg0 >> 6)
set $etp_h = $etp_ix
+ if $argc == 1
+ set $etp_code_ix = the_active_code_index.counter
+ end
+ if $argc == 2
+ set $etp_code_ix = $arg1
+ end
+
#hash_get_slot
- set $etp_t = &module_tables[the_active_code_index.counter].htable
+ set $etp_t = &module_tables[$etp_code_ix].htable
set $etp_h ^= $etp_h >> $etp_t->shift
if $etp_arch64
set $etp_h = (11400714819323198485UL * $etp_h) >> $etp_t->shift
@@ -1232,9 +1247,10 @@ end
document etp-module-get
%---------------------------------------------------------
-% etp-module-get module
+% etp-module-get module [code_ix]
%
% Lookup and print pointer to Module entry.
+% code_ix is optional, default is the_active_code_index
% Example:
% (gdb) etp-string-to-atom "erlang"
% $1 = 13323
@@ -1297,7 +1313,7 @@ define etp-cp-func-info-1
# $etp_cp_line_name and $etp_cp_line_number
#
set $etp_cp = (Eterm)($arg0)
- set $etp_ranges = &r[(int)the_active_code_index]
+ set $etp_ranges = &r[(int)the_active_code_index.counter]
set $etp_cp_low = $etp_ranges->modules
set $etp_cp_high = $etp_cp_low + $etp_ranges->n
set $etp_cp_mid = (Range*)$etp_ranges->mid