Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
pykd pykd
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 19
    • Issues 19
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pykd
  • pykdpykd
  • Issues
  • #50

Closed
Open
Created May 22, 2019 by ussrhero@ussrheroMaintainer

How handle pykd exception?

I have code similar to:

m = pykd.module('some_module')
b = pykd.ptrBytes(m.some_symbol)

I can get pykd.MemoryException, so I should rewrite:

try:
   m = pykd.module('some_module')
   b = pykd.ptrBytes(m.some_symbol)
except pykd.MemoryException:
   print 'access violation'   

but if there is no 'some_symbol' I will expect to handle exception:

try:
   m = pykd.module('some_module')
   b = pykd.ptrBytes(m.some_symbol)
except pykd.MemoryException:
   print 'access violation'   
except pykd.SymbolException:
   print 'symbol exception'

or

try:
   m = pykd.module('some_module')
   b = pykd.ptrBytes(m.symbol)
except pykd.DbgException:
   print 'something wrong'   

But I've got an standart AttributeError
AttributeError: 'some_module' module has no symbol 'some_symbol'

It is look like normal for python, but it is not obvious for pykd script

Edited May 22, 2019 by ussrhero
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking