public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`
@ 2021-12-09 19:12 Simon Marchi
  2021-12-09 20:30 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2021-12-09 19:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

I suppose this code was copied from GDBserver and this ifndef was left
there.  As far as I know, IN_PROCESS_AGENT will never be defined when
building this file, so we can remove this.

Change-Id: I84fc408e330b3a29106df830a09342861cadbaf6
---
 gdbsupport/tdesc.cc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gdbsupport/tdesc.cc b/gdbsupport/tdesc.cc
index c04f4943fc08..b2deea046139 100644
--- a/gdbsupport/tdesc.cc
+++ b/gdbsupport/tdesc.cc
@@ -400,7 +400,6 @@ void print_xml_feature::visit (const tdesc_reg *r)
 
 void print_xml_feature::visit_pre (const target_desc *e)
 {
-#ifndef IN_PROCESS_AGENT
   add_line ("<?xml version=\"1.0\"?>");
   add_line ("<!DOCTYPE target SYSTEM \"gdb-target.dtd\">");
   add_line ("<target>");
@@ -418,7 +417,6 @@ void print_xml_feature::visit_pre (const target_desc *e)
   for (const auto &c : compatible_list)
     add_line ("<compatible>%s</compatible>",
 	      tdesc_compatible_info_arch_name (c));
-#endif
 }
 
 void print_xml_feature::visit_post (const target_desc *e)
-- 
2.26.2


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

* Re: [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`
  2021-12-09 19:12 [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT` Simon Marchi
@ 2021-12-09 20:30 ` Tom Tromey
  2021-12-09 20:53   ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2021-12-09 20:30 UTC (permalink / raw)
  To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi

Simon> I suppose this code was copied from GDBserver and this ifndef was left
Simon> there.  As far as I know, IN_PROCESS_AGENT will never be defined when
Simon> building this file, so we can remove this.

Yeah -- that is only provided by the gdbserver Makefile, so I think this
is correct.  Thank you.

Tom

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

* Re: [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`
  2021-12-09 20:30 ` Tom Tromey
@ 2021-12-09 20:53   ` Simon Marchi
  2021-12-10  0:05     ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Marchi @ 2021-12-09 20:53 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi via Gdb-patches

On 2021-12-09 3:30 p.m., Tom Tromey wrote:
> Simon> I suppose this code was copied from GDBserver and this ifndef was left
> Simon> there.  As far as I know, IN_PROCESS_AGENT will never be defined when
> Simon> building this file, so we can remove this.
> 
> Yeah -- that is only provided by the gdbserver Makefile, so I think this
> is correct.  Thank you.
> 
> Tom
> 

Ok, thanks, pushed.

Simon

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

* Re: [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT`
  2021-12-09 20:53   ` Simon Marchi
@ 2021-12-10  0:05     ` Simon Marchi
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2021-12-10  0:05 UTC (permalink / raw)
  To: Simon Marchi, Tom Tromey, Simon Marchi via Gdb-patches



On 2021-12-09 15:53, Simon Marchi via Gdb-patches wrote:
> On 2021-12-09 3:30 p.m., Tom Tromey wrote:
>> Simon> I suppose this code was copied from GDBserver and this ifndef was left
>> Simon> there.  As far as I know, IN_PROCESS_AGENT will never be defined when
>> Simon> building this file, so we can remove this.
>>
>> Yeah -- that is only provided by the gdbserver Makefile, so I think this
>> is correct.  Thank you.
>>
>> Tom
>>
> 
> Ok, thanks, pushed.
> 
> Simon
> 

Well that was wrong:

  CXXLD  libinproctrace.so                                                                                                                                    
/usr/bin/ld: gdbsupport/tdesc-ipa.o: in function `print_xml_feature::visit_pre(target_desc const*)':                                                          
/home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:407: undefined reference to `tdesc_architecture_name(target_desc const*)'                      
/usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:408: undefined reference to `tdesc_architecture_name(target_desc const*)'         
/usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:411: undefined reference to `tdesc_osabi_name(target_desc const*)'                
/usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:416: undefined reference to `tdesc_compatible_info_list(target_desc const*)'      
/usr/bin/ld: /home/simark/src/binutils-gdb/gdbserver/../gdbsupport/tdesc.cc:418: undefined reference to `tdesc_compatible_info_arch_name(std::unique_ptr<tdesc
_compatible_info, std::default_delete<tdesc_compatible_info> > const&)'     

I pushed a revert patch.

I had now idea, but libinproctrace.so builds its own version of the
gdbsupport files it needs:

$ ls -l gdbserver/gdbsupport/tdesc-ipa.o 
-rw-r--r-- 1 simark simark 1108504 Dec  9 19:04 gdbserver/gdbsupport/tdesc-ipa.o

Simon

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

end of thread, other threads:[~2021-12-10  0:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09 19:12 [PATCH] gdbsupport: remove unnecessary `#ifndef IN_PROCESS_AGENT` Simon Marchi
2021-12-09 20:30 ` Tom Tromey
2021-12-09 20:53   ` Simon Marchi
2021-12-10  0:05     ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).