pdb

How to get source/line number for IL instruction using Mono.Cecil

本小妞迷上赌 提交于 2019-12-05 19:09:50
问题 I'm using Mono.Cecil to write a simple utility that looks for type/method usage within .NET assemblies (ex. calling ToString on enums). I am able to get find the method, but it would be cool to display the source/line information to the user. Is this possible with Mono.Cecil? 回答1: It is possible. First you should read the guide from the Mono.Cecil wiki about debugging symbols. Make sure you have Mono.Cecil.Pdb.dll near Mono.Cecil.dll, set the ReaderParameters to read the symbols as indicated

PDB.run - restarting a pdb session

帅比萌擦擦* 提交于 2019-12-05 17:39:17
问题 I'm relatively new to python and pdb, but I have a lot of experience with gdb. My problem is that if I set a number of breakpoints in my code at some point I will want to change something and re-run my debug session retaining these break points. However entering "run" in my pdb session cases my session to terminate with the following output (Pdb) run Traceback (most recent call last): File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main "__main__", fname, loader, pkg_name)

using ipdb for debugging python inside emacs

荒凉一梦 提交于 2019-12-05 16:34:35
import pdb; pdb.set_trace() works fine when I run M-x pdb python manage.py runserver However import ipdb would cause the above statement to hang indefinately.. I hear great things about ipdb, how do I use it under emacs? Edit Just found out django has nothing to do with it, simple python file hangs as well. 来源: https://stackoverflow.com/questions/29425325/using-ipdb-for-debugging-python-inside-emacs

How do I display thread/process Id in Python PDB?

巧了我就是萌 提交于 2019-12-05 14:21:21
In Python, is there a way to display thread/process ID while debugging using PDB? I was looking at https://docs.python.org/2/library/pdb.html but could not find anything related to it? (pdb) import os,threading; os.getpid(), threading.current_thread().ident If you need to do this often, it would be convenient to add an alias in your .pdbrc file: alias tid import os,threading;; p os.getpid(), threading.current_thread().ident 来源: https://stackoverflow.com/questions/39259805/how-do-i-display-thread-process-id-in-python-pdb

What is the simplest way of using Python pdb to inspect the cause of an unhandled exception?

一笑奈何 提交于 2019-12-05 13:38:20
I just converted all my unit test data from JSON to YAML, and now an exception is raised somewhere in my code. More specifically, this is printed traceback: Traceback (most recent call last): File "tests/test_addrtools.py", line 95, in test_validate_correctable_addresses self.assertTrue(self.validator(addr), msg) File "/Users/tomas/Dropbox/Broadnet/broadpy/lib/broadpy/addrtools.py", line 608, in __call__ self.validate(addr) File "/Users/tomas/Dropbox/Broadnet/broadpy/lib/broadpy/addrtools.py", line 692, in validate if self._correction_citytypo(addr): return File "/Users/tomas/Dropbox/Broadnet

What's a PDB file?

北城余情 提交于 2019-12-05 11:22:37
问题 What's the PDB files inside the .NET dll files and what it does? Usually peoples remove this file in deploying and only keep the dll file in lib folders but it seems nothing happened and everything works well... So, what's the PDB files does? 回答1: A Program Data Base file has nothing to do with incremental linking and Project State ! PDB files are used to map EXE with SOURCES. They are used for Debug and Release binaries. Here an article that explains this binding link between an Executable

ipython debugger: full traceback on interactive pdb?

ε祈祈猫儿з 提交于 2019-12-05 07:12:14
I recently switched from ipython0.10 to ipython0.11. In ipython0.11, I only see a small snippet of the full traceback when the python debugger engages (i.e. using %pdb ), whereas in ipython0.10 I'd see the full traceback. As far as I can tell, the full traceback is not directly accessible from the pdb command line - you can navigate through it with 'u' but can't see it directly. So, is there any way to show the full traceback? Such as a configuration parameter? Or, even more usefully, is there any way to have ipython just show the Exception that was caught, rather than showing where in the

python pdb lambda function global name error

旧城冷巷雨未停 提交于 2019-12-05 07:03:15
I was testing a fix using pdb.set_trace() to make sure it worked the way I expected before implementing it and kept getting a weird error. (Pdb) test = [1,2,3,4,4,3,2,1] (Pdb) max(range(len(test)),key=lambda i: test[i]) *** NameError: global name 'test' is not defined So I moved to my localmachine to make sure I could reproduce as simply as possible before asking for help. In ipython I get the exact same behavior. In [1]: test = [1,2,3,4,4,3,2,1] In [2]: max(range(len(test)),key=lambda i: test[i]) Out[2]: 3 In [3]: import pdb; pdb.set_trace() --Call-- > /Users/tristanmatthews/anaconda/lib

How to step through Python expression evaluation process?

岁酱吖の 提交于 2019-12-05 05:06:41
I want to build a visual debugger, which helps programming students to see how expression evaluation takes place (how subexpressions get evaluated and "replaced" by their values, something like expression evaluation visualizer in Excel). Looks like you can't step through this process with Python's pdb, as its finest step granularity is line of code. Is it somehow possible to step through Python bytecode? Any other ideas how to achieve this goal? EDIT: I need a lightweight solution that can be built on top of CPython standard library. Have you tried pudb? http://pypi.python.org/pypi/pudb On a

蔓灵花(BITTER)APT组织针对中国境内军工、核能、政府等敏感机构的最新攻击活动报告

余生颓废 提交于 2019-12-05 04:34:44
原文地址: https://s.tencent.com/research/report/615.html 腾讯御见安全中心 一、概述 蔓灵花(T-APT-17、BITTER)APT组织是一个长期针对中国、巴基斯坦等国家进行攻击活动的APT组织,该APT组织为目前活跃的针对境内目标进行攻击的境外APT组织之一。 该组织主要针对政府、军工业、电力、核等单位进行攻击,窃取敏感资料,具有强烈的政治背景。该组织最早在2016由美国安全公司Forcepoint进行了披露,并且命名为“BITTER”,同年国内友商360也跟进发布了分析报告,命名为“蔓灵花”,鉴于对“谁先发现谁命名”的原则,我们继续沿用友商们对该组织的命名。 该组织的名称的命名由来为,该组织的特马数据包头部以“BITTER”作为标识,因此命名为“BITTER”。但是值得注意的是,自从该活动被曝光后,该组织就修改了数据包结构,不再以“BITTER”作为数据包的标识,改为五字节的随机字符进行代替。 腾讯御见威胁中心在今年五月份捕捉到了疑似该组织对我国境内敏感单位的攻击活动,但是由于当时无法下载到具体的攻击模块,因此无法进行进一步的关联和分析。 而在十月底,腾讯御见威胁情报中心再次捕捉到了疑似该组织对我国的军工业、核能、政府等重点单位的攻击,并且获取到了完整的攻击武器库,经过进一步的关联分析,我们确认该攻击组织就是2016年曝光的蔓灵花