public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
@ 2022-04-11  1:16 Rebecca Cran
  2022-04-11  1:16 ` [PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py Rebecca Cran
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11  1:16 UTC (permalink / raw)
  To: devel; +Cc: Rebecca Cran, Leif Lindholm, Ard Biesheuvel

I ran into some problems debugging EDK2 code using Development Studio with
the files under ArmPlatformPkg/Scripts and these patches fix them.

I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
these changes would break things for people using the older environment.

Rebecca Cran (3):
  ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
  ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
  ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile

 ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
 ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
 ArmPlatformPkg/Scripts/Makefile                | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
  2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
@ 2022-04-11  1:16 ` Rebecca Cran
  2022-04-11  1:16 ` [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py Rebecca Cran
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11  1:16 UTC (permalink / raw)
  To: devel; +Cc: Rebecca Cran, Leif Lindholm, Ard Biesheuvel

An error message in Scripts/Ds5/edk2_debugger.py was missing the word
'not'.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
index 9713f8bfaca2..4cd378dffd16 100644
--- a/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
+++ b/ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py
@@ -222,4 +222,4 @@ class ArmPlatformDebugger:
             self.debug_info_table.load_all_symbols(self.verbose)
         except:
             # Debugger exception could be excepted if DRAM has not been initialized or if we have not started to run from DRAM yet
-            print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has been installed yet)"
+            print "Note: no symbols have been found in System Memory (possible cause: the UEFI permanent memory has not been installed yet)"
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
  2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
  2022-04-11  1:16 ` [PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py Rebecca Cran
@ 2022-04-11  1:16 ` Rebecca Cran
  2022-04-11 17:39   ` Rebecca Cran
  2022-04-11  1:16 ` [PATCH 3/3] ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile Rebecca Cran
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11  1:16 UTC (permalink / raw)
  To: devel; +Cc: Rebecca Cran, Leif Lindholm, Ard Biesheuvel

The debugger in Arm Development Studio 2021.2 doesn't work with
"ec = debugger.getExecutionContext(0)" because it's subsequently unable
to access memory. Fix it by switching to
"ec = debugger.getCurrentExecutionContext()".

The documentation for waitForStop() says:

"It is not needed after a call to stop() because stop() is blocking."

So, remove the call to waitForStop.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
index 89d2f28ba27d..cb4db148dedf 100644
--- a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
+++ b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
@@ -85,11 +85,10 @@ else:
 debugger = Debugger()
 
 # Initialisation commands
-ec = debugger.getExecutionContext(0)
+ec = debugger.getCurrentExecutionContext()
 ec.getExecutionService().stop()
-ec.getExecutionService().waitForStop()
 # in case the execution context reference is out of date
-ec = debugger.getExecutionContext(0)
+ec = debugger.getCurrentExecutionContext()
 
 try:
     armplatform_debugger = edk2_debugger.ArmPlatformDebugger(ec, report_file, regions, verbose)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/3] ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
  2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
  2022-04-11  1:16 ` [PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py Rebecca Cran
  2022-04-11  1:16 ` [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py Rebecca Cran
@ 2022-04-11  1:16 ` Rebecca Cran
  2022-04-11  1:18 ` [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
  2022-04-20  0:43 ` Rebecca Cran
  4 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11  1:16 UTC (permalink / raw)
  To: devel; +Cc: Rebecca Cran, Leif Lindholm, Ard Biesheuvel

With GNU Make 4.2.1, ifeq ($(EDK2_DSC),"") doesn't catch the case where
EDK2_DSC isn't defined. So, switch to using ifndef.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 ArmPlatformPkg/Scripts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPlatformPkg/Scripts/Makefile b/ArmPlatformPkg/Scripts/Makefile
index da949dc1ed56..270fc80b6ae8 100644
--- a/ArmPlatformPkg/Scripts/Makefile
+++ b/ArmPlatformPkg/Scripts/Makefile
@@ -12,7 +12,7 @@ EDK2_TOOLCHAIN ?= RVCTLINUX
 EDK2_ARCH ?= ARM
 EDK2_BUILD ?= DEBUG
 
-ifeq ($(EDK2_DSC),"")
+ifndef EDK2_DSC
   $(error The Makfile macro 'EDK2_DSC' must be defined with an EDK2 DSC file.)
 endif
 ifeq ("$(EDK2_DSC)","ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc")
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
  2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
                   ` (2 preceding siblings ...)
  2022-04-11  1:16 ` [PATCH 3/3] ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile Rebecca Cran
@ 2022-04-11  1:18 ` Rebecca Cran
  2022-04-13 16:51   ` [edk2-devel] " Ard Biesheuvel
  2022-04-20  0:43 ` Rebecca Cran
  4 siblings, 1 reply; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11  1:18 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

Also, I noticed Scripts/Makefile defaults to RVCT. Are people still using that, or has everyone moved to gcc or the newer Arm compilers?

-- 
Rebecca Cran


On 4/10/22 19:16, Rebecca Cran wrote:
> I ran into some problems debugging EDK2 code using Development Studio with
> the files under ArmPlatformPkg/Scripts and these patches fix them.
>
> I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
> these changes would break things for people using the older environment.
>
> Rebecca Cran (3):
>    ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
>    ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
>    ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
>
>   ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
>   ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
>   ArmPlatformPkg/Scripts/Makefile                | 2 +-
>   3 files changed, 4 insertions(+), 5 deletions(-)
>

[-- Attachment #2: Type: text/html, Size: 1307 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
  2022-04-11  1:16 ` [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py Rebecca Cran
@ 2022-04-11 17:39   ` Rebecca Cran
  0 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2022-04-11 17:39 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

Since the documentation was a bit difficult to find, I'll make a note here.

For Development Studio 2021.2 it was in 
/opt/arm/developmentstudio-2021.2/sw/ide/plugins/com.arm.debug.interpreter.jython.api_2021.2.0.20211118_074138/doc/arm_ds.html 
.


-- 
Rebecca Cran


On 4/10/22 19:16, Rebecca Cran wrote:
> The debugger in Arm Development Studio 2021.2 doesn't work with
> "ec = debugger.getExecutionContext(0)" because it's subsequently unable
> to access memory. Fix it by switching to
> "ec = debugger.getCurrentExecutionContext()".
>
> The documentation for waitForStop() says:
>
> "It is not needed after a call to stop() because stop() is blocking."
>
> So, remove the call to waitForStop.
>
> Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
> ---
>   ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
> index 89d2f28ba27d..cb4db148dedf 100644
> --- a/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
> +++ b/ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py
> @@ -85,11 +85,10 @@ else:
>   debugger = Debugger()
>   
>   # Initialisation commands
> -ec = debugger.getExecutionContext(0)
> +ec = debugger.getCurrentExecutionContext()
>   ec.getExecutionService().stop()
> -ec.getExecutionService().waitForStop()
>   # in case the execution context reference is out of date
> -ec = debugger.getExecutionContext(0)
> +ec = debugger.getCurrentExecutionContext()
>   
>   try:
>       armplatform_debugger = edk2_debugger.ArmPlatformDebugger(ec, report_file, regions, verbose)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
  2022-04-11  1:18 ` [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
@ 2022-04-13 16:51   ` Ard Biesheuvel
  2022-04-13 16:56     ` Rebecca Cran
  0 siblings, 1 reply; 10+ messages in thread
From: Ard Biesheuvel @ 2022-04-13 16:51 UTC (permalink / raw)
  To: edk2-devel-groups-io, Rebecca Cran; +Cc: Leif Lindholm, Ard Biesheuvel

On Mon, 11 Apr 2022 at 03:18, Rebecca Cran <rebecca@bsdio.com> wrote:
>
> Also, I noticed Scripts/Makefile defaults to RVCT. Are people still using that, or has everyone moved to gcc or the newer Arm compilers?
>

RVCT is 32-bit only, as far as I know, so I don't think anyone still
cares about it.

> --
> Rebecca Cran
>
>
> On 4/10/22 19:16, Rebecca Cran wrote:
>
> I ran into some problems debugging EDK2 code using Development Studio with
> the files under ArmPlatformPkg/Scripts and these patches fix them.
>
> I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
> these changes would break things for people using the older environment.
>
> Rebecca Cran (3):
>   ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
>   ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
>   ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
>
>  ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
>  ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
>  ArmPlatformPkg/Scripts/Makefile                | 2 +-
>  3 files changed, 4 insertions(+), 5 deletions(-)
>
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [edk2-devel] [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
  2022-04-13 16:51   ` [edk2-devel] " Ard Biesheuvel
@ 2022-04-13 16:56     ` Rebecca Cran
  0 siblings, 0 replies; 10+ messages in thread
From: Rebecca Cran @ 2022-04-13 16:56 UTC (permalink / raw)
  To: devel, ardb, Rebecca Cran; +Cc: Leif Lindholm, Ard Biesheuvel

On 4/13/22 10:51, Ard Biesheuvel wrote:
> On Mon, 11 Apr 2022 at 03:18, Rebecca Cran <rebecca@bsdio.com> wrote:
>> Also, I noticed Scripts/Makefile defaults to RVCT. Are people still using that, or has everyone moved to gcc or the newer Arm compilers?
>>
> RVCT is 32-bit only, as far as I know, so I don't think anyone still
> cares about it.

Thanks. If there's agreement I can put together a set of patches to 
remove support from the various places we have it in the tree (e.g. 
here, Conf/tools_def.txt etc.)

-- 
Rebecca Cran

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
  2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
                   ` (3 preceding siblings ...)
  2022-04-11  1:18 ` [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
@ 2022-04-20  0:43 ` Rebecca Cran
  2022-05-03  9:14   ` Ard Biesheuvel
  4 siblings, 1 reply; 10+ messages in thread
From: Rebecca Cran @ 2022-04-20  0:43 UTC (permalink / raw)
  To: devel; +Cc: Leif Lindholm, Ard Biesheuvel

Could I get some reviews on this please?


-- 

Rebecca Cran


On 4/10/22 19:16, Rebecca Cran wrote:
> I ran into some problems debugging EDK2 code using Development Studio with
> the files under ArmPlatformPkg/Scripts and these patches fix them.
>
> I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
> these changes would break things for people using the older environment.
>
> Rebecca Cran (3):
>    ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
>    ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
>    ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
>
>   ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
>   ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
>   ArmPlatformPkg/Scripts/Makefile                | 2 +-
>   3 files changed, 4 insertions(+), 5 deletions(-)
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile
  2022-04-20  0:43 ` Rebecca Cran
@ 2022-05-03  9:14   ` Ard Biesheuvel
  0 siblings, 0 replies; 10+ messages in thread
From: Ard Biesheuvel @ 2022-05-03  9:14 UTC (permalink / raw)
  To: Rebecca Cran; +Cc: edk2-devel-groups-io, Leif Lindholm, Ard Biesheuvel

On Wed, 20 Apr 2022 at 02:43, Rebecca Cran <rebecca@bsdio.com> wrote:
>
> Could I get some reviews on this please?
>

Merged as #2849

Thanks,

>
> --
>
> Rebecca Cran
>
>
> On 4/10/22 19:16, Rebecca Cran wrote:
> > I ran into some problems debugging EDK2 code using Development Studio with
> > the files under ArmPlatformPkg/Scripts and these patches fix them.
> >
> > I'm using Arm Development Studio 2021.2 and not DS-5, so I'm not sure if
> > these changes would break things for people using the older environment.
> >
> > Rebecca Cran (3):
> >    ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py
> >    ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py
> >    ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile
> >
> >   ArmPlatformPkg/Scripts/Ds5/cmd_load_symbols.py | 5 ++---
> >   ArmPlatformPkg/Scripts/Ds5/edk2_debugger.py    | 2 +-
> >   ArmPlatformPkg/Scripts/Makefile                | 2 +-
> >   3 files changed, 4 insertions(+), 5 deletions(-)
> >

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-05-03  9:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11  1:16 [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
2022-04-11  1:16 ` [PATCH 1/3] ArmPlatformPkg: Fix error message in Scripts/Ds5/edk2_debugger.py Rebecca Cran
2022-04-11  1:16 ` [PATCH 2/3] ArmPlatformPkg: Fix target initialisation in cmd_load_symbols.py Rebecca Cran
2022-04-11 17:39   ` Rebecca Cran
2022-04-11  1:16 ` [PATCH 3/3] ArmPlatformPkg: Fix EDK2_DSC check in Scripts/Makefile Rebecca Cran
2022-04-11  1:18 ` [PATCH 0/3] ArmPlatformPkg: Fix Scripts/Ds5 debugging and Makefile Rebecca Cran
2022-04-13 16:51   ` [edk2-devel] " Ard Biesheuvel
2022-04-13 16:56     ` Rebecca Cran
2022-04-20  0:43 ` Rebecca Cran
2022-05-03  9:14   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox