×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    15

    Question How do I catch S60 Panics in VC++?

    Hi,

    I’m using Microsoft Visual C++ .NET 2003, Carbide vs 2.0.1 and Nokia S60_2nd_FP2 for developing my application.

    The problem is that Panics (e.g. User::Panic() and __UHEAP_MARKEND) generated by my application are not detected by VC++. The only indication I get is a dialog in the emulator saying that my application has been closed (Program closed: MyApplication). I would like to use the Panic information together with Symbian HookLogger to track down memory/resource leaks.

    Is there any way to make S60 SDK/VC++ generate/catch these Panics? VC++ detects similar Panics when using UIQ SDKs…

    Cheers
    Stefan

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Re: How do I catch S60 Panics in VC++?

    Quote Originally Posted by steffe66
    Is there any way to make S60 SDK/VC++ generate/catch these Panics? VC++ detects similar Panics when using UIQ SDKs…
    One way that has worked for me (I am not sure if it is the easiest, and I have only tried it on VC 6.0...) is to use the trick described at http://www.cs.helsinki.fi/u/mraento/...n/symbols.html to create rudimentary debug symbols for the emulator, and then to set a breakpoint at EUSER::User::Panic.

    These symbols are also very helpful for getting better backtraces - since they only map the DLL exports contained in .lib files, there usefulness is somewhat limited compared to the times when Nokia still shipped complete symbol files, but it is much better than nothing.

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    15

    Re: How do I catch S60 Panics in VC++?

    Quote Originally Posted by mgroeber9110
    One way that has worked for me (I am not sure if it is the easiest, and I have only tried it on VC 6.0...) is to use the trick described at http://www.cs.helsinki.fi/u/mraento/...n/symbols.html to create rudimentary debug symbols for the emulator, and then to set a breakpoint at EUSER::User::Panic.

    These symbols are also very helpful for getting better backtraces - since they only map the DLL exports contained in .lib files, there usefulness is somewhat limited compared to the times when Nokia still shipped complete symbol files, but it is much better than nothing.
    Hi,

    Thanks for the tip-off but unfortunately the link to symbols.pl in the Step-by-step instruction doesn’t work and I don’t get any respond from Mikie who owns the page. Do you know where to get this file?

    And a probably stupid question:
    If I want to use the loop described in the instruction…
    for %i in (*dll) do (
    perl symbols.pl %i
    dbggen %i
    )
    …am I supposed to put it in a .bat file and run it from the Windows command line (this doesn’t work however) or what language is it?

    Cheers
    Stefan

  4. #4
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Re: How do I catch S60 Panics in VC++?

    Quote Originally Posted by steffe66
    Thanks for the tip-off but unfortunately the link to symbols.pl in the Step-by-step instruction doesn’t work and I don’t get any respond from Mikie who owns the page. Do you know where to get this file?
    The link http://mikie.iki.fi/symbian/symbols.pl works fine for me - maybe you will have to right-click and save it (otherwise it may open as a plain-text file), or there is a firewall in place for you that blocks Perl files as potentially dangerous...

    Quote Originally Posted by steffe66
    If I want to use the loop described in the instruction…
    Code:
    for %i in (*dll) do ( 
      perl symbols.pl %i
      dbggen %i
    )
    Yes, this should best go into a batch file - in this case, you would have to duplicate each % character to escape it for batch processing... I have also added *exe after *dll, so that also EXE files with imports (rare, but seem to occur in some SDKs) are covered.

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    15

    Re: How do I catch S60 Panics in VC++?

    Finally I managed to create the DBG files and it seams like VS .NET finds the symbols, because I can see “'EPOC.EXE': Loaded 'X:\epoc32\release\wins\udeb\euser.dll', Symbols loaded.” in the output window.

    The next question is how I can set a break point in EUSER::User::Panic when I use a ordinary S60 2nd ED FP2 SDK (downloaded from the net) where there is no source file for EUSER available!?

  6. #6
    Registered User
    Join Date
    Mar 2003
    Location
    Germany
    Posts
    200

    Re: How do I catch S60 Panics in VC++?

    Quote Originally Posted by steffe66
    The next question is how I can set a break point in EUSER::User::Panic when I use a ordinary S60 2nd ED FP2 SDK (downloaded from the net) where there is no source file for EUSER available!?
    Being able to do just this was, of course, the whole point of creating those symbols in the first place. :-)

    I have used the following steps in the past: Break, go to Disassembly, Ctrl-G (Go To), Address, EUSER::User::Panic, set breakpoint with cursor on first line of assembly...

    However, it may be even easier to use Edit->Breakpoints... and type in EUSER::User::Panic as the address to stop when creating a new breakpoint.

    [Both of these are for VC6... the commands in VC.NET may be slightly different. In Code Warrior, I have not yet managed to do this at all, because CW seems to be much lazier in loading symbol files for "unrelated" DLLs, except if I disable auto-targeting, in which case startup becomes unbearably slow...]

  7. #7
    Registered User
    Join Date
    Jul 2003
    Posts
    15

    Re: How do I catch S60 Panics in VC++?

    Thanks!

    I managed to find out the memory leak with your instructions. :)
    (In the disassembly of EUSER::User::__DbgMarkEnd, the address of the first leaking memory allocation is used as "text argument" in the call to EUSER::User::Panic. I used HookLogger to find out what type of object that was allocated...)

    Cheers
    Stefan

Similar Threads

  1. Replies: 605
    Last Post: 2011-01-20, 15:14
  2. HTTP headers for S60 3rd Ed. Browser
    By Nokia Ron in forum Mobile Web Site Development
    Replies: 16
    Last Post: 2009-09-22, 14:28
  3. Mail Sync for S60 / S60 3rd Devices
    By bmenke in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2006-09-17, 06:24
  4. What is going on with Vibration on S60?
    By amd_rikus in forum Mobile Java General
    Replies: 3
    Last Post: 2006-06-16, 00:29
  5. HTTP client s60 How to catch disconnection event?
    By _arcady_ in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2006-05-23, 16:35

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •