Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-29 Thread Kirill Lapshin via lldb-commits
KLapshin marked an inline comment as done.
KLapshin added a comment.

m_lldbResult usage has beed removed in ExecRun::Acknowledge() method, 
corresponding member removed from cmd class.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-28 Thread Kirill Lapshin via lldb-commits
KLapshin marked an inline comment as done.
KLapshin added a comment.

Requested changes applied, updated patch uploaded.



Comment at: tools/lldb-mi/MICmdCmdExec.h:58
@@ -57,2 +57,3 @@
 bool Acknowledge() override;
+bool ParseArgs() override;
 // From CMICmnBase

Ilia, I checked string positions for ParseArgs() method in MICmdCmdExec.h and 
other command headers - ParseArgs() placed always third, so this change done in 
accordance with current, at least public, lldb-mi headers and minimal patching 
as possible.

What inconsistency you mentioned ?

Please take a look on ExecRun command class modified with ParseArgs() method 
added and non-modified classes in lldb-mi - ExecFinish or ExecNext, for example:


```
class CMICmdCmdExecRun : public CMICmdBase
{
// Statics:
  public:
// Required by the CMICmdFactory when registering *this command
static CMICmdBase *CreateSelf();

// Methods:
  public:
/* ctor */ CMICmdCmdExecRun();

// Overridden:
  public:
// From CMICmdInvoker::ICmd
bool Execute() override;
bool Acknowledge() override;
bool ParseArgs() override;
// From CMICmnBase
/* dtor */ ~CMICmdCmdExecRun() override;

// Attributes:
  private:
lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first 
instruction or main(), just run process if not specified
};
```


```
class CMICmdCmdExecFinish : public CMICmdBase
{
// Statics:
  public:
// Required by the CMICmdFactory when registering *this command
static CMICmdBase *CreateSelf();

// Methods:
  public:
/* ctor */ CMICmdCmdExecFinish();

// Overridden:
  public:
// From CMICmdInvoker::ICmd
bool Execute() override;
bool Acknowledge() override;
bool ParseArgs() override;  <---
// From CMICmnBase
/* dtor */ ~CMICmdCmdExecFinish() override;

// Attributes:
  private:
lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgThread; // Not specified in MI spec but 
Eclipse gives this option
const CMIUtilString m_constStrArgFrame;  // Not specified in MI spec but 
Eclipse gives this option
};
```


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-28 Thread Kirill Lapshin via lldb-commits
KLapshin updated the summary for this revision.
KLapshin updated this revision to Diff 35865.

Repository:
  rL LLVM

http://reviews.llvm.org/D12977

Files:
  test/tools/lldb-mi/control/TestMiExec.py
  tools/lldb-mi/MICmdCmdExec.cpp
  tools/lldb-mi/MICmdCmdExec.h
  tools/lldb-mi/MICmdCmdSupportList.cpp

Index: tools/lldb-mi/MICmdCmdExec.cpp
===
--- tools/lldb-mi/MICmdCmdExec.cpp
+++ tools/lldb-mi/MICmdCmdExec.cpp
@@ -48,6 +48,7 @@
 // Throws:  None.
 //--
 CMICmdCmdExecRun::CMICmdCmdExecRun()
+: m_constStrArgStart("start")
 {
 // Command factory matches this name with that received from the stdin stream
 m_strMiCmd = "exec-run";
@@ -68,6 +69,23 @@
 }
 
 //++ 
+// Details: The invoker requires this function. The parses the command line options
+//  arguments to extract values for each of those arguments.
+// Type:Overridden.
+// Args:None.
+// Return:  MIstatus::success - Functional succeeded.
+//  MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdExecRun::ParseArgs()
+{
+m_setCmdArgs.Add(
+new CMICmdArgValOptionLong(m_constStrArgStart, false, true, CMICmdArgValListBase::eArgValType_OptionLong, 0));
+return ParseValidateCmdOptions();
+}
+
+//++ 
 // Details: The invoker requires this function. The command does work in this function.
 //  The command is likely to communicate with the LLDB SBDebugger in here.
 // Type:Overridden.
@@ -84,6 +102,15 @@
 lldb::SBStream errMsg;
 lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo();
 launchInfo.SetListener(rSessionInfo.GetListener());
+
+CMICMDBASE_GETOPTION(pArgStart, OptionLong, m_constStrArgStart);
+
+// Run to first instruction or main() requested ?
+if (pArgStart->GetFound())
+{
+launchInfo.SetLaunchFlags(launchInfo.GetLaunchFlags() | lldb::eLaunchFlagStopAtEntry);
+}
+
 lldb::SBProcess process = rSessionInfo.GetTarget().Launch(launchInfo, error);
 if ((!process.IsValid()) || (error.Fail()))
 {
Index: tools/lldb-mi/MICmdCmdExec.h
===
--- tools/lldb-mi/MICmdCmdExec.h
+++ tools/lldb-mi/MICmdCmdExec.h
@@ -55,6 +55,7 @@
 // From CMICmdInvoker::ICmd
 bool Execute() override;
 bool Acknowledge() override;
+bool ParseArgs() override;
 // From CMICmnBase
 /* dtor */ ~CMICmdCmdExecRun() override;
 
@@ -61,6 +62,7 @@
 // Attributes:
   private:
 lldb::SBCommandReturnObject m_lldbResult;
+const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first instruction or main(), just run process if not specified
 };
 
 //++ 
Index: tools/lldb-mi/MICmdCmdSupportList.cpp
===
--- tools/lldb-mi/MICmdCmdSupportList.cpp
+++ tools/lldb-mi/MICmdCmdSupportList.cpp
@@ -71,8 +71,13 @@
 bool
 CMICmdCmdSupportListFeatures::Acknowledge()
 {
-const CMICmnMIValueConst miValueConst("data-read-memory-bytes");
-const CMICmnMIValueList miValueList(miValueConst);
+// Declare supported features here
+const CMICmnMIValueConst miValueConst1("data-read-memory-bytes");
+const CMICmnMIValueConst miValueConst2("exec-run-start-option");
+CMICmnMIValueList miValueList(true);
+// Some features may depend on host or/and target, decide what to add below
+miValueList.Add(miValueConst1);
+miValueList.Add(miValueConst2);
 const CMICmnMIValueResult miValueResult("features", miValueList);
 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
 m_miResultRecord = miRecordResult;
Index: test/tools/lldb-mi/control/TestMiExec.py
===
--- test/tools/lldb-mi/control/TestMiExec.py
+++ test/tools/lldb-mi/control/TestMiExec.py
@@ -12,6 +12,25 @@
 
 @lldbmi_test
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+@skipIfFreeBSD # Failure presumably due to StopAtEntry most likely not implemented
+def test_lldbmi_exec_run(self):
+"""Test that 'lldb-mi --interpreter' can stop at entry."""
+
+self.spawnLldbMi(args = None)
+
+# Load executable
+self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+self.expect("\^done")
+
+# Test that program is stopped at entry
+self.runCmd("-exec-run --start")
+self.expect("\^running")
+self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"")
+# Test that lldb-mi is ready to execute 

Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-26 Thread Kirill Lapshin via lldb-commits
KLapshin added a comment.

@brucem, @enlight

Is this patch is fine for you now ?


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-26 Thread Ilia K via lldb-commits
ki.stfu requested changes to this revision.
ki.stfu added a comment.
This revision now requires changes to proceed.

Update the summary + a few inline comments below.



Comment at: test/tools/lldb-mi/startup_options/TestMiStartupOptions.py:13-31
@@ -12,3 +12,21 @@
 
 @lldbmi_test
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+@skipIfFreeBSD # Failure presumably due to StopAtEntry most likely not 
implemented
+def test_lldbmi_gdb_set_process_stopatentry_on(self):
+"""Test that 'lldb-mi --interpreter' can stop at entry."""
+
+self.spawnLldbMi(args = None)
+
+# Load executable
+self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+self.expect("\^done")
+
+# Test that program is stopped at entry
+self.runCmd("-exec-run --start")
+self.expect("\^running")
+
self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*thread-id=\"1\",stopped-threads=\"all\"")
+
+# Test that lldb-mi is ready to execute next commands
+self.expect(self.child_prompt, exactly = True)
+

And move this test case to test/tools/lldb-mi/control/TestMiExec.py


Comment at: test/tools/lldb-mi/startup_options/TestMiStartupOptions.py:16
@@ +15,3 @@
+@skipIfFreeBSD # Failure presumably due to StopAtEntry most likely not 
implemented
+def test_lldbmi_gdb_set_process_stopatentry_on(self):
+"""Test that 'lldb-mi --interpreter' can stop at entry."""

Rename it to
```
def test_lldbmi_exec_run(self):
```


Comment at: test/tools/lldb-mi/startup_options/TestMiStartupOptions.py:28
@@ +27,3 @@
+self.expect("\^running")
+
self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*thread-id=\"1\",stopped-threads=\"all\"")
+

Use lazy regex please:
```
self.expect("\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"")
```


Comment at: tools/lldb-mi/MICmdCmdExec.h:58
@@ -57,2 +57,3 @@
 bool Acknowledge() override;
+bool ParseArgs() override;
 // From CMICmnBase

Please move it on few lines above for consistency with others:
```
bool ParseArgs() override;
bool Execute() override;
[...]
```


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-25 Thread Kirill Lapshin via lldb-commits
KLapshin updated the summary for this revision.
KLapshin updated this revision to Diff 35740.
KLapshin added a comment.

Patch reworked for suggested "-exec-run --start" manner, no "CLI" interpreter 
use and check if --start option supported via -list-features.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977

Files:
  test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
  tools/lldb-mi/MICmdCmdExec.cpp
  tools/lldb-mi/MICmdCmdExec.h
  tools/lldb-mi/MICmdCmdSupportList.cpp

Index: tools/lldb-mi/MICmdCmdExec.cpp
===
--- tools/lldb-mi/MICmdCmdExec.cpp
+++ tools/lldb-mi/MICmdCmdExec.cpp
@@ -48,6 +48,7 @@
 // Throws:  None.
 //--
 CMICmdCmdExecRun::CMICmdCmdExecRun()
+: m_constStrArgStart("start")
 {
 // Command factory matches this name with that received from the stdin stream
 m_strMiCmd = "exec-run";
@@ -68,6 +69,23 @@
 }
 
 //++ 
+// Details: The invoker requires this function. The parses the command line options
+//  arguments to extract values for each of those arguments.
+// Type:Overridden.
+// Args:None.
+// Return:  MIstatus::success - Functional succeeded.
+//  MIstatus::failure - Functional failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdExecRun::ParseArgs()
+{
+m_setCmdArgs.Add(
+new CMICmdArgValOptionLong(m_constStrArgStart, false, true, CMICmdArgValListBase::eArgValType_OptionLong, 0));
+return ParseValidateCmdOptions();
+}
+
+//++ 
 // Details: The invoker requires this function. The command does work in this function.
 //  The command is likely to communicate with the LLDB SBDebugger in here.
 // Type:Overridden.
@@ -84,6 +102,15 @@
 lldb::SBStream errMsg;
 lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo();
 launchInfo.SetListener(rSessionInfo.GetListener());
+
+CMICMDBASE_GETOPTION(pArgStart, OptionLong, m_constStrArgStart);
+
+// Run to first instruction or main() requested ?
+if (pArgStart->GetFound())
+{
+launchInfo.SetLaunchFlags(launchInfo.GetLaunchFlags() | lldb::eLaunchFlagStopAtEntry);
+}
+
 lldb::SBProcess process = rSessionInfo.GetTarget().Launch(launchInfo, error);
 if ((!process.IsValid()) || (error.Fail()))
 {
Index: tools/lldb-mi/MICmdCmdExec.h
===
--- tools/lldb-mi/MICmdCmdExec.h
+++ tools/lldb-mi/MICmdCmdExec.h
@@ -55,6 +55,7 @@
 // From CMICmdInvoker::ICmd
 bool Execute() override;
 bool Acknowledge() override;
+bool ParseArgs() override;
 // From CMICmnBase
 /* dtor */ ~CMICmdCmdExecRun() override;
 
@@ -61,6 +62,7 @@
 // Attributes:
   private:
 lldb::SBCommandReturnObject m_lldbResult;
+const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first instruction or main(), just run process if not specified
 };
 
 //++ 
Index: tools/lldb-mi/MICmdCmdSupportList.cpp
===
--- tools/lldb-mi/MICmdCmdSupportList.cpp
+++ tools/lldb-mi/MICmdCmdSupportList.cpp
@@ -71,8 +71,13 @@
 bool
 CMICmdCmdSupportListFeatures::Acknowledge()
 {
-const CMICmnMIValueConst miValueConst("data-read-memory-bytes");
-const CMICmnMIValueList miValueList(miValueConst);
+// Declare supported features here
+const CMICmnMIValueConst miValueConst1("data-read-memory-bytes");
+const CMICmnMIValueConst miValueConst2("exec-run-start-option");
+CMICmnMIValueList miValueList(true);
+// Some of features may depend on host or/and target, decide what to add below
+miValueList.Add(miValueConst1);
+miValueList.Add(miValueConst2);
 const CMICmnMIValueResult miValueResult("features", miValueList);
 const CMICmnMIResultRecord miRecordResult(m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done, miValueResult);
 m_miResultRecord = miRecordResult;
Index: test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
===
--- test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
+++ test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
@@ -12,6 +12,26 @@
 
 @lldbmi_test
 @skipIfWindows #llvm.org/pr24452: Get lldb-mi tests working on Windows
+@skipIfFreeBSD # Failure presumably due to StopAtEntry most likely not implemented
+def test_lldbmi_gdb_set_process_stopatentry_on(self):
+"""Test that 'lldb-mi --interpreter' can stop at entry."""
+
+self.spawnLldbMi(args = None)
+
+# Load executable
+self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+self.expect("\^done")
+
+# Test that program is stopped at entry
+

Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-25 Thread Dawn Perchik via lldb-commits
dawn accepted this revision.
dawn added a comment.

lgtm.  Much improved.



Comment at: tools/lldb-mi/MICmdCmdSupportList.cpp:78
@@ +77,3 @@
+CMICmnMIValueList miValueList(true);
+// Some of features may depend on host or/and target, decide what to add 
below
+miValueList.Add(miValueConst1);

Fix comment: Some of features => Some features


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-25 Thread Kirill Lapshin via lldb-commits
KLapshin marked an inline comment as done.
KLapshin added a comment.

"CLI" intepreter not used in ExecRun handler in reworked patch.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-21 Thread Kirill Lapshin via lldb-commits
KLapshin added a comment.

In http://reviews.llvm.org/D12977#249437, @enlight wrote:

> According to the GDB-MI spec the exec-run 
> 
>  command already has a **start** option. Support for the **start** option can 
> be detected by checking for **exec-run-start-option** in the list of features 
> returned by the list-features 
> 
>  command. So, what's the rationale for diverging from the spec in this case?
>
> In GDB your example would be written as:
>  -exec-run --start


Fully agreed.

At same time - this option is relatively new, was not present in older GDBs. 
For example - GDB used in Xcode before switch to lldb just do stop at 
_dyld_start unconditionally always, no option.

Thanks for review, patch will be changed.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-21 Thread Kirill Lapshin via lldb-commits
KLapshin added inline comments.


Comment at: tools/lldb-mi/MICmdCmdExec.cpp:92
@@ +91,3 @@
+const char *pCmd = bProcessMustStopAtEntry ? "process launch -s" : 
"process launch";
+const lldb::ReturnStatus rtn = 
rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(pCmd, 
m_lldbResult);
+MIunused(rtn);

enlight wrote:
> The process should be launched through the SB API, not the command 
> interpreter. I'm not very familiar with the SB API but I'd try using the 
> **lldb::eLaunchFlagStopAtEntry** flag with **SBLaunchInfo::SetLaunchFlags()**.
You are right, no doubt - this is clear what Target and Process API direct 
usage is faster and straightforward manner.

Just couple words regarding why interpreter used instead here - patch was 
prepared at moment when lldb-MI had lack synchronization (via Listener) with 
lldb Core, so setting corresponding flag gave random results - app may stop or 
not. Via interpreter it worked fine always - that's why I stated "more 
reliable" in review header.

I will check if flag pass is enough currently - this will make patch shorter 
and clearer.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-20 Thread Bruce Mitchener via lldb-commits
brucem added a subscriber: brucem.
brucem requested changes to this revision.
brucem added a reviewer: brucem.
brucem added a comment.
This revision now requires changes to proceed.

I think that enlight is correct in his comments and that this patch should be 
revised.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-19 Thread Vadim Macagon via lldb-commits
enlight added a subscriber: enlight.
enlight added a comment.

According to the GDB-MI spec the exec-run 

 command already has a **start** option. Support for the **start** option can 
be detected by checking for **exec-run-start-option** in the list of features 
returned by the list-features 

 command. So, what's the rationale for diverging from the spec in this case?

In GDB your example would be written as:
-exec-run --start



Comment at: tools/lldb-mi/MICmdCmdExec.cpp:92
@@ +91,3 @@
+const char *pCmd = bProcessMustStopAtEntry ? "process launch -s" : 
"process launch";
+const lldb::ReturnStatus rtn = 
rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(pCmd, 
m_lldbResult);
+MIunused(rtn);

The process should be launched through the SB API, not the command interpreter. 
I'm not very familiar with the SB API but I'd try using the 
**lldb::eLaunchFlagStopAtEntry** flag with **SBLaunchInfo::SetLaunchFlags()**.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-18 Thread Dawn Perchik via lldb-commits
dawn added a comment.

lgtm, but Ilia and Abid are more familiar with lldb-mi - please wait for their 
review.


Repository:
  rL LLVM

http://reviews.llvm.org/D12977



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D12977: LLDB MI addition for getting process stopped at first instruction right after launch via -exec-run

2015-09-18 Thread Kirill Lapshin via lldb-commits
KLapshin updated the summary for this revision.
KLapshin removed rL LLVM as the repository for this revision.
KLapshin updated this revision to Diff 35109.
KLapshin added a comment.

Minor initial diff cleanup.


http://reviews.llvm.org/D12977

Files:
  test/tools/lldb-mi/TestMiGdbSetShow.py
  tools/lldb-mi/MICmdCmdExec.cpp
  tools/lldb-mi/MICmdCmdGdbSet.cpp
  tools/lldb-mi/MICmdCmdGdbSet.h
  tools/lldb-mi/MICmdCmdGdbShow.cpp
  tools/lldb-mi/MICmdCmdGdbShow.h
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
  tools/lldb-mi/MICmnResources.cpp
  tools/lldb-mi/MICmnResources.h

Index: tools/lldb-mi/MICmnResources.h
===
--- tools/lldb-mi/MICmnResources.h
+++ tools/lldb-mi/MICmnResources.h
@@ -266,6 +266,7 @@
 IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH,
 IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS,
 IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION,
+IDS_CMD_ERR_GDBSET_OPT_PROCESS_STOPATENTRY,
 IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS,
 IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION,
 IDS_CMD_ERR_EXPR_INVALID,
Index: tools/lldb-mi/MICmnResources.cpp
===
--- tools/lldb-mi/MICmnResources.cpp
+++ tools/lldb-mi/MICmnResources.cpp
@@ -249,6 +249,7 @@
 {IDS_CMD_ERR_GDBSET_OPT_SOLIBSEARCHPATH, "'solib-search-path' requires at least one argument"},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_BAD_ARGS, "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSET_OPT_PRINT_UNKNOWN_OPTION, "'print' error. The option '%s' not found"},
+{IDS_CMD_ERR_GDBSET_OPT_PROCESS_STOPATENTRY, "'process-stopatentry' expects \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_BAD_ARGS, "'print' expects option-name and \"on\" or \"off\""},
 {IDS_CMD_ERR_GDBSHOW_OPT_PRINT_UNKNOWN_OPTION, "'print' error. The option '%s' not found"},
 {IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
Index: tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
===
--- tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
+++ tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
@@ -182,6 +182,7 @@
 const CMIUtilString m_constStrPrintCharArrayAsString;
 const CMIUtilString m_constStrPrintExpandAggregates;
 const CMIUtilString m_constStrPrintAggregateFieldNames;
+const CMIUtilString m_constStrProcessStopAtEntry;
 
 // Typedefs:
   private:
Index: tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
===
--- tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
+++ tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
@@ -42,6 +42,7 @@
 , m_constStrSharedDataSolibPath("Solib Path")
 , m_constStrPrintCharArrayAsString("Print CharArrayAsString")
 , m_constStrPrintExpandAggregates("Print ExpandAggregates")
+, m_constStrProcessStopAtEntry("Process StopAtEntry")
 , m_constStrPrintAggregateFieldNames("Print AggregateFieldNames")
 {
 }
Index: tools/lldb-mi/MICmdCmdGdbShow.h
===
--- tools/lldb-mi/MICmdCmdGdbShow.h
+++ tools/lldb-mi/MICmdCmdGdbShow.h
@@ -70,6 +70,7 @@
 bool OptionFnPrint(const CMIUtilString::VecString_t );
 bool OptionFnLanguage(const CMIUtilString::VecString_t );
 bool OptionFnFallback(const CMIUtilString::VecString_t );
+bool OptionFnProcessStopAtEntry(const CMIUtilString::VecString_t );
 
 // Attributes:
   private:
Index: tools/lldb-mi/MICmdCmdGdbShow.cpp
===
--- tools/lldb-mi/MICmdCmdGdbShow.cpp
+++ tools/lldb-mi/MICmdCmdGdbShow.cpp
@@ -27,6 +27,7 @@
 // Instantiations:
 const CMICmdCmdGdbShow::MapGdbOptionNameToFnGdbOptionPtr_t CMICmdCmdGdbShow::ms_mapGdbOptionNameToFnGdbOptionPtr = {
 {"target-async", ::OptionFnTargetAsync},
+{"process-stopatentry", ::OptionFnProcessStopAtEntry},
 {"print", ::OptionFnPrint},
 {"language", ::OptionFnLanguage},
 {"fallback", ::OptionFnFallback}};
@@ -246,6 +247,31 @@
 }
 
 //++ 
+// Details: Carry out work to complete the GDB show option 'process-stopatentry' to prepare
+//  and send back the requested information.
+// Type:Method.
+// Args:vrWords - (R) List of additional parameters used by this option.
+// Return:  MIstatus::success - Function succeeded.
+//  MIstatus::failure - Function failed.
+// Throws:  None.
+//--
+bool
+CMICmdCmdGdbShow::OptionFnProcessStopAtEntry(const CMIUtilString::VecString_t )
+{
+MIunused(vrWords);
+
+CMICmnLLDBDebugSessionInfo (CMICmnLLDBDebugSessionInfo::Instance());
+
+bool bProcessMustStopAtEntry = false;
+
+// Get current process stopatentry flag value and set result string
+m_strValue = (rSessionInfo.SharedDataRetrieve(rSessionInfo.m_constStrProcessStopAtEntry,