public inbox for archer-commits@sourceware.org help / color / mirror / Atom feed
From: scox@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] scox/strace: Handle T packets and all signal types. Date: Mon, 01 Apr 2019 14:31:00 -0000 [thread overview] Message-ID: <20190401143115.58176.qmail@sourceware.org> (raw) The branch, scox/strace has been updated via 451fedd097d72653b034d236d5e23e0b98152845 (commit) from 9e8f1a71428e1266d47d8cf4a809257c363b1933 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 451fedd097d72653b034d236d5e23e0b98152845 Author: Stan Cox <scox@redhat.com> Date: Mon Apr 1 10:29:08 2019 -0400 Handle T packets and all signal types. ----------------------------------------------------------------------- Summary of changes: gdb/contrib/gdbrp-dump.py | 44 ++++++++++++++++++++++++++------------------ 1 files changed, 26 insertions(+), 18 deletions(-) First 500 lines of diff: diff --git a/gdb/contrib/gdbrp-dump.py b/gdb/contrib/gdbrp-dump.py index 32b07a0..a95f6af 100755 --- a/gdb/contrib/gdbrp-dump.py +++ b/gdb/contrib/gdbrp-dump.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -# Copyright (C) 2016 Free Software Foundation, Inc. +# Copyright (C) 2016, 2019 Free Software Foundation, Inc. # # This file is part of GDB. # @@ -62,7 +62,13 @@ def big_endian(arg, s, e): return be_str def signal(sig): - signals = {3:"SIGQUIT", 4:"SIGILL", 5:"SIGTRAP", 17:"SIGCHLD", 18:"SIGCONT", 19:"SIGSTOP"} + signals = {1:"SIGHUP", 2:"SIGINT", 3:"SIGQUIT", 4:"SIGILL", 5:"SIGTRAP", \ + 6:"SIGABRT", 7:"SIGBUS", 8:"SIGFPE", 9:"SIGKILL", 10:"SIGUSR1", \ + 11:"SIGSEGV", 12:"SIGUSR2", 13:"SIGPIPE", 14:"SIGALRM", 15:"SIGTERM", \ + 16:"SIGSTKFLT", 17:"SIGCHLD", 18:"SIGCONT", 19:"SIGSTOP", 20:"SIGTSTP", \ + 21:"SIGTTIN", 22:"SIGTTOU", 23:"SIGURG", 24:"SIGXCPU", 25:"SIGXFSZ", \ + 26:"SIGVTALRM", 27:"SIGPROF", 28:"SIGWINCH", 29:"SIGIO", 30:"SIGPWR", \ + 31:"SIGSYS"} try: return signals[sig] except KeyError: @@ -187,6 +193,7 @@ def dump_client_packet(line): # [ packet id, brief description, packet layout ] # The packet layout keywords are expanded below packets = [ + ["$qSymbol:", "symbol lookup", ["symbol-name"]], ["$q", "general query", ["name params"]], ["$vAttach", "attach", ["pid"]], ["$vCont?", 'query resume actions', ["action:thread-id"]], @@ -254,7 +261,6 @@ def dump_client_packet(line): ["$qSearch:memory:address;length;search-pattern", "", [""]], ["$QStartNoAckMode", "packet acknowledgment", [""]], ["$BreakpointCommands", "", [""]], - ["$qSymbol::", "symbol lookup", ["symbol-name"]], ["$qThreadExtraInfo,thread-id", "", [""]], ["$qXfer:object:read:annex:offset,length", "", [""]], ["$qAttached", "remote attach state", ["pid"]], @@ -403,13 +409,13 @@ def dump_client_packet(line): idx = len(arg) if idx % 2 > 0: idx -= 3 - if request == "vRun": - try: - executable = binascii.unhexlify(args[argidx][:idx]) - print executable, - except TypeError: - print "Unable to print vRun argument", - pass +# if request == "vRun": + try: + executable = binascii.unhexlify(args[argidx][:idx]) + print executable, + except TypeError: + print "Unable to print vRun argument", + pass elif a == "registers": dump_registers(arg) else: @@ -450,28 +456,30 @@ def dump_server_packet(line, last_request): start = 0 else: start = 1 - dump_registers(decode_packet(args[0][start:])) + dump_registers(decode_packet(args[0][start:])) elif last_request == "m": dump_memory(decode_packet(args[0][1:])) if len(args) == 0: return if args[0][0] == 'T' or args[0][0] == 'S': - if args[0][0] == 'S': + if args[0][0] == 'T': + this_sig = signal(int(args[0][1:3],16)) + elif args[0][0] == 'S': args[0] = args[0][5:] try: - print dsp_prefix, "packet reply: signal=", signal(int(args[0][1:3], 16)), + this_sig = signal(int(args[0][1:3], 16)) except ValueError: pass subargs = args[0].split(':') - print - print dsp_prefix, +# print dsp_prefix, try: if args[0][3:5] == "sy": status, text = getstatusoutput('grep "_NR_.* ' + str(int(subargs[1], 16)) + '$" /usr/include/asm/unistd_64.h') - print text[text.find("#define ")+8:], + print dsp_prefix, text[text.find("#define ")+8:], this_sig, elif args[0][3:5] == "wa": - print "watch =", subargs[1], + print dsp_prefix, "watch =", subargs[1], else: + print dsp_prefix, this_sig, print_register(args[0][3:5], subargs[1], 0, 0) print except IndexError: @@ -506,7 +514,7 @@ def dump_server_packet(line, last_request): idx = len(args[0]) suffix = "" x = 0 - print args[0][8:idx] +# print args[0][8:idx] print dsp_prefix, " server:", binascii.unhexlify(args[0][8:idx]) + suffix # Depending on verbosity, we may or may not wish to print a line hooks/post-receive -- Repository for Project Archer.
next reply other threads:[~2019-04-01 14:31 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-04-01 14:31 scox [this message] -- strict thread matches above, loose matches on Subject: below -- 2019-04-01 14:18 scox
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190401143115.58176.qmail@sourceware.org \ --to=scox@sourceware.org \ --cc=archer-commits@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).