Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8619123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:16:07+00:00 2026-06-12T06:16:07+00:00

I have a gdb user defined command that does some setup, then might do

  • 0

I have a gdb user defined command that does some setup, then might do a simple job, or a complex job. The command follows this basic structure:

define mycmd
  # Common setup

  if ($argc == 0)
    # Some simple thing a few lines long
    ## What goes here so I exit mycmd?
  end

  # A lot of lines doing a complex thing
end

Is there a C-like return I can put in place of the ## line to terminate mycmd immediately? The return, exit, quit, stop, loop_break commands don’t do what I hoped for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:16:08+00:00Added an answer on June 12, 2026 at 6:16 am

    Is there a C-like return

    There doesn’t appear to be. A possible solution is to

    define mycmd
       ... common setup
       if (condition)
         ... do simple thing
       else
         mycmd_helper
       end
    end
    
    define mycmd_helper
       ... do complex thing
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of basic breakpoints defined in a user-defined fn setup in
When I start GDB from the command line I have no problems. But when
I'm outside gdb's target executable and I don't even have a stack that corresponds
I have a user complaining that my app is taking a lot of CPU
I have a g++ program that runs without user input. Somewhere the program is
We have installed GDB on AIX 6.1 (gdb-6.0-1.aix5.1.ppc_AIX.rpm) and I notice that there is
I have a gdb backtrace on it that yields this: #0 match_at (reg=0xcce4a00, str=0xd47b101
I have gdb 7.3 and device that supports hardware watchpoints. I type such consequent
I have looked through GDB documentation, but haven't found anything that works or shows
I am doing some work with gdb and have found references in the documentation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.