Resources | Resources |



Debugging dynamic modules without csmods.cmm

If the csmods.cmm and cs.t32 scripts are not available, you can use this procedure to debug Brew MP dynamic modules.

  1. From Trace32, run this script (which resides in the build/ms directory):
    do jnreset
  2. From Trace32, enter the following command:
    b.s CoModDb_NotifyLoaded
  3. From Trace32, press F7 to run the program.

    You will hit the break point at CoModDb_NotifyLoaded.

  4. Examine the module being loaded by looking at the pclm.cpszFile local variable. This variable will show the module that is being loaded. If this is not the module you intend to debug, press F7 to advance to the next time the breakpoint on CoModDb_NotifyLoaded() is hit. Do this until the module you wish to debug is shown in pclm.cpszFile.
  5. Use the CoLoadedMod datastructure to get the start address from this variable:
  6. Load the ELF with the start address obtained in the previous step, for example:

    Note: This command should be entered on one line.

    d.load.elf C:\tsg\source\qcom\qct\platform\brewmp
                   \IBTCnxn.elf 0xB0210044 /nocode /noclear
  7. Add the search path for the module that was just loaded, for example:

    Note: This command should be entered on one line.

    y.spath.srd + =C:\tsg\source\qcom\qct\platform\brewmp
  8. Verify that the symbols were loaded by viewing a function from the module, for example:
    d.l BTCnxn_New
  9. Now set breakpoints in the code, and debug the module.