Logo
Explore Help
Sign In
1berry/haproxy
1
0
Fork 0
You've already forked haproxy
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
haproxy/dev/gdb/stream.gdb

19 lines
585 B
Plaintext
Raw Permalink Normal View History

DEV: gdb: add a number of gdb scripts to navigate in core dumps These is a collection of functions I'm occasionally using to navigate in core dumps. Only working ones were extracted. Those requiring knowledge of global variables (e.g. pools, proxy list) use the one extracted from the post_mortem struct. That one is defined in post-mortem.gdb and needs to be initialized using "pm_init post_mortem" or "pm_init <pointer>". From this point a number of global variables are accessible even if symbols are missing; those ones are then used by other functions to dump streams, threads, pools, proxies etc. The files can be sourced or copy-pasted into a gdb session. It's worth trying to keep them up-to-date, as the old ones used to navigate through tasks are no longer usable due to massive changes.
2024-10-28 17:51:29 +01:00
# list all streams for all threads
define stream_dump
set $t = 0
while $t < $g.nbthread
set $h = &$tc[$t].streams
printf "Tid %4d: &streams=%p\n", $t, $h
set $p = *(void **)$h
while ($p != $h)
set $s = (struct stream *)(((char *)$p) - (unsigned long)&((struct stream *)0)->list)
printf " &list=%#lx strm=%p uid=%u strm.fe=%s strm.flg=%#x strm.list={n=%p,p=%p}\n", $p, $s, $s->uniq_id, $s->sess->fe->id, $s->flags, $s->list.n, $s->list.p
if ($p == 0)
loop_break
end
set $p = *(void **)$p
end
set $t = $t + 1
end
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 413ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API