[PATCH v2] gdb/sim: add support for exporting memory map

Mike Frysinger vapier@gentoo.org
Fri Jan 8 06:05:09 GMT 2021


On 08 Jan 2021 06:17, Sebastian Huber wrote:
> On 06/01/2021 12:04, Mike Frysinger via Gdb-patches wrote:
> > This allows gdb to quickly dump & process the memory map that the sim
> > knows about.  This isn't fully accurate, but is largely limited by the
> > gdb memory map format.  While the sim supports RWX bits, gdb can only
> > handle RW or RO regions.
> > ---
> >   gdb/remote-sim.c         | 18 +++++++++++++
> >   include/gdb/remote-sim.h |  9 +++++++
> >   sim/common/sim-core.c    | 57 ++++++++++++++++++++++++++++++++++++++++
> >   3 files changed, 84 insertions(+)
> 
> I think this change broke the powerpc simulator (target "powerpc-rtems6" 
> for example):
> 
>    CXXLD  gdb
> /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: 
> remote-sim.o: in function `gdbsim_target::memory_map()':
> /tmp/sh/src/rsb/rtems/build/powerpc-rtems6-gdb-0f8e278-x86_64-linux-gnu-1/build/gdb/../../sourceware-mirror-binutils-gdb-0f8e278/gdb/remote-sim.c:1283: 
> undefined reference to `sim_memory_map'

indeed, sorry about that.  i've pushed this fix.
-mike

[PATCH] sim: ppc: stub out sim_memory_map

Not clear how to implement this in the ppc-specific sim, so just
stub it out.  This is as good as it was previously.
---
 sim/ppc/ChangeLog   | 4 ++++
 sim/ppc/sim_calls.c | 6 ++++++
 2 files changed, 10 insertions(+)

2021-01-08  Mike Frysinger  <vapier@gentoo.org>

	* sim_calls.c (sim_memory_map): Define.

--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -265,6 +265,12 @@ sim_complete_command (SIM_DESC sd, const char *text, const char *word)
   return NULL;
 }
 
+char *
+sim_memory_map (SIM_DESC sd)
+{
+  return NULL;
+}
+
 /* Polling, if required */
 
 void
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20210108/66bf8e6a/attachment.sig>


More information about the Gdb-patches mailing list