Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runners: jlink: Add support for thread info #34660

Merged
merged 17 commits into from
May 3, 2021

Commits on Apr 28, 2021

  1. runners: tests: fix os.path.isfile patch

    Copy a fix from test_nrfjprog.py to the other runner test suites. The
    current code will enter an infinite recursion if you hit the path
    where os.path.isfile is called, since it's been patched to
    os_path_isfile_patch in the calling context. The fix is to cache the
    'real' version in the parent scope and call it directly as a fallback.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    59f06bd View commit details
    Browse the repository at this point in the history
  2. runners: core: return shutil.which() value from require()

    Make it easy to get the full path to a required binary.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    88aba62 View commit details
    Browse the repository at this point in the history
  3. runners: core: try to improve --dt-flash option help

    This option has existed since the beginning of the runners package,
    which greatly predates the way DT is used in zephyr right now. It
    never really worked the way I wanted it to but it's too much work to
    fix it now. Try to improve the help a bit at least while I'm looking
    at it again.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    23e9fdc View commit details
    Browse the repository at this point in the history
  4. runners: core: refactor helper for getting flash address

    Separate the logic that gets the right address from .config
    into its own helper.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    1242c14 View commit details
    Browse the repository at this point in the history
  5. runners: core: add **kwargs to other subprocess wrappers

    Just to make these match check_output().
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 28, 2021
    Configuration menu
    Copy the full SHA
    a591d7c View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2021

  1. runners: core: add build_conf property

    Make it easier to get a BuildConfiguration from runner code.
    Stash the result so it only has to be computed once.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 29, 2021
    Configuration menu
    Copy the full SHA
    f95d7a3 View commit details
    Browse the repository at this point in the history
  2. requirements-base.txt: add pylink

    This will be used to deal with the Segger shared library in a portable
    way in the jlink runner.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 29, 2021
    Configuration menu
    Copy the full SHA
    aec619d View commit details
    Browse the repository at this point in the history

Commits on Apr 30, 2021

  1. runners: jlink: replace version parsing code

    JLink versions like 'V7.0a' do not conform to PEP 440 version
    conventions; the 'a' part is used by PEP 440 compliant versions for
    alphas. It gets parsed to a legacy type by the packaging library,
    which always is treated as a lower value when compared with a
    conforming version string.
    
    To fix, get the version from the shared library distributed with the
    JLink tools. This has the side benefit of making the code work on
    Windows. That's merely a nice to have for -nogui 1 detection for now,
    but will be essential in the next commit.
    
    Reported-by: Jake Mercer <[email protected]>
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    6f74cef View commit details
    Browse the repository at this point in the history
  2. runners: jlink: fix --commander help

    The default commander path is platform specific.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    cf33505 View commit details
    Browse the repository at this point in the history
  3. runners: jlink: clean up commander script logging

    Put it all in one log message rather than splitting it up.
    
    This makes it look cleaner now that each log message is prefixed with
    'runners.link:'.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    6b7ce23 View commit details
    Browse the repository at this point in the history
  4. runners: jlink: rework --dt-flash handling

    Defer loading .config until we really need it, when we are flashing a
    binary. Pre-emptively loading it is wasted effort if we're flashing a
    .hex, which has been the default behavior when possible since
    dcaabb8 ("west: runners: jlink: prefer .hex over .bin").
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    f8c0c23 View commit details
    Browse the repository at this point in the history
  5. runners: jlink: silence commander output by default

    This is really verbose, and I doubt anyone cares unless there is a
    problem. Keep it around when run as 'west -v flash' to allow for
    debugging, though.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    aa22d7d View commit details
    Browse the repository at this point in the history
  6. runners: tests: don't patch BuildConfiguration

    Instead of mocking out the BuildConfiguration class, just create its
    input file and let the real class do the work.
    
    This in turn exposes a bug in the way the board name is being pulled
    out of the BuildConfiguration, which we fix to keep the tests passing.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    7a8fa21 View commit details
    Browse the repository at this point in the history
  7. scripts: re-work BuildConfiguration boolean handling

    Set options that are definitely true or false to True or False in the
    options dict. Add a 'getboolean' method that also allows a fallback to
    False in case the option is not mentioned in .config due to unmet
    dependencies. This allows calling code to just ask about the option
    they are interested in, even if the .config file doesn't mention the
    option at all.
    
    Propagate this to users within the runners package and 'west sign',
    taking advantage of the new build_conf property.
    
    Rename the 'bcfg' internal variable in sign.py to 'build_conf' to
    match other source files that use BuildConfiguration instances, to
    make it easier to grep for users.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    e24a476 View commit details
    Browse the repository at this point in the history
  8. runners: core: add thread_info_enabled property

    This makes it easier for runners to check if the binary has thread
    info support turned on, allowing automatic configuration of the
    underlying tool to support threads, if possible.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    f0df183 View commit details
    Browse the repository at this point in the history
  9. runners: jlink: extend 'nogui' support

    Support this when debugging also.
    
    Tweak the style for brevity also while we're here by propertizing the
    supports_nogui method, etc.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    b1e603b View commit details
    Browse the repository at this point in the history
  10. runners: jlink: support thread_info_enabled

    Automatically enable per-thread info in GDB if the binary and J-Link
    support it.
    
    Signed-off-by: Martí Bolívar <[email protected]>
    mbolivar-nordic committed Apr 30, 2021
    Configuration menu
    Copy the full SHA
    0413848 View commit details
    Browse the repository at this point in the history